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

setup.py is replaced by pyproject.toml #158

Closed

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Sep 29, 2024

https://packaging.python.org/en/latest/discussions/setup-py-deprecated

In README.rst, setup is a noun while set up is a verb.

In the removed setup.py...

Direct use of __import__() is also discouraged in favor of importlib.import_module().

@@ -1 +0,0 @@
__import__("setuptools").setup()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not delete this file

Copy link
Contributor Author

@cclauss cclauss Sep 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not? Given the title of the PR?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The move to pyproject.toml was done in #154, this is the correct setup

@cclauss cclauss force-pushed the setup.py_is_replaced_by_pyproject.toml branch from e4802a7 to 72dd6e1 Compare September 29, 2024 14:30
@cclauss
Copy link
Contributor Author

cclauss commented Sep 29, 2024

Please allow me to rephrase...

In what scenarios would the presence of this file be useful? If it was deleted, what would break?

@timkpaine
Copy link
Collaborator

There are situations and versions of setuptools which require setup.py to be present as a shim for the pyproject.toml, editable installations was one example that can require it. Support for editable installs (as an example) has been added in relatively new versions, but it's a very small burden to support older versions, especially since newer setuptools have their own issues (stricter version specifier parsing, distutils changes, msvc changes are three I've hit this year). So tl;dr to maximize our setuptools compatibility and avoid requiring a relatively new setuptools, the setup.py shim should stay.

@cclauss
Copy link
Contributor Author

cclauss commented Sep 29, 2024

setuptools v61.0.0 (released in March 2022) added support for pyproject.toml and removed the need for setup.py. This means that any installation that needs setup.py is going to be unable to read the project dependencies and other settings that are now stored in pyproject.toml.

@cclauss cclauss closed this Sep 29, 2024
@cclauss cclauss deleted the setup.py_is_replaced_by_pyproject.toml branch September 29, 2024 16:15
@cclauss
Copy link
Contributor Author

cclauss commented Sep 29, 2024

Setuptools v64.0.0 (July 2022) was the first that allowed editable installs without a setup.py file.

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.

2 participants