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

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

Closed
3 tasks done
seifertm opened this issue Feb 5, 2019 · 9 comments
Closed
3 tasks done
Labels
area/build-system Related to PEP 517 packaging (see poetry-core) kind/feature Feature requests/implementations
Milestone

Comments

@seifertm
Copy link

seifertm commented Feb 5, 2019

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

@opoplawski
Copy link

This is becoming a problem in Fedora as well. In particular we are seeing file based egg-info being generated rather than directories, which can cause issues with RPM.

@roniemartinez
Copy link

I just started testing poetry to see what's on it. Checked the generated setup.py and I didn't like it.

from distutils.core import setup

Quoting from https://docs.python.org/3/library/distutils.html

Most Python users will not want to use this module directly, but instead use the cross-version tools maintained by the Python Packaging Authority.

Sadly, I am one of these people. This issue should be a top priority.

@decathorpe
Copy link
Contributor

For all fedora builds of python packages that were published with poetry, I have to patch the generated setup.py file to use setuptools instead of distutils, because otherwise the packages don't get built correctly. The default behaviour should totally be to use setup from setuptools in the template.

@pwwang
Copy link

pwwang commented Jul 1, 2019

Is there a workaround on this with poetry v0.12.16?

@eli-schwartz
Copy link

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.

@pwwang
Copy link

pwwang commented Jul 1, 2019

@eli-schwartz Thanks, this worked out!

But I think the team still has to put this on higher priority.

@eli-schwartz
Copy link

Sure, happy to help. But you're correct that "don't use poetry, use something else" is not remotely optimal. I too am waiting for a better solution in poetry itself.

@sdispater sdispater added kind/feature Feature requests/implementations area/build-system Related to PEP 517 packaging (see poetry-core) labels Aug 2, 2019
@sdispater sdispater added this to the 1.0 milestone Aug 2, 2019
@techdragon
Copy link

I'm going to be including a fix for this in my work to fix #1350 since there is currently an outstanding PR ( pypa/setuptools#1767 ) to bring setuptools in line with wheel and current documented practices regarding package license metadata, pip uses setuptools and I sincerely doubt there will be much traction trying to update distutils. So using setuptools directly just make sense.

