-
Notifications
You must be signed in to change notification settings - Fork 158
Packaging modernization & cleanup #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
Closed
|
2ba1611
to
34353ed
Compare
- 2.7 was EOL'd in 2020 - 3.6 was EOL'd in 2021 - 3.7 will be EOL'd in June 2023 Even if a 1.0 is cut before June it doesn't seem likely that it'll matter a lot. 3.8 doesn't bring a lot that's likely to be useful as far as I know, candidates I can think of are: - positional-only parameters - typed dicts and literals, to add typing to the legacy API While at it, remove the now unnecessary future imports, as well as the module-level docstrings (they're not very helpful) and the per-file license headers (they don't seem useful).
PEP 517 ======= Don't migrate away from setuptools, but move "static" packaging content from `setup.py` to `pyproject.toml` and `setup.cfg`. Building should now be performed using [`build`](https://pypa-build.readthedocs.io/en/stable/), as direct invocations of `setup.py` have been deprecated for a while. Also remove the legacy `__author__` strictures from the source files, as `pyproject.toml` supports an authors section which is more suitable. Codegen Modernization ===================== The modernization via command overrides and self-invocation still generated `setup.py` warnings. Migrate the "invoke commands in commands" method to codegen sub-commands in `build`, it looks like this suffices for what we need. This reuses the existing code, though modernizes it significantly thanks to the previous commit. This is strongly inspired by @abravalheri's comments on codegen in setuptools discussions e.g. pypa/setuptools#3180 and pypa/setuptools#3762, those comments were very helpful in getting a better understanding of the sub_commands system (also @jaraco's comments but those were a touch terse so can't say I really got it until sumbling on @abravalheri's). Leverages the setuptools subcommands protocol to support editable wheels, as that might be useful. Don't use editable wheels for testing though, as I don't see the point. Note: not sure the git submodule stuff is useful during the codegen, so currently commented it out. sdists ====== I'm not entirely clear what sdists should really be about, adding codegen to sdist using subcommands seems not necessarily trivial, so for now make them basically an export: - remove `_regexes.py` from sdist - add uap-core to the manifest, and thus the sdist, at least `regexes.yaml` Currently the test files (both python and yaml) are also included, but it's not clear that they *should* be. That seems like [a whole debate](https://discuss.python.org/t/should-sdists-include-docs-and-tests/14578/117), One strong argument (to me) in favor of a sdist maximalism is that it matches the wheels and more official releases, but in that case the sdist should probably be better crafted than what I threw together. Tox === Switch tox to an explicit `pip install` as its builtin handling for installing packages (whether via sdist or develop) does not seem compatible with PEP-517. Need to think about moving to tox 4, which apparently has native support for PEP 517 packages. Cf ua-parser#157. Also remove the `docs` tox env, it hasn't been a thing since 8273477 but I forgot to remove it from the envlist.
- remove old compile step - update python-action to v4 and "primary" python to 3.11 - produce sdist and wheel just once - ensure we're testing after installing from wheel, sdist, and source
This was referenced Apr 30, 2023
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.
__future__
importssetup.py
(and recommendations thereof), as that has been deprecated for a while