[Distutils] 'Invalid module name' creating package with setuptools

Marius Gedminas marius at gedmin.as
Fri Apr 15 02:24:42 EDT 2016


On Thu, Apr 14, 2016 at 11:28:09AM -0400, Luí­s de Sousa via Distutils-SIG wrote:
> I have a project with these contents:
> 
> proj
> ├── proj
> │ ├── scriptA.py
> │ ├── scriptB.py
> │ └── __init__.py
> ├── LICENCE
> ├── README.md
> └── setup.py
> 
> The setup.py file looks like:
...
> entry_points={
> 'console_scripts': [
> 'scriptA=proj:scriptA',
> 'scriptB=proj:scriptB'

I'm not sure this is right -- an entry point should point to a python
module (not a package) and a function in that module, so something like

  'scriptA=proj.scriptA:main',
  'scriptB=proj.scriptB:main',

I've never tried to define entry points pointing to functions defined in
the __init__.py of a package, so I don't know if you're allowed to write

  scriptX=proj:fn

or if you have to explicitly say

  scriptX=proj.__init__:fn

> When I try to build I get the following error:
> 
> $ python setup.py bdist_wheel --universal
> error in proj setup command: ('Invalid module name', 'proj')

(That is not a good error message indeed.)

Marius Gedminas
-- 
This loads a GDT entry into the "Task Register": that entry points to a
structure called the Task State Segment.  Some comments scattered though the
kernel code indicate that this used for task switching in ages past, along
with blood sacrifice and astrology.
                -- lguest source code
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 173 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20160415/ee98123c/attachment.sig>


More information about the Distutils-SIG mailing list