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

Package writes to "apiclient" directory when installed #2485

Open
kruton opened this issue Sep 18, 2024 · 2 comments · May be fixed by #2486
Open

Package writes to "apiclient" directory when installed #2485

kruton opened this issue Sep 18, 2024 · 2 comments · May be fixed by #2486
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@kruton
Copy link

kruton commented Sep 18, 2024

Environment details

  • OS type and version: Linux
  • Python version: 3.12.5
  • pip version: 24.2
  • google-api-python-client version: 2.145.0

Steps to reproduce

  1. python -m virtualenv venv
  2. . venv/bin/activate
  3. pip install api-client
  4. python -c 'from apiclient import HeaderAuthentication'
  5. pip install firebase-admin
  6. python -c 'from apiclient import HeaderAuthentication'

I expect step 6 to be the same as step 4 here, but it results in a stack trace since firebase-admin depends on google-api-python-client which is overwriting .../site-packages/apiclient/. What's even worse is that some package managers (e.g., poetry) seem to install this in a random order resulting in it sometimes working and sometimes not.

Code example

from apiclient import HeaderAuthentication

Stack trace

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name 'HeaderAuthentication' from 'apiclient' (/private/tmp/test1/venv/lib/python3.11/site-packages/apiclient/__init__.py)
@kruton kruton linked a pull request Sep 18, 2024 that will close this issue
4 tasks
@ohmayr ohmayr added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Sep 20, 2024
@ohmayr
Copy link
Contributor

ohmayr commented Sep 20, 2024

Thanks for reporting this @kruton. We'll take a look into this.

@kruton
Copy link
Author

kruton commented Dec 6, 2024

I rebased the pull request #2486 onto the newest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants