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

Dotted Python version not fully supported #167

Open
sschuberth opened this issue Jan 12, 2024 · 7 comments
Open

Dotted Python version not fully supported #167

sschuberth opened this issue Jan 12, 2024 · 7 comments

Comments

@sschuberth
Copy link
Contributor

Although as of version 0.9.3 "dotted" Python versions, like "2.7", should be supported in addition to "27", it seems that at least for analyzing setup.py it's not supported.

Running

python-inspector --setup-py setup.py --python-version 2.7 --operating-system linux --json-pdt -

on any setup.py file gives

Exception: Python version 2..7 is not compatible with setup.py

(Note the double-dot ".." in there), whereas using --python-version 27 succeeds.

@sschuberth
Copy link
Contributor Author

The problem seems to be that get_python_version_from_env_tag() unconditionally inserts ".". But instead of fixing that, I wonder instead a lookup in PYTHON_DOT_VERSIONS_BY_VER should be used, and if no match is found (if a version already contains a dot), simply fall back to the literal version.

@pombredanne
Copy link
Member

Can you try the latest version instead?
And if this does not work, can you try this branch https://github.com/nexB/python-inspector/tree/python-dot-version ?

@sschuberth
Copy link
Contributor Author

Can you try the latest version instead?

I am testing with 0.10.0, I was just stating that it should work starting from 0.9.3 according to the release notes.

And if this does not work, can you try this branch https://github.com/nexB/python-inspector/tree/python-dot-version ?

I'll have a look.

@sschuberth
Copy link
Contributor Author

sschuberth commented Jan 12, 2024

I'll have a look.

So, I tried to run ./configure, which is trying to build the wheel for intbitset (although I have the python-intbitset package installed on my Fedora as suggested also for ScanCode), and the build fails:

  Building wheel for intbitset (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [185 lines of output]
      /tmp/pip-install-rpidp35t/intbitset_e129b03c10c44b69b0fc61bbbb1aaabb/setup.py:37: SyntaxWarning: invalid escape sequence '\s'
        version = re.search('__version__\s*=\s*"(?P<version>.*)"\n', f.read()).group("version")

@sschuberth
Copy link
Contributor Author

can you try this branch https://github.com/nexB/python-inspector/tree/python-dot-version ?

Can this just be merged @pombredanne so I could test it as part of a new release?

@pombredanne
Copy link
Member

pombredanne commented Jan 26, 2024

@sschuberth re:

Can this just be merged @pombredanne so I could test it as part of a new release?

I would prefer not merging broken code... you can test it anyway using:
pip install https://github.com/nexB/python-inspector/archive/refs/heads/python-dot-version.tar.gz

@sschuberth
Copy link
Contributor Author

I would prefer not merging broken code...

Uhm, how about adding test for that which run in CI as part of PR checks?

you can test it anyway using:

Thanks, but how does the source code archive help me if I can't build pythin-inspector at all, see above?

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

2 participants