But it fails right away on the second command, no matter what I pass to --python-version.
This is the error message:
Traceback (most recent call last):
File "/home/eric/.local/bin/wheel2deb", line 8, in <module>
sys.exit(main())
File "/home/eric/.local/lib/python3.6/site-packages/wheel2deb.py", line 224, in main
debianize(args)
File "/home/eric/.local/lib/python3.6/site-packages/wheel2deb.py", line 145, in debianize
if not wheel.version_supported(ctx.python_version):
File "/home/eric/.local/lib/python3.6/site-packages/_wheel2deb/pydist.py", line 145, in version_supported
m = re.search(r"(?:py|cp)%s" % pyvers.major, self.python_tag)
AttributeError: 'str' object has no attribute 'major
So it looks like it is expecting something formatted as a Version but it is getting a string,
To debug this I added this print statements to wheel2deb.py, since I got the feeling the argument wasn't being parsed correctly:
print("Settings:")
print(settings)
# config file takes precedence over command line arguments
settings.default_ctx.update(vars(args))
print("Settings after update:")
print(settings)
Indeed the python_version key goes from a Version to a str after that update:
I managed to work around this by changing the update function like this:
def update(self, changes):
for k, v in changes.items():
if v and hasattr(self, k):
if k == "python_version":
changes[k] = Version.from_str(v) if isinstance(v, str) else v
setattr(self, k, changes[k])
I came across this bug when trying to debianize a package using my py3 environment but trying to get a py2 package.
I was following the guide:
But it fails right away on the second command, no matter what I pass to
--python-version
. This is the error message:So it looks like it is expecting something formatted as a
Version
but it is getting a string,To debug this I added this print statements to
wheel2deb.py
, since I got the feeling the argument wasn't being parsed correctly:Indeed the python_version key goes from a
Version
to astr
after that update:I managed to work around this by changing the
update
function like this:Thanks for the amazing tool!