Refactor: Move packaging configuration from setup.py to setup.cfg#57
Open
podhmo wants to merge 3 commits into
Open
Refactor: Move packaging configuration from setup.py to setup.cfg#57podhmo wants to merge 3 commits into
podhmo wants to merge 3 commits into
Conversation
I've migrated static metadata from `setup.py` to `setup.cfg` to align with modern Python packaging practices. Key changes: - All static package metadata (name, version, author, dependencies, entry points, etc.) is now defined in `setup.cfg`. - `setup.py` has been simplified to `from setuptools import setup; setup()`. - The `version` is dynamically read from the `VERSION` file. - `long_description` is dynamically read from `README.md` and `CHANGES.txt`. - I confirmed that package building and installation are working correctly with these changes.
Removed `setup.py` and adopted a PEP 517 compliant build process using `pyproject.toml` and `setup.cfg`. Key changes: - Added `pyproject.toml` specifying `setuptools.build_meta` as the build backend and listing build requirements. - `pyproject.toml` declares most metadata fields (version, readme, license, authors, dependencies, etc.) as `dynamic`, deferring to `setup.cfg` for their actual values. This allows `setuptools` to continue sourcing information like `version = file: VERSION` and `long_description = file: README.md, CHANGES.txt` from `setup.cfg`. - `setup.py` has been deleted. - The package successfully builds using `python -m build`, and the generated wheel contains the correct metadata (verified by inspecting the METADATA file), including the version read from the `VERSION` file.
I've migrated all packaging configuration from `setup.cfg` and the `VERSION`
file to `pyproject.toml`, adhering to PEP 621 and modern Python
packaging standards. `setup.cfg` and `VERSION` have been removed.
Key changes:
- `pyproject.toml` now defines all package metadata statically, including:
- `name`, `version` (hardcoded to 0.6.2), `description`, `authors`,
`license` (MIT, pointing to LICENSE file), `keywords`, `classifiers`.
- `dependencies` and `optional-dependencies`.
- `scripts` (for console entry points like `jqfpy`).
- `urls`.
- Dynamic metadata sourcing via `[tool.setuptools.dynamic]` for:
- `readme`: Long description is generated from `README.md` and
`CHANGES.txt`, with `text/markdown` content type.
- Package discovery is configured via `[tool.setuptools.packages.find]`.
- Other build options like `include-package-data` and `zip-safe` are
set in `[tool.setuptools]`.
- The `VERSION` file has been removed.
- `setup.cfg` has been removed.
The project builds successfully using `python -m build` with only
`pyproject.toml`. Inspection of the generated wheel's METADATA confirms
the accuracy of all configured metadata.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've migrated static metadata from
setup.pytosetup.cfgto align with modern Python packaging practices.Key changes:
setup.cfg.setup.pyhas been simplified tofrom setuptools import setup; setup().versionis dynamically read from theVERSIONfile.long_descriptionis dynamically read fromREADME.mdandCHANGES.txt.