-
Notifications
You must be signed in to change notification settings - Fork 27
update setup.py to pyproject.toml #96
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
base: main
Are you sure you want to change the base?
Conversation
b6e63b5
to
2ca4180
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #96 +/- ##
==========================================
+ Coverage 75.12% 75.16% +0.04%
==========================================
Files 132 132
Lines 34398 34480 +82
==========================================
+ Hits 25840 25918 +78
- Misses 8558 8562 +4 ☔ View full report in Codecov by Sentry. |
Thanks for your contribution. One question though: why do you think |
Interesting, those articles contradict what I see other big projects doing, even if they keep using setuptools as build system:
Internally we also moved to pyproject by removing setup.py because we believed that was the new way to go, I didn't even know that you could keep both files in tandem. Would you like me to bring back a barebones |
Did you encounter any specific issues with setup.py or is this intended more as a cosmetic change? |
BTW yes, please don't remove setup.py completely. As a side note, the sign-off thingy should contain a real name and a real email address |
@aiven-sal I encountered issues with our build system which requires pyproject.toml be available in libraries we use. Of course we could also put some patches in our repo only, but I imagined it might be useful to more people to contribute upstream too. I've added the setup.py in the last commit. What do you mean with "real name" and "real email address"? These are the two linked to this GitHub account, I imagined those would be more useful than some generic untraceable values. |
Maybe this can clarify what I mean: https://github.com/cncf/foundation/blob/main/dco-guidelines.md#dco-and-real-names |
To put it in a different way. Imagine we just met at a conference, what name would you use to introduce yourself? That should be the name you use in signoff |
Signed-off-by: ds-cbo <82801887+ds-cbo@users.noreply.github.com> Signed-off-by: C. Bo <cbo@dreamsolution.nl>
Signed-off-by: ds-cbo <82801887+ds-cbo@users.noreply.github.com> Signed-off-by: C. Bo <cbo@dreamsolution.nl>
Signed-off-by: ds-cbo <82801887+ds-cbo@users.noreply.github.com> Signed-off-by: C. Bo <cbo@dreamsolution.nl>
Signed-off-by: ds-cbo <82801887+ds-cbo@users.noreply.github.com> Signed-off-by: C. Bo <cbo@dreamsolution.nl>
204a41e
to
c2f282a
Compare
I guess that would be it then? |
The CI has failed. Could you please fix it accordingly? It seems that:
|
Signed-off-by: ds-cbo <82801887+ds-cbo@users.noreply.github.com>
@mkmkme I've just updated the dictionary, but as far as I know I already replaced all instances of Do you also expect me to pass the (seemingly unrelated and/or outdated?) pip-audit checks? |
@ds-cbo There's still a bunch of leftovers that you can find by https://github.com/search?q=repo%3Avalkey-io%2Fvalkey-py%20setup.py&type=code IMO all of them should be fixed. Thanks! :) |
We certainly can't merge the PR with CI failing. If you don't want to handle this, I can do it myself. |
I am also quite concerned that the direct calls to |
Signed-off-by: ds-cbo <82801887+ds-cbo@users.noreply.github.com>
As far as I know, I've already modified those in earlier commits. See for example https://github.com/ds-cbo/valkey-py/blob/pyproject.toml/.github/workflows/install_and_test.sh#L23
Understandable. I wouldn't mind fixing it, but I don't really know your preferred course of action here. It's failing on Babel 2.8.0 even though 2.16.0 is already available and nothing seems to prevent it from being installed. Maybe I'm guessing this change happened because now we're running pip-audit including the
I still think you're looking at older CI reports, the reason the newest packaging runs were failing was because |
[tool.setuptools.packages.find] | ||
include = [ | ||
"valkey", | ||
"valkey._parsers", | ||
"valkey.asyncio", | ||
"valkey.commands", | ||
"valkey.commands.bf", | ||
"valkey.commands.json", | ||
"valkey.commands.search", | ||
"valkey.commands.timeseries", | ||
"valkey.commands.graph", | ||
"valkey.parsers", | ||
] | ||
|
||
[tool.setuptools.package-data] | ||
valkey = ["py.typed"] |
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 think we do not need this anymore after we migrate from setup.py to pyproject.toml
@@ -1,62 +1,3 @@ | |||
#!/usr/bin/env python | |||
from setuptools import find_packages, setup | |||
from setuptools import setup |
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.
we also do not need this file if it just call setup()
without any arguments
[tool.setuptools.package-data] | ||
valkey = ["py.typed"] |
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.
[tool.setuptools.package-data] | |
valkey = ["py.typed"] |
I would suggest we use flit-core and stop using setuptools since it's a pure python package, then we can get ride of the long |
i moved django-valkey to a imo pyproject should be used for everything, having all configs in one place, and with a readable and maintainable format is a good thing i do suggest uv + hatch, and if you want i can come with a patch but regardless of that, pyproject is a good move |
tho admittedly valkey-py has a sane packaging setup, and it's not a necessity to move, unlike some packages like celery and aiocache but it'll still be a good addition and i think everyone will be happier with it, but i do as you wish |
hatchling still has it's own dependencies so I would suggest flit-core. but any one is better than setuptools |
since we aren't adding hatch as a dependency there is no need to install anything i don't know much about build backends, setuptools broke my package so i moved to hatch, and it works |
not really, there are 2 things here, the hatchling and the hatch. I guess no one suggest use hatch so I'll skip it. The build-system hatchling defined in You can take it as , the pip/uv will create a new venv, install all package defined in |
i don't think we ever have to use and even if hatchling is used in other places, it doesn't seem to have a heavy dependency list, also it's cached in github's servers anyway, as i said, i don't insist, i suggested it because it's what i've used |
I think we will have
yeah, in nowadays the users of valkey-py should always use wheel, especially valkey-py is a pure python package, they don't need care about build-system. I'm worrying about that some dependency may have breaking change in the future (so the old sdist would be broken then), but maybe I'm worrying for somethine that not worth worried about. |
yup you seem to be correct i don't think dependencies are a big deal i'll wait to see if maintainers are even intrested :), that's what matters |
Hey, Overall the proper way to update setup.py to pyproject.toml has been in my todo for a while. I would really-really like to do that whilst ensuring that we won't break anything for anyone even with the oldest Python supported or with the most exotic way this package could be installed. So my original thought was to not move away from setuptools but make pyproject.toml use it while also keeping dummy setup.py that could be used (in case someone still installs it via Thanks for your suggestion, though! I'll definitely look it up and will make a mental pinpoint on this |
Pull Request check-list
Description of change
I upgraded the deprecated
setup.py
to the modernpyproject.toml
format, enabling modern installer tools.