Closed boegel closed 1 year ago
I don't know. Does upgrading pip make any difference?
No, same problem with pip 22.2.2 . Full output produced by pip install
:
$ pip install --prefix /tmp/$USER/looseversion .
Processing /private/tmp/kehoste/looseversion-1.0.1
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: looseversion
Building wheel for looseversion (pyproject.toml) ... done
Created wheel for looseversion: filename=looseversion-1.0.1-py3-none-any.whl size=3235 sha256=e2085c38dc77bd07db12a54e3b70920f7bdf808b8f91cf4147e6142dc6e7a410
Stored in directory: /Users/kehoste/Library/Caches/pip/wheels/53/3e/db/5a114fc81b49312ae9c4fc653e3e53350a2fa74f9fb111a4ff
Successfully built looseversion
Installing collected packages: looseversion
Successfully installed looseversion-1.0.1
Maybe something is missing in pyproject.toml
to indicate that looseversion.py
should be installed (since looseversion
is a single-module package, with no proper Python packages)?
Nothing improper about modules that are not packages!
In setup.py
, the parameter name is py_modules
, and it’s probably spelled the same way for setup.cfg
.
Current file is missing the _
.
So pymodules = looseversion.py
works for building a wheel but seems to be undocumented. It might be an ancient distutils practice...
I think if you change it to py_modules = looseversion
, that might work. If you figure it out, could you submit a PR?
Another option could be to update the build configuration to be entirely in pyproject.toml
. Since that's a bit more strongly-typed than setup.cfg
, it might be easier to debug.
pymodules
was never a setup parameter, and the values were always module names not filenames (no .py
). Very strange that it seemed to build a correct wheel! Probably another mechanism was including the file (maybe MANIFEST.in or another setup option), then it ended up installed because some other part of the code matched all Python files or something like that.
I think you're right. Dropping the pymodules
line altogether doesn't break anything, so I guess it was just luck. And I did test py_modules = looseversion
does work. Will submit a PR momentarily.
@boegel 1.0.2 has been uploaded to PyPI.
Thanks a lot, I can confirm that looseversion
1.0.2 is working as expected :+1:
I'm seeing a weird problem when I'm installing from the source tarball obtained from PyPI: it's not actually being installed?
The output below is from macOS 12.6, but I'm also seeing this on a Red Hat Enterprise Linux 8 system using Python 3.9.5 + pip 21.1.1.
Any idea why only a
looseversion-1.0.1.dist-info
directory is being installed (which only contains metadata), and whylooseversion.py
is not being actually installed?