dspy
dspy copied to clipboard
Consider migrating from setup.py to pyproject.toml
Since the introduction of PEP 621, using pyproject.toml
is the standard way for declaring project metadata. There seems to be little, if any, reason to keep using setup.py
method.
More pragmatically, adopting popular package manager like poetry would help third-party integration in my opinion.
Thanks a lot. I get this multiple times, but I don't quite understand the value proposition here. Is there something I should read on this other then the PEP document
@okhat
I get this multiple times, but I don't quite understand the value proposition here.
Considering setup.py
is classified as legacy in official pip document, so adopting a recommended standard would be beneficial for a relatively new project.
This also would help interacting with third party libraries as well. You incorporate configurations for various development tools into pyproject.toml
(black, isort, ruff, mypy, etc.)
For example:
[tool.ruff]
select = [
"E", # pycodestyle
"F", # pyflakes
"I", # isort
"B", # black
]
[too.ruff.isort]
known-third-party = ["orjson"]
Additionally, it's useful for specifying versions for dependencies, especially when combined with package manager like poetry
. For example:
[tool.poetry.dependencies]
gunicorn = { version = "^20.1", extras = ["gevent"] }
Is there something I should read on this other then the PEP document
Thank you! I'm convinced now. @lawliet19189 this could be something to add with the black refactoring things
@amicus-veritatis
Hi! Please let me know if you see any issues in the implementation!
@darinkishore lgtm! ~~I'll close this issue as completed.~~
I'll close this issue as soon as the PR in #254 is merged.