-
-
Notifications
You must be signed in to change notification settings - Fork 92
'LegacyVersion' object has no attribute 'major' #299
Comments
@NicklasTegner I had the same issue
|
Hi. Downgrading dsdev_utils to the version above seems to work. |
There was a change in a dependent library. I'll take a look. |
+1 getting this error as well |
Here's the cause: Digital-Sapphire/dsdev-utils#9 (comment) Basically, your version string is probably not PEP440 compliant, so One workaround is to make your versioning PEP440 compliant. |
@dennisvang can you give some examples of PEP440 compliant, versioning strings. |
@NicklasTegner lots of examples are available in the PEP440 linked above. More specifically, here: PEP440 - examples of compliant version schemes. |
@NicklasTegner After having a closer look, it turns out my suggested workaround is not very helpful in this specific case, because the actual "version string" is a filename here, e.g. See Package.extract_info, line 186 from your traceback. The underlying cause is in I'll try to fix this on the |
By the way, note that tests.test_package_handler.TestPackage fails with the exact same error. |
@dennisvang Any update on this issue?
|
@mathieukaelin Sorry, no updates, unfortunately: PR #322 (mentioned above) should fix this, but I haven't seen any movement from the maintainers since then... You could try it out by installing directly from my fork (see pip VCS support), e.g. something like:
However, this is not a proper permanent solution. Alternatively you could downgrade to pyupdater 3.1.1, which does work, mostly. |
@dennisvang Thanks for the advice and for your work on this issue. I think I will downgrade to pyupdater 3.1.1. Especially given the fact that apparently it may be not be possible to migrate from pyupdater 4.0 to 5.0 in the futur according to Project Update v5 - Clean Slate issue. |
Hi
I get the following error when trying to process my generated packages
Log output is the following
2021-07-18T23:44:46.1915991Z [INFO] Processing packages...
2021-07-18T23:44:46.1916666Z 449 INFO: Processing packages...
2021-07-18T23:44:46.1917239Z [INFO] Patch support enabled
2021-07-18T23:44:46.1917940Z 450 INFO: Patch support enabled
2021-07-18T23:44:46.1918500Z [INFO] Generating package list
2021-07-18T23:44:46.1919091Z 450 INFO: Generating package list
2021-07-18T23:44:46.1920509Z 450 DEBUG: Extracting update archive info for: VisCon-win-1.0.11.zip
2021-07-18T23:44:46.1921585Z [ERROR] 'LegacyVersion' object has no attribute 'major'
2021-07-18T23:44:46.1925370Z 450 ERROR: 'LegacyVersion' object has no attribute 'major'
2021-07-18T23:44:46.1926470Z 450 DEBUG: 'LegacyVersion' object has no attribute 'major'
2021-07-18T23:44:46.1927165Z Traceback (most recent call last):
2021-07-18T23:44:46.1929530Z File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pyupdater/cli/init.py", line 79, in main
2021-07-18T23:44:46.1930458Z _real_main(args)
2021-07-18T23:44:46.1931738Z File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pyupdater/cli/init.py", line 55, in _real_main
2021-07-18T23:44:46.1932674Z dispatch_command(args, pyi_args)
2021-07-18T23:44:46.1933965Z File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pyupdater/cli/init.py", line 68, in dispatch_command
2021-07-18T23:44:46.1934890Z cmd(args, pyi_args)
2021-07-18T23:44:46.1936308Z File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pyupdater/cli/commands.py", line 305, in _cmd_pkg
2021-07-18T23:44:46.1937312Z pyu.process_packages(ns.verbose)
2021-07-18T23:44:46.1938638Z File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pyupdater/core/init.py", line 77, in process_packages
2021-07-18T23:44:46.1939694Z self.ph.process_packages(report_errors)
2021-07-18T23:44:46.1941214Z File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pyupdater/core/package_handler/init.py", line 107, in process_packages
2021-07-18T23:44:46.1943249Z pkg_manifest, patch_manifest = self._get_package_list(report_errors)
2021-07-18T23:44:46.1945165Z File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pyupdater/core/package_handler/init.py", line 180, in _get_package_list
2021-07-18T23:44:46.1946192Z new_pkg = Package(p)
2021-07-18T23:44:46.1947808Z File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pyupdater/core/package_handler/package.py", line 154, in init
2021-07-18T23:44:46.1948870Z self.extract_info(filename)
2021-07-18T23:44:46.1950290Z File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/pyupdater/core/package_handler/package.py", line 186, in extract_info
2021-07-18T23:44:46.1951346Z v = Version(package_basename)
2021-07-18T23:44:46.1952594Z File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/dsdev_utils/helpers.py", line 147, in init
2021-07-18T23:44:46.1953537Z self._parse_version_str(version)
2021-07-18T23:44:46.1954843Z File "/opt/hostedtoolcache/Python/3.9.6/x64/lib/python3.9/site-packages/dsdev_utils/helpers.py", line 151, in _parse_version_str
2021-07-18T23:44:46.1955838Z self.major = version_data.major
2021-07-18T23:44:46.1956828Z AttributeError: 'LegacyVersion' object has no attribute 'major'
2021-07-18T23:44:46.1958134Z 'LegacyVersion' object has no attribute 'major'
The text was updated successfully, but these errors were encountered: