py2deb icon indicating copy to clipboard operation
py2deb copied to clipboard

py2deb no longer seems to handle python/debian versions

Open brifordwylie opened this issue 8 years ago • 4 comments

So for a long time my python project had a setup.py with specific version of python packages.

install_requires=[
    'flask==0.10.1',  # or whatever
    ...

Everything has worked fine for 6ish months and now suddenly I'm getting these errors:

2016-02-12 01:26:22 vagrant-ubuntu-trusty-64 py2deb.cli[6284] ERROR Caught an unhandled exception!
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/py2deb/cli.py", line 192, in main
    archives, relationships = converter.convert(arguments)
  File "/usr/local/lib/python2.7/dist-packages/py2deb/converter.py", line 524, in convert
    archive = package.convert()
  File "/usr/local/lib/python2.7/dist-packages/py2deb/package.py", line 383, in convert
    dependencies = [python_version()] + self.debian_dependencies
  File "/usr/local/lib/python2.7/dist-packages/cached_property.py", line 26, in __get__
    value = obj.__dict__[self.func.__name__] = self.func(obj)
  File "/usr/local/lib/python2.7/dist-packages/py2deb/package.py", line 295, in debian_dependencies
    version = self.converter.transform_version(self, requirement.project_name, version)
  File "/usr/local/lib/python2.7/dist-packages/py2deb/converter.py", line 656, in transform_version
    """, name=normalized_name, count=num_matches, matches=matching_packages))
Exception: Expected requirement set to contain exactly one Python package whose name can be normalized to flask but encountered 0 packages instead! (matching packages: [])

brifordwylie avatar Feb 12 '16 01:02 brifordwylie

$ pip list | grep py2deb py2deb (0.24.2)

brifordwylie avatar Feb 12 '16 01:02 brifordwylie

Hi Brian, thanks for the feedback and sorry for breaking your use case! The information you've provided isn't enough for me to reproduce the issue you describe (I've been trying for a while now :-) so I'm wondering:

  1. Is your Python project's source available somewhere for me to download so I can try to reproduce the issue based on the exact same set of Python packages?
  2. Alternatively (if point one isn't an option) can you run py2deb in verbose mode (py2deb -v ...), capture the output and post it here? If you don't want to share the log output publicly on GitHub you can also e-mail it to me directly.

Thanks in advance!

xolox avatar Mar 04 '16 10:03 xolox

Have a same error for many packages =( Expected requirement set to contain exactly one Python package whose name can be normalized to pylint-plugin-utils but encountered 0 packages instead

# pip3 list| grep py2deb
py2deb (1.1)

My requirements.txt contain this:

pylint
django==1.11
pylint-django
python-social-auth
django-notifications-hq
stripe
python-dateutil
analytics-python
django-allauth
bcrypt
python-magic
pytz
psycopg2
Pillow
https://github.com/celery/django-celery/archive/master.zip
celery==3.1.25
billiard==3.3.0.23
kombu==3.0.37
amqp==1.4.9

For reproduce it, you can use my script:

#!/bin/bash

for dep in `cat requirements.txt`
do
	echo ''; echo ''
	echo $dep
	py2deb --name-prefix=python3 -r tmp/py2deb/ -- --no-deps $dep
	#exit 0
done

with -- -r requirements.txt work ok, but generate stupid unsolvable versions of dependencies.

itJunky avatar Apr 16 '18 22:04 itJunky

Seems like people are still running into this and I myself ran into it again today, there's some issue with the logic on this line inside package.py

 version = self.converter.transform_version(self, requirement.project_name, version)

I used the @trousev patch/hack and then everything worked fine

  • See (https://github.com/trousev/py2deb/commit/70328587f6dee81093035a2f6a0d34f981c263a7)

I'm reopening this and hopefully someone on the py2deb team can make a quick fix :)

brifordwylie avatar Oct 30 '18 22:10 brifordwylie