nats.py
nats.py copied to clipboard
Inconsistent version: filename has '2.2.0', but metadata has '0.0.0'
Getting these errors when attempting to build a Docker container that has nats-py==2.2.0
in the requirements.txt
:
WARNING: Requested nats-py==2.2.0 from https://files.pythonhosted.org/packages/21/00/831ef555466bcde9419fc953ded17cb83e255733b248bf0e72a0a11759b6/nats-py-2.2.0.tar.gz (from -r /opt/tmp/requirements.txt (line 5)), but installing version 0.0.0
Discarding https://files.pythonhosted.org/packages/21/00/831ef555466bcde9419fc953ded17cb83e255733b248bf0e72a0a11759b6/nats-py-2.2.0.tar.gz (from https://pypi.org/simple/nats-py/) (requires-python:>=3.7): Requested nats-py==2.2.0 from https://files.pythonhosted.org/packages/21/00/831ef555466bcde9419fc953ded17cb83e255733b248bf0e72a0a11759b6/nats-py-2.2.0.tar.gz (from -r /opt/tmp/requirements.txt (line 5)) has inconsistent version: filename has '2.2.0', but metadata has '0.0.0'
I do not get any errors if I use nats-py==2.1.7
instead. But I would actually like to use the new API. Maybe something went wrong when the 2.2.0
package was built? The Meta section on https://pypi.org/project/nats-py/ also does not look right to me.
Some more information:
- Not getting this error on Fedora 36, using pip 2.22.2
- Getting this error on Ubuntu 22.04, also using pip 2.22.2
Output from pip3 install --verbose nats-py==2.2.0
on Ubuntu 22.04:
Using pip 22.2.2 from /usr/local/lib/python3.10/dist-packages/pip (python 3.10)
Looking in indexes: https://nexus.holoplot.net/repository/pypi-group/simple/, https://pypi.org/simple/
Collecting nats-py==2.2.0
Using cached nats-py-2.2.0.tar.gz (61 kB)
Running command pip subprocess to install build dependencies
Looking in indexes: https://nexus.holoplot.net/repository/pypi-group/simple/, https://pypi.org/simple/, https://pypi.org/simple/
Collecting setuptools>=61.0
Using cached setuptools-65.4.1-py3-none-any.whl (1.2 MB)
Installing collected packages: setuptools
Successfully installed setuptools-65.4.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Installing build dependencies ... done
Running command Getting requirements to build wheel
running egg_info
writing manifest file 'nats_py.egg-info/SOURCES.txt'
Getting requirements to build wheel ... done
Running command pip subprocess to install backend dependencies
Looking in indexes: https://nexus.holoplot.net/repository/pypi-group/simple/, https://pypi.org/simple/, https://pypi.org/simple/
Collecting wheel
Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel
Successfully installed wheel-0.37.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Installing backend dependencies ... done
Running command Preparing metadata (pyproject.toml)
running dist_info
creating /tmp/pip-modern-metadata-_2brdwbm/nats_py.egg-info
writing manifest file '/tmp/pip-modern-metadata-_2brdwbm/nats_py.egg-info/SOURCES.txt'
writing manifest file '/tmp/pip-modern-metadata-_2brdwbm/nats_py.egg-info/SOURCES.txt'
Preparing metadata (pyproject.toml) ... done
WARNING: Requested nats-py==2.2.0 from https://files.pythonhosted.org/packages/21/00/831ef555466bcde9419fc953ded17cb83e255733b248bf0e72a0a11759b6/nats-py-2.2.0.tar.gz, but installing version 0.0.0
Discarding https://files.pythonhosted.org/packages/21/00/831ef555466bcde9419fc953ded17cb83e255733b248bf0e72a0a11759b6/nats-py-2.2.0.tar.gz (from https://pypi.org/simple/nats-py/) (requires-python:>=3.7): Requested nats-py==2.2.0 from https://files.pythonhosted.org/packages/21/00/831ef555466bcde9419fc953ded17cb83e255733b248bf0e72a0a11759b6/nats-py-2.2.0.tar.gz has inconsistent version: filename has '2.2.0', but metadata has '0.0.0'
Using cached https://nexus.holoplot.net/repository/pypi-group/packages/nats-py/2.2.0/nats-py-2.2.0.tar.gz (61 kB)
Running command pip subprocess to install build dependencies
Looking in indexes: https://nexus.holoplot.net/repository/pypi-group/simple/, https://pypi.org/simple/, https://pypi.org/simple/
Collecting setuptools>=61.0
Using cached setuptools-65.4.1-py3-none-any.whl (1.2 MB)
Installing collected packages: setuptools
Successfully installed setuptools-65.4.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Installing build dependencies ... done
Running command Getting requirements to build wheel
running egg_info
writing manifest file 'nats_py.egg-info/SOURCES.txt'
Getting requirements to build wheel ... done
Running command pip subprocess to install backend dependencies
Looking in indexes: https://nexus.holoplot.net/repository/pypi-group/simple/, https://pypi.org/simple/, https://pypi.org/simple/
Collecting wheel
Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel
Successfully installed wheel-0.37.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Installing backend dependencies ... done
Running command Preparing metadata (pyproject.toml)
running dist_info
creating /tmp/pip-modern-metadata-y4hapurs/nats_py.egg-info
writing manifest file '/tmp/pip-modern-metadata-y4hapurs/nats_py.egg-info/SOURCES.txt'
writing manifest file '/tmp/pip-modern-metadata-y4hapurs/nats_py.egg-info/SOURCES.txt'
Preparing metadata (pyproject.toml) ... done
WARNING: Requested nats-py==2.2.0 from https://nexus.holoplot.net/repository/pypi-group/packages/nats-py/2.2.0/nats-py-2.2.0.tar.gz#sha256=e45a0bafde2d04fb2d2bd6b0527b95bc77f371beaf7b6237354be0234ff9bba9, but installing version 0.0.0
Discarding https://nexus.holoplot.net/repository/pypi-group/packages/nats-py/2.2.0/nats-py-2.2.0.tar.gz#sha256=e45a0bafde2d04fb2d2bd6b0527b95bc77f371beaf7b6237354be0234ff9bba9 (from https://nexus.holoplot.net/repository/pypi-group/simple/nats-py/) (requires-python:>=3.7): Requested nats-py==2.2.0 from https://nexus.holoplot.net/repository/pypi-group/packages/nats-py/2.2.0/nats-py-2.2.0.tar.gz#sha256=e45a0bafde2d04fb2d2bd6b0527b95bc77f371beaf7b6237354be0234ff9bba9 has inconsistent version: filename has '2.2.0', but metadata has '0.0.0'
ERROR: Could not find a version that satisfies the requirement nats-py==2.2.0 (from versions: 2.0.0a1, 2.0.0a2, 2.0.0rc1, 2.0.0rc2, 2.0.0rc3, 2.0.0rc4, 2.0.0rc5, 2.0.0, 2.1.0, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.6, 2.1.7, 2.2.0)
ERROR: No matching distribution found for nats-py==2.2.0
I do not understand why this happens on Ubuntu 22.04 (or actually in a Docker container based on Ubuntu 22.04). All I can say is that other packages (and other versions of nats-py
) do not seem affected. So maybe this is not a bug in nats-py
after all, but I'm puzzled and have no idea how to proceed.
Hi @svenfoo, thanks for the report. We attempted to adopt a new way to build the package here (https://github.com/nats-io/nats.py/pull/341) and looks like there are some problems then... Thanks for sharing how to reproduce, I will take a look soon.
@svenfoo could you share a simple version of the Docker file that you are using to build this? Interested in the docker FROM
image for the ubuntu layer to try to reproduce, thanks in advance!
Here's the most simple Dockerfile
I could come up with that reproduces the problem:
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y python3-pip
# The next line would update pip. Tried with and without it, doesn't seem to make a difference.
# RUN python3 -m pip install -U pip
RUN pip install nats-py==2.2.0
This, on the other hand, works. So it seems to be something with the Ubuntu image.
FROM python:3.10.6
RUN pip install nats-py==2.2.0
Adding the option --use-deprecated=legacy-resolver
to the pip install
command allows me to install nats-py 2.2.0 in the Ubuntu based container, albeit with the wrong version:
Successfully installed nats-py-0.0.0