Move project metadata and configuration to 'pyproject.toml'#1311
Move project metadata and configuration to 'pyproject.toml'#1311EpicWink wants to merge 1 commit intoscrapinghub:masterfrom
Conversation
| @@ -16,47 +12,5 @@ | |||
| ) | |||
There was a problem hiding this comment.
I think we need to figure out how to get rid of setup.py entirely. Maybe we could use the README.rst instead for the long description.
There was a problem hiding this comment.
That's generally the goal, especially the most PyPI project pages don't include the changelog. The README is the traditional long description, but perhaps you could first consolidate docs/introduction.rst and the README into one file (and have the docs build pull in the README).
Again, it's not too important to remove setup.py for sdist metadata generation, as it will be indefinitely supported and is perfectly fine for non-programmatic metadata such as long-description
There was a problem hiding this comment.
perhaps you could first consolidate
docs/introduction.rstand the README into one file (and have the docs build pull in the README).
This sounds good to me.
| [tool.setuptools.dynamic] | ||
| version = { attr = "dateparser.__version__" } |
There was a problem hiding this comment.
We use bumpversion. So it probably makes sense to hard-code the version instead of making it dynamic, bumpversion will take care of updating it in both places. In fact, I think it can update it in pyproject.toml without specific configuration for it, and it may be possible to remove the current_version definition under [tool.bumpversion] once the project version is defined through standard pyproject.toml syntax.
There was a problem hiding this comment.
I have no familiarity with bumpversion, and its docs (and its fork's docs) don't mention pyproject.toml. This pull request currently keeps the current release process unchanged, but I'm open to suggestions.
There was a problem hiding this comment.
https://callowayproject.github.io/bump-my-version/reference/configuration/global/#current_version
‡ If pyproject.toml exists, then current_version falls back to project.version in pyproject.toml. This only works if project.version is statically set.
There was a problem hiding this comment.
Right, so you use Bump My Version, not bumpversion. Either way, do you want to store the current version in project.version in pyproject.toml, or in dateparser.__version__? The second way isn't actually dynamic, it's simply not statically defined in pyproject.toml.
There was a problem hiding this comment.
I believe we should do both.
We keep it in dateparser.__version__ for backward-compatibility, for projects that check that at run-time.
But for packaging, instead of having pyproject.toml fetch that constant, we define the version in pyproject.toml itself as project.version, and not in the bumpversion/bump-my-version variable, and uvx bump-my-version bump major|minor|patch will update both values when run.
Makes most metadata and build configuration declarative
Also:
License :: OSI Approved :: BSD Licenseclassifier (license classifiers are deprecated)setuptoolsexplicitly as a build requirement using PEP 518 (and as the backend using PEP 517)I kept your custom
long_description(pyproject.toml:readme) construction: there's no harm in it. Setuptools also has native functionality to read the version from a Python module attribute.