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

Replace 'setup.py sdist' with '-m build --sdist' #5785

Merged

Conversation

hugovk
Copy link
Member

@hugovk hugovk commented Oct 22, 2021

Direct invocation of setup.py has been deprecated by setuptools, and there's a multi-year effort ongoing to replace its commands with other tools.

The long version:

Direct calling isn't going away any time soon, but we should start to replace those that we can. Here's one of the simpler replacements.

I compared the generated Pillow-9.0.0.dev0.tar.gz with the old and new commands, and the contents were identical (except for this change to the Makefile).


We currently use these:

setup.py --long-description | markdown2 > .long-description.html && open .long-description.html
setup.py build --build-base=/tmp/build install
setup.py build_ext --enable-[feature] install
setup.py build_ext --inplace
setup.py build_ext --vendor-raqm --vendor-fribidi %*
setup.py build_ext install
setup.py clean
setup.py develop
setup.py develop build_ext --inplace
setup.py install
setup.py sdist --format=gztar

@hugovk hugovk added the Packaging label Oct 22, 2021
@@ -96,7 +96,8 @@ release-test:

.PHONY: sdist
sdist:
python3 setup.py sdist --format=gztar
python3 -m build --help > /dev/null 2>&1 || python3 -m pip install build
python3 -m build --sdist
Copy link
Member

@radarhere radarhere Oct 25, 2021

Choose a reason for hiding this comment

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

https://docs.python.org/3/distutils/sourcedist.html

The default format is a gzip’ed tar file (.tar.gz) on Unix, and ZIP file on Windows.

So I think by removing the format argument, you're changing the Windows behaviour. I'm guessing that wasn't your intention though, and you just thought it wasn't necessary?

Copy link
Member Author

@hugovk hugovk Oct 25, 2021

Choose a reason for hiding this comment

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

build doesn't have a --format option and defaults to .tar.gz for all platforms:

Because PEP 517 only supports .tar.gz:

Which suits us fine.

@hugovk
Copy link
Member Author

@hugovk hugovk commented Oct 25, 2021

Direct invocation of setup.py has been deprecated by setuptools, and there's a multi-year effort ongoing to replace its commands with other tools.

setuptools v58.3.0 has now officially deprecated setup.py install https://setuptools.pypa.io/en/latest/history.html#v58-3-0

$ make install
python3 setup.py install
running install
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running bdist_egg
running egg_info
writing src/Pillow.egg-info/PKG-INFO
...

@radarhere radarhere merged commit ff1cb39 into python-pillow:main Oct 26, 2021
48 checks passed
@hugovk hugovk deleted the replace-setup.py-dist-with-build branch Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Packaging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants