zopefoundation / zope.interface

Interfaces for Python
http://zopeinterface.readthedocs.io/
Other
330 stars 71 forks source link

Package name causes issues when combining requirements #255

Closed Jorricks closed 2 years ago

Jorricks commented 2 years ago

BUG/PROBLEM REPORT (OR OTHER COMMON ISSUE)

What I did:

I created a small setup.py and listed a package that has zope-interface==5.4.0 as requirement. I used pip-tools to compile the package, which leads to zope-interface==5.4.0 being added. When I install the package I get

Requirement already satisfied: zope-interface==5.4.0 in /Users/jorrick/my_venv/lib/python3.8/site-packages (5.4.0)

Then when I try to run my entry_point console_scripts, I get

pkg_resources.DistributionNotFound: The 'zope-interface==5.4.0' distribution was not found and is required by my_package

But when I run pip3 freeze, I get

zope.interface==5.4.0

What I expect to happen:

That I am able to run my CLI commands without issues

What actually happened:

It throws a DistributionNotFound error.

What version of Python and Zope/Addons I am using:

Python3.8
zope.event==4.5.0
zope.interface==5.4.0

on MacOs

d-maurer commented 2 years ago

Jorrick Sleijster wrote at 2022-3-11 02:14 -0800:

...

What I did:

I created a small setup.py and listed a package that has zope-interface==5.4.0 as requirement. I used pip-tools to compile the package, which leads to zope-interface==5.4.0 being added.

The package has the name zope.interface (not zope-interface).

Jorricks commented 2 years ago

Yess I think you are right and I need to take this up with pip-tools instead of this repository.

Jorricks commented 2 years ago

Opened https://github.com/jazzband/pip-tools/issues/1599 with pip-tools

jamadden commented 2 years ago

This is a constant struggle, because, according to PEP 503, . gets normalized away to - for purposes of interacting with PyPI indexes. But that normalization is often inconsistently applied or applied to places it shouldn't be.

$ pip -vv index versions zope.interface
1 location(s) to search for versions of zope.interface:
* https://pypi.org/simple/zope-interface/
Fetching project page and analyzing links: https://pypi.org/simple/zope-interface/
Getting page https://pypi.org/simple/zope-interface/
…
zope.interface (5.4.0)
Available versions: 5.4.0, 5.3.0, 5.2.0, 5.1.2, 5.1.1, 5.1.0, 5.0.2, 5.0.1, 5.0.0, 4.7.2, 4.7.1, 4.7.0, 4.6.0, 4.5.0, 4.4.3, 4.4.2, 4.4.1, 4.4.0, 4.3.3, 4.3.2, 4.3.1, 4.3.0, 4.2.0, 4.1.3, 4.1.2, 4.1.1, 4.1.0, 4.0.5, 4.0.4, 4.0.3, 4.0.2, 4.0.1, 4.0.0, 3.8.0, 3.7.0, 3.6.8, 3.6.7, 3.6.6, 3.6.5, 3.6.4, 3.6.3, 3.6.2, 3.6.1, 3.6.0, 3.5.3, 3.5.2, 3.5.1, 3.5.0, 3.4.1, 3.4.0, 3.3.0.1, 3.3.0
  INSTALLED: 5.4.0
  LATEST:    5.4.0