Skip to content
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

PEP 621: Migrate from setup.py to pyproject.toml #2435

Merged
merged 2 commits into from
Jan 4, 2025

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Nov 12, 2024

Closes #2409
Closes #2431

Running on Python 3.13 is currently blocked by numba.

Why

https://setuptools.pypa.io/en/latest/userguide/quickstart.html#setuppy-discouraged

https://setuptools.pypa.io/en/latest/userguide/quickstart.html

We recommend users expose as much as possible configuration in a more declarative way via the pyproject.toml or setup.cfg, and keep the setup.py minimal with only the dynamic parts (or even omit it completely if applicable).

From validate-pyproject README:

With the approval of PEP 517 and PEP 518, the Python community shifted towards a strong focus on standardization for packaging software, which allows more freedom when choosing tools during development and make sure packages created using different technologies can interoperate without the need for custom installation procedures.

This shift became even more clear when PEP 621 was also approved, as a standardized way of specifying project metadata and dependencies.

validate-pyproject was born in this context, with the mission of validating pyproject.toml files and ensuring they comply with the standards and PEPs.

https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#writing-pyproject-toml

git checkout -b setup.py-to-pyproject.toml
pipx run setuptools-py2cfg setup.py > setup.cfg
pipx run 'ini2toml[full]' setup.cfg -o pyproject.toml
git add pyproject.toml
git rm setup.py
rm setup.cfg
pipx run pyproject-fmt pyproject.toml
pipx run 'validate-pyproject[all]' pyproject.toml
git commit -am"PEP 621: Migrate from setup.py to pyproject.toml"
git push

After this PR is merged, requirements.txt could be deleted.

@cav71
Copy link

cav71 commented Dec 28, 2024

I think there's still the numba issue (it is limited to <3.13):

pip install numba
       File "<string>", line 51, in <module>
        File "<string>", line 48, in _guard_py_ver
      RuntimeError: Cannot install on Python version 3.13.0; only versions >=3.9,<3.13 are supported.
      [end of output]

@cclauss cclauss force-pushed the setup.py-to-pyproject.toml branch from f90c89a to e380921 Compare January 4, 2025 08:58
@jongwook jongwook merged commit dd4d010 into openai:main Jan 4, 2025
9 checks passed
@cclauss cclauss deleted the setup.py-to-pyproject.toml branch January 4, 2025 09:39
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.

3 participants