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

keyring version requirements on pywin32-ctypes cause install failure #612

Closed
andy-maier opened this issue Dec 11, 2022 · 2 comments
Closed

Comments

@andy-maier
Copy link
Contributor

andy-maier commented Dec 11, 2022

Describe the bug

With the new dependency resolver, pip sometimes gets into the mode of trying multiple versions of packages before choosing one. We now have the situation where pip gets into this mode and tries version 0.1.2 of pywin32-ctypes. This version fails to install together with setuptools>=58.0.0 because pywin32-ctypes uses "use_2to3" and setuptools removed that support in its version 58.0.0. Version 0.2.0 of pywin32-ctypes (which is the latest version) has solved this issue by no longer using "use_2to3". So when pip just installs the latest version of pywin32-ctypes, it works, but when it decides to go hunting around for the right version, it fails when trying version 0.1.2.

What does that have to do with keyring? keyring specifies a requirement of pywin32-ctypes!=0.1.0,!=0.1.1; sys_platform=="win32", which permits 0.1.2 to be installed and thus permits the error to happen when pip gets into this mode.

For us, this fails in Github Actions on "windows-latest" with Python 3.8, 3.9, 3.10 (we do not test 3.11 yet), with:

INFO: pip is looking at multiple versions of pywin32-ctypes to determine which version is compatible with other requirements. This could take a while.
Collecting pywin32-ctypes!=0.1.0,!=0.1.1
  Downloading pywin32-ctypes-0.1.2.tar.gz (24 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
  error: subprocess-exited-with-error
  
  python setup.py egg_info did not run successfully.
  exit code: 1
  
  [1 lines of output]
  error in pywin32-ctypes setup command: use_2to3 is invalid.
  [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

Encountered error while generating package metadata.

See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

This was from today's test run on Python 3.8: https://github.com/zhmcclient/python-zhmcclient/actions/runs/3666135441/jobs/6197669174

I did not analyze why it started failing just this week. The week before, the same test run succeeded on Python 3.8:

Collecting pywin32-ctypes!=0.1.0,!=0.1.1
  Downloading pywin32_ctypes-0.2.0-py2.py3-none-any.whl (28 kB)

Test run: https://github.com/zhmcclient/python-zhmcclient/actions/runs/3610424073/jobs/6084221588

To Reproduce

Steps to reproduce the behavior:

  1. Set up a virtual Python environment on Windows with Python 3.8, 3.9 or 3.10 (we do not test 3.11 yet)
  2. Clone https://github.com/zhmcclient/python-zhmcclient/
  3. In the repo directory, execute make develop

Expected behavior

keyring and its pywin32-ctypes package should install successfully on Windows with Python 3.8, 3.9, 3.10.

This can be achieved by having keyring exclude pywin32-ctypes 0.1.2 in its dependencies. Since you probably don't want to use its initial version 0.0.1 from 2014, this boils down to pywin32-ctypes>=0.2.0, i.e. in setup.cfg:

install_requires =
	pywin32-ctypes>=0.2.0; sys_platform=="win32"
        . . .

Environment

  • OS: Windows ("windows-latest" on GitHub Actions)
  • Python: 3.8, 3.9, 3.10
  • keyring does not get installed when the error happens, because its dependent pywin32-ctypes fails installing

Additional context

None

@andy-maier
Copy link
Contributor Author

I created PR #613 with a fix.

@andy-maier
Copy link
Contributor Author

I think we can circumvent the issue by requiring pywin32-ctypes>=0.2.0 in our own dependencies.

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