这是indexloc提供的服务,不要输入任何密码
Skip to content

hashin cannot handle leading zeros in package version numbers #39

@chrispbailey

Description

@chrispbailey

Pip can install packages with a missing leading zero in the version number e.g. Unidecode==0.04.20:

I was passing the output of pip freeze into hashin and encountered this problem.

/tmp > bin/pip install Unidecode==0.4.20  # or Unidecode==0.04.20
Collecting Unidecode==0.4.20
  Using cached Unidecode-0.04.20-py2.py3-none-any.whl
Installing collected packages: Unidecode
Successfully installed Unidecode-0.4.20
/tmp > bin/pip freeze
Unidecode==0.4.20

But hashin cannot handle this.

/tmp > bin/hashin Unidecode==0.4.20
Traceback (most recent call last):
  File "bin/hashin", line 11, in <module>
    sys.exit(main())
  File "/tmp/local/lib/python2.7/site-packages/hashin.py", line 400, in main
    verbose=args.verbose,
  File "/tmp/local/lib/python2.7/site-packages/hashin.py", line 96, in run
    run_single_package(spec, *args, **kwargs)
  File "/tmp/local/lib/python2.7/site-packages/hashin.py", line 119, in run_single_package
    algorithm=algorithm
  File "/tmp/local/lib/python2.7/site-packages/hashin.py", line 363, in get_package_hashes
    raise PackageError('No data found for version {0}'.format(version))
hashin.PackageError: No data found for version 0.4.20

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions