Skip to content

presence of setup.py breaks entrypoint generation #2324

Closed

Description

@wichert
  • 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

Activity

  1. added
    kind/bugSomething isn't working as expected
    status/triageThis issue needs to be triaged
    on Apr 19, 2020
  2. finswimmer commented on Apr 19, 2020

    @finswimmer
    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

  3. wichert commented on Apr 19, 2020

    @wichert
    Author

    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?

  4. louwers commented on Aug 24, 2020

    @louwers

    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.*']),
    
  5. abn commented on Aug 25, 2020

    @abn
    Member

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

  6. abn commented on Aug 25, 2020

    @abn
    Member

    @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

  7. added this to the 1.1 milestone on Aug 25, 2020
  8. linked a pull request that will close this issueImprove editable installs #2360on Aug 25, 2020
  9. github-actions commented on Mar 3, 2024

    @github-actions

    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.

  10. locked as resolved and limited conversation to collaborators on Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions