Skip to content

Conversation

@bmerry
Copy link
Collaborator

@bmerry bmerry commented Aug 16, 2021

  • 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.
  • Replace distutils.version with packaging.version (the former will be deprecated by PEP 632).
  • Update my email address

bmerry added 2 commits August 16, 2021 12:05
- 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.
@coveralls
Copy link

coveralls commented Aug 16, 2021

Coverage Status

Coverage increased (+0.08%) to 93.506% when pulling 1d63e3f on modernisation into 03e1eb6 on master.

Copy link
Collaborator

@ludwigschwardt ludwigschwardt left a 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
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

@bmerry
Copy link
Collaborator Author

bmerry commented Aug 16, 2021

I don't see a pyproject.toml...

Thanks, I forgot to git add it. Should be there now.

@@ -0,0 +1,2 @@
[build-system]
requires = ["setuptools", "wheel", "setuptools-scm"]
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

@bmerry bmerry requested a review from ludwigschwardt August 16, 2021 15:30
@bmerry bmerry merged commit 85febb4 into master Aug 16, 2021
@bmerry bmerry deleted the modernisation branch August 16, 2021 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants