Generated setup.py should use setuptools.setup instead of distutils.core.setup
See original GitHub issue-
I am on the latest Poetry version.
-
I have searched the issues of this repo and believe that this is not a duplicate.
-
If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption). -
OS version and name: Gentoo Linux
-
Poetry version: 0.12.11
The command poetry build generates a setup.py file based on the contents of pyproject.toml. The setup file imports distutils.core.setup as the setup function, but passes build arguments that are only available in setuptools.setup, such as entry_points. When the package is installed via pip, this is not an issue, because pip still uses setuptools.setup, regardless of what is imported (see the distutils docs). However, other package managers may run into issues, because they use distutils. My distribution’s package manager (Portage) generates warnings:
usr/lib64/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
/usr/lib64/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'entry_points'
warnings.warn(msg)
/usr/lib64/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'python_requires'
warnings.warn(msg)
In this case, no scripts will be installed, because the entry_points argument is not applicable for distutils.
Since setup.py uses features that are explicitly part of setuptools, but not distutils, I suggest that setuptools.setup should be imported. Would you accept a PR for this?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:17
- Comments:8 (1 by maintainers)

Top Related StackOverflow Question
My solution was to create distro packages of “dephell” for the Arch Linux distribution and use https://dephell.readthedocs.io/cmd-deps-convert.html to convert pyproject.toml into a usable setup.py file. I just download the source tarball from GitHub instead of PyPI, and as a result I also get testsuite files.
I’m going to be including a fix for this in my work to fix #1350 since there is currently an outstanding PR ( https://github.com/pypa/setuptools/pull/1767 ) to bring
setuptoolsin line withwheeland current documented practices regarding package license metadata,pipusessetuptoolsand I sincerely doubt there will be much traction trying to updatedistutils. So usingsetuptoolsdirectly just make sense.