-
Notifications
You must be signed in to change notification settings - Fork 27
Switch from setup.py to pyproject.toml #230
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
Signed-off-by: Mikhail Koviazin <[email protected]>
@trim21 would you be able to review this one? Thanks! |
Signed-off-by: Mikhail Koviazin <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #230 +/- ##
==========================================
- Coverage 76.27% 76.26% -0.01%
==========================================
Files 130 129 -1
Lines 33913 33911 -2
==========================================
- Hits 25867 25863 -4
- Misses 8046 8048 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@@ -0,0 +1,96 @@ | |||
[build-system] | |||
requires = ["setuptools>=61.0", "wheel"] |
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.
wheel is not necessary anymore
] | ||
|
||
[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.
This is also not necessary
Thanks everyone for the reviews! I'll double-check tonight whether the changes in the comments are really needed and will either fix or merge this |
[project.optional-dependencies] | ||
libvalkey = ["libvalkey>=4.0.1"] | ||
ocsp = ["cryptography>=36.0.1", "pyopenssl==23.2.1", "requests>=2.31.0"] | ||
dev = [ |
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.
just an fyi
i think? people can now do pip install valkey[dev]
and get from pypi
same thing goes for doc
some package managers (uv, poetry) have a way to prevent this
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.
Yeah that's a great point.
If there's a way to do that with pyproject
itself, I'm all for it.
Alternatively, we can also do what redis-py has done, that is switching to pyproject
but keeping dev_requirements.txt
and docs/requirements.txt
. Honestly this sounds like the best approach.
@bogdanp05 WDYT?
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.
https://github.com/django-commons/django-valkey/blob/main/pyproject.toml#L60
this clause is documented in pyproject docs
but if i understand correctly it needs a lock file to work, so a package manager is needed
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.
there is a chance my data is outdated and it can be used as is
https://packaging.python.org/en/latest/specifications/dependency-groups/
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.
use dependency-groups and replace pip with uv in our ci would help. replace pip install .[dev]
with uv sync --group dev
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 just found out you can use pip to install dependency groups
tho it's a new feature (like 5 month old)
pip install --group test
good thing about pyproject is that it's a standard format, so you can replace pip with uv or poetry or vis versa and it just works
also you might consider a build tool that's not setuptools ;) it lacks some features, I've had cases where it couldn't even publish to pypi cause it lacked the new standard |
Thanks a lot! I'll look into it. Do you have any suggestions for the alternative? |
flit-core |
Note to myself: redis-py uses |
i use it does the job without noise but I'm not an expert in this matter and don't have a strong suggestion |
Highly inspired by #96 by @ds-cbo (Thanks!)
Pull Request check-list
Description of change
Switch from setup.py to pyproject.toml