-
Notifications
You must be signed in to change notification settings - Fork 179
Packaging modernisation #305
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
Conversation
- Add a pyproject.toml file (with setuptools_scm, so that pypa-build will include everything from SCM in the build; and remove MANIFEST.in) - Move all the metadata from setup.py to setup.cfg (setup.py is left just to support editable builds). - Use `attr:` in setup.cfg to get the version programmatically instead of repeating it. - Update my email address
distutils is going to be deprecated (PEP 632), and packaging is the recommended replacement. This does end up requiring that the redis server version is a valid PEP 440 string, but that's only relevant during the unit tests so if redis does go to a weird versioning scheme it won't affect users directly.
ludwigschwardt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a pyproject.toml...
| import distutils.version | ||
|
|
||
| import aioredis | ||
| import packaging.version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would probably use the same scheme as all the other files (from packaging.version import Version), but that's a very minor suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to avoid exposing a fakeredis.aioredis.Version. I know I could import it as _Version or something but that still wouldn't be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good. 👍🏾 I guessed so, but then thought that aioredis was an internal module of sorts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a public module. fakeredis._aioredis1 and fakeredis._aioredis2 are internal.
Thanks, I forgot to |
| @@ -0,0 +1,2 @@ | |||
| [build-system] | |||
| requires = ["setuptools", "wheel", "setuptools-scm"] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have to activate setuptools_scm beyond this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem to need anything else: when I run python -m build . all the files end up in the sdist. I vaguely recall that the version handling needs activation, but I'm not using it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.
will include everything from SCM in the build; and remove MANIFEST.in)
just to support editable builds).
attr:in setup.cfg to get the version programmatically insteadof repeating it.