Skip to content

Generated setup.py should use setuptools.setup instead of distutils.core.setup #866

@seifertm

Description

@seifertm
  • 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 (-vvv option).

  • 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/build-systemRelated to PEP 517 packaging (see poetry-core)kind/featureFeature requests/implementations

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions