-
-
Notifications
You must be signed in to change notification settings - Fork 426
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
fix: remove Python 2 legacy packaging code #1148
Conversation
Thanks, I'll have a look. I like using a
What do you mean? |
Also, very nice! I had no idea CPython has been getting so much faster with each minor version! |
I didn't see any of the trappings for mypy (no config, no .pre-commit-config.yaml, no entry in tox.ini or a noxfile), but there are (not complete) static types! I think I can try it. Edit: there are some typing errors; you can't compile with typing errors.
Flit automatically reads
See https://github.com/faster-cpython/ideas/blob/main/FasterCPythonDark.pdf. That project is fully in action these days! The initial goal was 50% every year, but it's more like 25% for the first (full) year in Python 3.11. But that's still very nice! PS: version numbers in that presentation are off by at least 1; the project started a bit later than proposed. |
(I have tooling that helps with setup.py -> setup.cfg, and I know of tooling that helps with setup.cfg -> pyproject.toml PEP 621) |
FYI, setup.cfg Setuptools is supposed to be able to pull a version attribute without running the file (and since you have no deps, even if it fell back to exec'ing the file, it should still work). |
They all seem solvable. Let me know if you want me to have a look.
How? And does that apply to pyproject too? |
I can try this after #1149 if you'd like to see it. Basically it looks something like this: version = attr: lark.__version__ setuptools will try to read it from the AST before falling back on importing |
I'm not familiar with flit. It's supposed to be a poetry replacement, right? So it would automatically know to read the version off of |
Technically, I meant If you produce a pure Python wheel, that doesn't use the backend at all to install, so it's not something that affects users much, mostly a developer choice based on what you find nice and easy to configure. Reminder: I'd like to keep the current backend for now, until I play with mypyc, which is tied to setuptools (and hatchling has an adaptor), but likely won't be easy to tie to other backend. I plan on working on a PEP to address this, probably in the fall, but we are stuck with the status quo at the moment, which is extensions are tied to a backend. So if you see a backend you really want, please wait a bit. :) Flit has the built-in feature that it pulls Almost every existing backend comes with a command-line tool as well. Flit (and Poetry) existed before there was standard tooling for it; I think that's primarily why there is a Most of the CLI tools are trying to be "all-in-one", the question is how much is all on one? Flit does the least and is really easy to just use standard tooling instead. Poetry and PDM do environment management (and PDM follows standards, so I like it better - and you can use any build backend with PDM, not just it's own, which is awesome and I'd like to see that happen with other systems). The far end of the spectrum would be Hatch, which tries to also do multi-environment management (ala Tox/Nox) too2. Footnotes |
Thanks for the overview! So far, just using |
A small update to packaging code; universal=True/1 is only used to replace the
py3
tag withpy2.py3
, which is incorrect since 1.0. Also addingpython_requires
- this should always be set as soon as a python version is dropped, as pip will back-solve to find the final release that has a passingpython_requires
for the current Python version.If you are interested, I'd recommend moving to static configuration (everything in setup.cfg or pyproject.toml). I'd recommend reading https://scikit-hep.org/developer/packaging or https://packaging.python.org/en/latest/tutorials/packaging-projects/ for the classic way to do this, or https://scikit-hep.org/developer/pep621 for the new way. (We are working on transitioning packaging.python.org to the PEP 621 method as well in the near future).
My initial goal was to see if mypyc would provide the same speedup for CPython that PyPy provided, but there are some missing static types1. :'( I did compare a few versions of Python 3 to see if the faster CPython project really is working. I've got a fast computer and I wasn't able to generate a matching json file (2.9 MB for me), but here are the relative timings for the slowest parser if you were curious:
Footnotes
there might actually be enough to try it! ↩