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

presence of setup.py breaks entrypoint generation #2324

Closed
2 of 3 tasks
wichert opened this issue Apr 19, 2020 · 6 comments · Fixed by #2360
Closed
2 of 3 tasks

presence of setup.py breaks entrypoint generation #2324

wichert opened this issue Apr 19, 2020 · 6 comments · Fixed by #2360
Labels
kind/bug Something isn't working as expected
Milestone

Comments

@wichert
Copy link

wichert commented Apr 19, 2020

  • 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: macOS 10.15.4
  • Poetry version: 1.0.5

Issue

I had a dummy setup.py (based on this post):

#!/usr/bin/env python

import setuptools

if __name__ == "__main__":
    setuptools.setup()

When that file is present two things happen when doing poetry install:

  • egg info is now created under UNKNOWN.egg-info
  • entry_points.txt is no longer generated

Interestingly enough entry_points.txt is still present in a generated wheel.

Steps to reproduce

poetry new testpoint
cd testpoint
printf '\n[tool.poetry.plugins.test]\nmain = "foo"' >> pyproject.toml
echo 'import setuptools; setuptools.setup()' > setup.py
poetry install
@wichert wichert added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Apr 19, 2020
@finswimmer
Copy link
Member

Hello @wichert,

as the last step in poetry install poetry creates a temporary setup.py and uses pip to install the package itself in editable mode (pipcan't do this at the moment with a pyproject.toml). If there is already a setup.py poetry will not overwrite this one, so pip will use the one already present.

Is there any reason why you've created the setup.py? This is not necessary when using poetry. Just remove the file and everything should work fine.

fin swimmer

@wichert
Copy link
Author

wichert commented Apr 19, 2020

Hi fin,

I have to admit that with all the changes in setup.py, setup.cfg and pyproject.toml I am having a hard time figuring out what exactly goes where and why. I hadn't realised not having a setup.py was actually a viable approach here, and since this project was migrated to poetry it already had a setup.py. Perhaps it would be helpful if poetry could give a warning if setup.py already exists?

@louwers
Copy link

louwers commented Aug 24, 2020

setup.py is still needed for Cython extensions, for intergration with some versioning systems or for better support for namespace packages, e.g.

    packages=find_namespace_packages(include=['pkg.*']),

@abn
Copy link
Member

abn commented Aug 25, 2020

@louwers can't this be done via poetry's packages configuration? Also note that poetry detects namespace packages without any issues.

@abn
Copy link
Member

abn commented Aug 25, 2020

@wichert with 1.1.0 poetry will not use setuptools for the editable installs. The presence of a setup file should not impact this anymore.

See: #2360

@abn abn removed the status/triage This issue needs to be triaged label Aug 25, 2020
@abn abn added this to the 1.1 milestone Aug 25, 2020
@abn abn linked a pull request Aug 25, 2020 that will close this issue
2 tasks
@abn abn closed this as completed Aug 25, 2020
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
kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants