Skip to content
Snippets Groups Projects
Commit 420ea100 authored by Andreas Dedner's avatar Andreas Dedner
Browse files

Merge branch 'bugfix/addIsGeneratedCommentToSetupPyPyprojectToml' into 'master'

Have 'dunepackaging.py' add a 'is generated' comment to both setup.py and pyproject.toml.

See merge request !1032
parents e1c07f3e 594debab
No related branches found
No related tags found
1 merge request!1032Have 'dunepackaging.py' add a 'is generated' comment to both setup.py and pyproject.toml.
Pipeline #40675 passed with warnings
Pipeline: Dune Nightly Test

#40676

    ......@@ -92,6 +92,13 @@ def main(argv):
    # Generate setup.py
    print("Generate setup.py")
    f = open("setup.py", "w")
    f.write("""#
    # DO NOT MODIFY THIS FILE!
    # This file is autogenerated by the `dunepackaging.py` script and
    # only used for the pypi dune packages. This file will not be included in
    # the build directory.
    #
    """)
    f.write("import os, sys\n")
    if data.name == 'dune-common':
    f.write("here = os.path.dirname(os.path.abspath(__file__))\n")
    ......@@ -109,9 +116,22 @@ def main(argv):
    # Generate pyproject.toml
    print("Generate pyproject.toml")
    f = open("pyproject.toml", "w")
    f.write("""#
    # DO NOT MODIFY THIS FILE!
    # This file is autogenerated by the `dunepackaging.py` script and
    # only used for the pypi dune packages. This file will not be included in
    # the build directory.
    #
    # This is uses the `Python-Requires` field in the `dune.modules` file to
    # populate the `requires` entry. Additional packages needed for the package
    # build should be added in the `dune.modules`. These packages will then also be
    # included in the package install from source.
    #
    """)
    requires = data.asPythonRequirementString(data.depends + data.python_requires)
    minimal = ["pip", "setuptools", "wheel", "scikit-build", "cmake", "ninja", "requests"]
    requires += [r for r in minimal if not any([a.startswith(r) for a in requires])]
    requires.sort()
    f.write("[build-system]\n")
    f.write("requires = "+requires.__str__()+"\n")
    f.write("build-backend = 'setuptools.build_meta'\n")
    ......
    #
    # DO NOT MODIFY THIS FILE!
    # This file is autogenerated by the `dunepackaging.py` script and
    # only used for the pypi dune packages. This file will not be included in
    # the build directory.
    #
    # This is uses the `Python-Requires` field in the `dune.modules` file to
    # populate the `requires` entry. Additional packages needed for the package
    # build should be added in the `dune.modules`. These packages will then also be
    # included in the package install from source.
    #
    [build-system]
    requires = ['setuptools', 'wheel', 'scikit-build', 'cmake', 'ninja', 'requests', 'portalocker', 'numpy', 'mpi4py']
    requires = ['cmake', 'jinja2', 'mpi4py', 'ninja', 'numpy', 'pip>=21.0.0', 'portalocker', 'requests', 'scikit-build', 'setuptools', 'wheel']
    build-backend = 'setuptools.build_meta'
    ......@@ -325,7 +325,7 @@ def metaData(version=None, dependencyCheck=True):
    try:
    with io.open('pyproject.toml', 'r', encoding='utf-8') as f:
    for line in f:
    if 'requires' in line:
    if not line.startswith("#") and 'requires' in line:
    line = line.split('=',maxsplit=1)[1].strip()
    modules = ast.literal_eval(line)
    modules = [x for x in modules
    ......
    #
    # DO NOT MODIFY THIS FILE!
    # This file is autogenerated by the `dunepackaging.py` script and
    # only used for the pypi dune packages. This file will not be included in
    # the build directory.
    #
    import os, sys
    here = os.path.dirname(os.path.abspath(__file__))
    mods = os.path.join(here, "python", "dune")
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment