dspy icon indicating copy to clipboard operation
dspy copied to clipboard

Consider migrating from setup.py to pyproject.toml

Open amicus-veritatis opened this issue 1 year ago • 6 comments

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.

amicus-veritatis avatar Oct 10 '23 07:10 amicus-veritatis

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 avatar Oct 10 '23 14:10 okhat

@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

amicus-veritatis avatar Oct 11 '23 01:10 amicus-veritatis

Thank you! I'm convinced now. @lawliet19189 this could be something to add with the black refactoring things

okhat avatar Oct 13 '23 19:10 okhat

@amicus-veritatis

Hi! Please let me know if you see any issues in the implementation!

darinkishore avatar Dec 23 '23 00:12 darinkishore

@darinkishore lgtm! ~~I'll close this issue as completed.~~

amicus-veritatis avatar Dec 26 '23 00:12 amicus-veritatis

I'll close this issue as soon as the PR in #254 is merged.

amicus-veritatis avatar Dec 26 '23 00:12 amicus-veritatis