techdragon pushed a commit to techdragon/poetry that referenced this issue Sep 9, 2019
- Added support for specifying a set of license files as part of the project config.
- Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured.
- Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files.
- Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured.
- Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`.
techdragon pushed a commit to techdragon/poetry that referenced this issue Sep 10, 2019
- Added support for specifying a set of license files as part of the project config.
- Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured.
- Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files.
- Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured.
- Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
techdragon pushed a commit to techdragon/poetry that referenced this issue Sep 10, 2019
- Added support for specifying a set of license files as part of the project config.
- Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured.
- Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files.
- Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured.
- Added tests for the new features
- Added the “license-files” field to the poetry-schema.json
- Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
techdragon pushed a commit to techdragon/poetry that referenced this issue Sep 10, 2019
- Added support for specifying a set of license files as part of the project config.
- Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured.
- Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files.
- Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured.
- Added tests for the new features
- Documented the new configuration field.
- Added the “license-files” field to the poetry-schema.json
- Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
techdragon pushed a commit to techdragon/poetry that referenced this issue Sep 10, 2019
- Added support for specifying a set of license files as part of the project config.
- Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured.
- Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files.
- Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured.
- Added tests for the new features
- Documented the new configuration field.
- Added the “license-files” field to the poetry-schema.json
- Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
techdragon pushed a commit to techdragon/poetry that referenced this issue Sep 12, 2019
- Added support for specifying a set of license files as part of the project config.
- Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured.
- Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files.
- Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured.
- Added tests for the new features
- Documented the new configuration field.
- Added the “license-files” field to the poetry-schema.json
- Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
techdragon pushed a commit to techdragon/poetry that referenced this issue Sep 12, 2019
- Added support for specifying a set of license files as part of the project config.
- Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured.
- Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files.
- Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured.
- Added tests for the new features
- Documented the new configuration field.
- Added the “license-files” field to the poetry-schema.json
- Updated pre-commit config to use the correct black source repo.
- Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
techdragon pushed a commit to techdragon/poetry that referenced this issue Sep 12, 2019
- Fixes python-poetry#1350
- Added support for specifying a set of license files as part of the project config.
- Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured.
- Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files.
- Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured.
- Added tests for the new features
- Documented the new configuration field.
- Added the “license-files” field to the poetry-schema.json
- Updated pre-commit config to use the correct black source repo.
- Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
techdragon pushed a commit to techdragon/poetry that referenced this issue Sep 12, 2019
- Fixes python-poetry#1350
- Added support for specifying a set of license files as part of the project config.
- Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured.
- Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files.
- Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured.
- Added tests for the new features
- Documented the new configuration field.
- Added the “license-files” field to the poetry-schema.json
- Updated pre-commit config to use the correct black source repo.
- Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
techdragon pushed a commit to techdragon/poetry that referenced this issue Sep 12, 2019
- Fixes python-poetry#1350
- Added support for specifying a set of license files as part of the project config.
- Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured.
- Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files.
- Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured.
- Added tests for the new features
- Documented the new configuration field.
- Added the “license-files” field to the poetry-schema.json
- Updated pre-commit config to use the correct black source repo.
- Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
techdragon pushed a commit to techdragon/poetry that referenced this issue Sep 12, 2019
- Fixes python-poetry#1350
- Added support for specifying a set of license files as part of the project config.
- Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured.
- Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files.
- Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured.
- Added tests for the new features
- Documented the new configuration field.
- Added the “license-files” field to the poetry-schema.json
- Updated pre-commit config to use the correct black source repo.
- Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
techdragon pushed a commit to techdragon/poetry that referenced this issue Sep 16, 2019
- Fixes python-poetry#1350
- Added support for specifying a set of license files as part of the project config.
- Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured.
- Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files.
- Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured.
- Added tests for the new features
- Documented the new configuration field.
- Added the “license-files” field to the poetry-schema.json
- Updated pre-commit config to use the correct black source repo.
- Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
techdragon pushed a commit to techdragon/poetry that referenced this issue Sep 17, 2019
- Fixes python-poetry#1350
- Added support for specifying a set of license files as part of the project config.
- Moved the license file config into the package configuration. (`Poetry.create()`) this matches how similar configurations such as “readme” are configured.
- Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files.
- Moved the existing auto-discovery behaviours to become the default case during `create()` if nothing specific was configured.
- Added tests for the new features
- Documented the new configuration field.
- Added the “license-files” field to the poetry-schema.json
- Updated pre-commit config to use the correct black source repo.
- Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
techdragon pushed a commit to techdragon/poetry that referenced this issue Sep 17, 2019
- Fixes python-poetry#1350
- Added support for specifying a set of license files as part of the project config.
- Moved the license file config into the package configuration. (`Factory.create_poetry()`) this matches how similar configurations such as “readme” are configured.
- Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files.
- Moved the existing auto-discovery behaviours to become the default case during `create_poetry()` if nothing specific was configured.
- Added tests for the new features
- Documented the new configuration field.
- Added the “license-files” field to the poetry-schema.json
- Updated pre-commit config to use the correct black source repo, and set the default language for better consistency with any other pre-commit checks that will be added in the future.
- Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
techdragon pushed a commit to techdragon/poetry that referenced this issue Sep 26, 2019
- Fixes python-poetry#1350
- Added support for specifying a set of license files as part of the project config.
- Moved the license file config into the package configuration. (`Factory.create_poetry()`) this matches how similar configurations such as “readme” are configured.
- Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files.
- Moved the existing auto-discovery behaviours to become the default case during `create_poetry()` if nothing specific was configured.
- Added tests for the new features
- Documented the new configuration field.
- Added the “license-files” field to the poetry-schema.json
- Updated pre-commit config to use the correct black source repo, and set the default language for better consistency with any other pre-commit checks that will be added in the future.
- Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
techdragon pushed a commit to techdragon/poetry that referenced this issue Jan 7, 2020
- Fixes python-poetry#1350
- Added support for specifying a set of license files as part of the project config.
- Moved the license file config into the package configuration. (`Factory.create_poetry()`) this matches how similar configurations such as “readme” are configured.
- Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files.
- Moved the existing auto-discovery behaviours to become the default case during `create_poetry()` if nothing specific was configured.
- Added tests for the new features
- Documented the new configuration field.
- Added the “license-files” field to the poetry-schema.json
- Updated pre-commit config to use the correct black source repo, and set the default language for better consistency with any other pre-commit checks that will be added in the future.
- Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
techdragon pushed a commit to techdragon/poetry that referenced this issue Jan 7, 2020
- Fixes python-poetry#1350
- Added support for specifying a set of license files as part of the project config.
- Moved the license file config into the package configuration. (`Factory.create_poetry()`) this matches how similar configurations such as “readme” are configured.
- Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files.
- Moved the existing auto-discovery behaviours to become the default case during `create_poetry()` if nothing specific was configured.
- Added tests for the new features
- Documented the new configuration field.
- Added the “license-files” field to the poetry-schema.json
- Updated pre-commit config to use the correct black source repo, and set the default language for better consistency with any other pre-commit checks that will be added in the future.
- Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
techdragon pushed a commit to techdragon/poetry that referenced this issue Jan 7, 2020
- Fixes python-poetry#1350
- Added support for specifying a set of license files as part of the project config.
- Moved the license file config into the package configuration. (`Factory.create_poetry()`) this matches how similar configurations such as “readme” are configured.
- Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files.
- Moved the existing auto-discovery behaviours to become the default case during `create_poetry()` if nothing specific was configured.
- Added tests for the new features
- Documented the new configuration field.
- Added the “license-files” field to the poetry-schema.json
- Updated pre-commit config to use the correct black source repo, and set the default language for better consistency with any other pre-commit checks that will be added in the future.
- Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
techdragon pushed a commit to techdragon/poetry that referenced this issue Jan 7, 2020
- Fixes python-poetry#1350
- Added support for specifying a set of license files as part of the project config.
- Moved the license file config into the package configuration. (`Factory.create_poetry()`) this matches how similar configurations such as “readme” are configured.
- Updated the builders to use the project level license file list instead of searching for their own (previously different) lists of license files.
- Moved the existing auto-discovery behaviours to become the default case during `create_poetry()` if nothing specific was configured.
- Added tests for the new features
- Documented the new configuration field.
- Added the “license-files” field to the poetry-schema.json
- Updated pre-commit config to use the correct black source repo, and set the default language for better consistency with any other pre-commit checks that will be added in the future.
- Fix python-poetry#866 by modifing the base template used by `SdistBuilder`. It now uses `setuptools`, since as documented by @seifertm in issue python-poetry#866 `pip` uses `setuptools` anyway and this clears the way to immediately supporting pypa/setuptools#1767 once this is merged and released from `setuptools`. Until `setuptools` updates to support multiple license files, this will result in a single log line in the debug output from `setuptools` so this is ok to merge before the change to `setuptools` is merged.
Copy link

github-actions bot commented Mar 3, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/build-system Related to PEP 517 packaging (see poetry-core) kind/feature Feature requests/implementations
Projects
None yet
Development

No branches or pull requests

9 participants