-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
Remove setup.py #458
Remove setup.py #458
Conversation
Editable installs for projects with a setup.cfg no longer require a setup.py shim. This requires pip >= 21.1 (2021-04-24).
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install setuptools and wheel | ||
run: python -m pip install --upgrade --user setuptools wheel | ||
- name: Install build | ||
run: python -m pip install --user build | ||
- name: Build sdist and wheel | ||
run: python setup.py sdist bdist_wheel | ||
run: python -m build |
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.
All of these lines can be replaced with:
- name: Build sdist and wheel
run: pipx run build
GHA supports pipx without setup-python, and build supports pipx too.
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.
Interesting, thanks! I'd like to keep the scope of this PR restricted to removing setup.py, but feel free to open an issue.
- name: Build sdist and wheel | ||
run: python setup.py sdist bdist_wheel | ||
run: python -m build | ||
- name: Publish distribution PyPI | ||
uses: pypa/gh-action-pypi-publish@master |
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'd recommend pinning this and then using dependabot to update it every so often (it doesn't change that often).
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.
Using Dependabot is a great idea, I think there are more places where we could benefit from it. As with your other suggestion, I'd prefer to handle this in a separate PR.
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.
Happy to make those in a followup if (since) you like the ideas.
Hello @cjolowicz! Seems like you are trying to remove the If you are going to remove |
This is already a pyproject.toml based build, so it's safe to remove the setup.py - Pip is not "removing" support for anything except for a mistake that was introduced in a patch release of 21.1. That discussion was that only setup.cfg, with no pyproject.toml, should not be supported, because that's not technically valid for all valid PEP 517 backends, as a valid backend could call setup.py if pyproject.toml is missing (though most do not, most use the valid alternate method, which is directly calling a setuptools hook). This was not supported before the mistake in a patch release. The downsides to removing setup.py is that older versions of pip (<21.1 IIRC) can't do an editable mode install, and you need a version of pip, 10+ or so, to install from SDist. Wheels are unaffected, so for a pure Python project, most users will not be affected at all. I do expect you will get questions or complaints from package managers who have workflows that call setup.py commands. But really, if they want to keep doing things the same (poor) way, they can just |
Of course. I just wanted to say that you must not remove |
Oh, thanks. I also wanted to ask that. |
@henryiii @DiddiLeija Thanks for your input! @theacodes I'll merge this on the weekend if you don't shout "stop" :) |
This PR removes the setup.py shim left after migrating to setup.cfg. It also updates the
deploy
job in CI to usepython -m build
to build the sdist and wheel for PyPI.Note that with pip >= 21.1 (2021-04-24), editable installs for projects with a setup.cfg no longer require a setup.py shim.
Follow-up to #457