BLD: specify build-system and move project metadata to pyproject.toml#7279
BLD: specify build-system and move project metadata to pyproject.toml#7279mwtoews wants to merge 5 commits into
Conversation
oliver-sanders
left a comment
There was a problem hiding this comment.
Hi @mwtoews, thanks for your interest in the Cylc project.
Unfortunately, the package does not build, producing a ModuleNotFoundError: No module named 'cylc' error. This might be to do with package finding, note, cylc.flow is a namespace package.
Please could you rebase this branch to resolve the conflict in the CHANGES file (rebase not merge).
I've gone through and marked all of the changes (beyond the expected) I could find for the benefit of other reviewers.
| [project] | ||
| name = "cylc-flow" | ||
| authors = [ | ||
| {name = "Hilary Oliver", email = "hilary.j.oliver@gmail.com"}, |
There was a problem hiding this comment.
change: email scraped from .mailmap file.
@hjoliver, preferences?
There was a problem hiding this comment.
The @gmail.com address appears to be @hjoliver 's primary email contact in .mailmap. Two related notes: email is optional, so it can be removed; and multiple authors and maintainers can be specified. (The decade old setup.py format only allowed one author and one maintainer).
mwtoews
left a comment
There was a problem hiding this comment.
An outstanding issue with Dockerfile is now resolved, I'd expect this to pass all CI tests. A few remaining comments follow.
| name = cylc-flow | ||
| version = attr: cylc.flow.__version__ | ||
| author = Hilary Oliver | ||
| url=https://cylc.org/ |
There was a problem hiding this comment.
This does not have an equivalent for PEP 621, but is better done with pyproject.toml:
[project.urls]
Home = "https://cylc.org/"| scheduling | ||
| license = GPL | ||
| license_file = COPYING | ||
| platforms = any |
There was a problem hiding this comment.
platforms does not have a PEP 621 equivalent, so not migrated. As far as I can tell, it's a left-over from deprecated distutils here.
There was a problem hiding this comment.
All good, cheers.
@hjoliver, one question about the optional "author" field: #7279 (comment)
Coverage has randomly dropped, hopefully random/unrelated, kicking tests |
|
(coverage recovered on re-run, was just a random error) |
This is a build refactor to take advantage of modern Python package builds and metadata. Other motivation for this is that modern tools like uv could be used, e.g.
uv sync --all-extras(resolved with this PR, but not on master).Refer to Configuring setuptools using pyproject.toml files for some of the changes, and PEP-621 for Storing project metadata in pyproject.toml.
Firstly, this now specifies a build-system PEP-517 based on setuptools, done at the top of pyproject.toml.
Migrate metadata from setup.cfg to pyproject.toml, with a few notes:
GPL-3.0-or-later["COPYING", "CONTRIBUTING.md"]The entry points mostly transition over, with an exception of the extras specifier, which is converted to a comment. There are two reasons for removing the extras argument:
cylc.flow.scripts.report_timings:main [report-timings]- using extras for entry points is not recommended"log_data_store = "cylc.flow.main_loop.log_data_store [main_loop-log_data_store]"raises a format error.If the extras specifier is important for these entry points, then I suggest to check their requirements in the script at runtime. For now, a comment of the extra is retained in pyproject.toml.
Finally, there is no need to keep either setup.py or setup.cfg, so they are cleaned up. There was an old "bdist_rpm" entry in setup.cfg that has been abandoned a while ago (PEP-527).
Check List
CONTRIBUTING.mdand added my name as a Code Contributor.setup.cfg(andconda-environment.ymlif present).?.?.xbranch.