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

Problem on entry_points when package and module have the same name #1432

Closed
eamanu opened this issue Jul 20, 2018 · 1 comment
Closed

Problem on entry_points when package and module have the same name #1432

eamanu opened this issue Jul 20, 2018 · 1 comment
Labels
Needs Repro Issues that need a reproducible example.

Comments

@eamanu
Copy link

eamanu commented Jul 20, 2018

Hello Everybody,

I have the next simply test_eamanu.py file:

def main():
    print("Hello World!")

if __name__ == '__main__':
    main()

And the next simply setup.py:

from setuptools import setup

setup(
    name='test_eamanu',
    packages=['test_eamanu],
    entry_points={
        'console_scripts':[
            'test_eamanu=test_eamanu.test_eamanu:main'
        ]
    }
)

Whole is in this tree structure:

.
├── test_eamanu
│   ├── __init__.py
│   └── test_eamanu.py
|__ setup.py

When, I run python setup.py install the script finish successfully, but the "command" test doesn't work.

Workaround

To avoid this problem I have to rename the package to src. So, the setup.py is the next:

from setuptools import setup

setup(
    name='test_eamanu',
    packages=['test_eamanu],
    entry_points={
        'console_scripts':[
            'test_eamanu=src.test_eamanu:main'
        ]
    }
)
@pganssle pganssle added Needs Triage Issues that need to be evaluated for severity and status. Needs Repro Issues that need a reproducible example. and removed Needs Triage Issues that need to be evaluated for severity and status. labels Oct 19, 2018
@pganssle
Copy link
Member

@eamanu I can't reproduce this issue.

I created a repo for it, and it works just fine:

$ git clone git@github.com:pganssle-bug-mwes/setuptools_1432.git
Cloning into 'setuptools_1432'...
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 6 (delta 0), reused 6 (delta 0), pack-reused 0
Receiving objects: 100% (6/6), done.
$ cd setuptools_1432/
$ python -m venv venv
$ source venv/bin/activate
(venv) $ pip install .
Processing /tmp/setuptools_1432
Installing collected packages: test-eamanu
  Running setup.py install for test-eamanu ... done
Successfully installed test-eamanu-0.0.0
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
(venv) $ test_eamanu
Hello World!

I'm going to close this for now, but if you think I've made a mistake attempting to reproduce this, let me know and I can re-open it.

That said, I'm a big fan of the src layout, so if this is some bug that was caused by something happening in your local directory that was fixed by using a src layout, let me know, because that's more fuel for the fire. 🔥🔥🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Repro Issues that need a reproducible example.
Projects
None yet
Development

No branches or pull requests

2 participants