Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parsing error on packages with git+ #2

Open
Amar1729 opened this issue May 12, 2022 · 1 comment
Open

parsing error on packages with git+ #2

Amar1729 opened this issue May 12, 2022 · 1 comment

Comments

@Amar1729
Copy link
Owner

Dependency:

git+https://github.com/ge-semtk/semtk-python3@1b61fffa5557bb5c2f124394934a2e6bcef86538

Raises an unrecoverable error for pip-rewind. Investigate

Exception ignored in: <generator object requirements_parser at 0x7f6c8badceb0>
Traceback (most recent call last):
  File "/home/Amar1729/.local/lib/python3.8/site-packages/pip_rewind/cli.py", line 39, in main
    version = get_first_version_before(module, args.date)
RuntimeError: generator ignored GeneratorExit
Traceback (most recent call last):
  File "/home/Amar1729/.local/bin/pip-rewind", line 8, in <module>
    sys.exit(main())
  File "/home/Amar1729/.local/lib/python3.8/site-packages/pip_rewind/cli.py", line 39, in main
    version = get_first_version_before(module, args.date)
  File "/home/Amar1729/.local/lib/python3.8/site-packages/pip_rewind/versions.py", line 101, in get_first_version_before
    version = get_first_version_before_rss(pkg, date)
  File "/home/Amar1729/.local/lib/python3.8/site-packages/pip_rewind/versions.py", line 53, in get_first_version_before_rss
    for version, release_date in get_versions(pkg):
  File "/home/Amar1729/.local/lib/python3.8/site-packages/pip_rewind/versions.py", line 33, in get_versions
    feed = rss_parser.Parser(xml=xml.content).parse()
  File "/home/Amar1729/.local/lib/python3.8/site-packages/rss_parser/_parser.py", line 39, in parse
    "version": main_soup.rss.get("version"),
AttributeError: 'NoneType' object has no attribute 'get'
@Amar1729
Copy link
Owner Author

Looks like current RE will match git, and then attempt to look at a module named git on pypi

parsed = re.match(r"\s*([A-Za-z0-9\-]+)", line)

I could hardcode a check for git+ but i think more robust might be stripping trailing comments and then asserting that the match result is equal to the original line?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant