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

Tox ArtifactRegistry Authentication broken #15

Closed
untimtam opened this issue Jun 8, 2021 · 8 comments · Fixed by #16
Closed

Tox ArtifactRegistry Authentication broken #15

untimtam opened this issue Jun 8, 2021 · 8 comments · Fixed by #16

Comments

@untimtam
Copy link

untimtam commented Jun 8, 2021

It doesn't seem like Tox actually uses the keyring properly, because it's waiting for a username/password, but I'm not sure if/where I've gone wrong in my configuration.

System python version: 3.9.5
Venv version: 3.7.10

Sample Tox.ini

[tox]
isolated_build = True
envlist = py
requires = keyrings.google-artifactregistry-auth

[testenv]
basepython = python3.7
skip_install = true
setenv =
    PIP_EXTRA_INDEX_URL = https://us-python.pkg.dev/magna-gate-1/akasha-pypi/simple
deps =
    akasha-structs
commands =

Terminal output:

tox -v
using tox.ini: /Users/tflichy/Repositories/akasha/shovel/tox.ini (pid 77844)
using tox-3.23.1 from /Users/tflichy/.local/pipx/venvs/tox/lib/python3.9/site-packages/tox/__init__.py (pid 77844)
py cannot reuse: no previous config /Users/tflichy/Repositories/akasha/shovel/.tox/py/.tox-config1
py create: /Users/tflichy/Repositories/akasha/shovel/.tox/py
[77862] /Users/tflichy/Repositories/akasha/shovel/.tox$ /Users/tflichy/.local/pipx/venvs/tox/bin/python -m virtualenv --no-download --python /Users/tflichy/.pyenv/versions/3.7.10/bin/python3.7 py >py/log/py-0.log
[77863] /Users/tflichy/Repositories/akasha/shovel$ /Users/tflichy/Repositories/akasha/shovel/.tox/py/bin/python -m pip install keyrings.google-artifactregistry-auth >.tox/py/log/py-1.log
^CERROR: got KeyboardInterrupt signal

Log output:

action: py, msg: getenv
cwd: /Users/tflichy/Repositories/akasha/shovel
cmd: /Users/tflichy/Repositories/akasha/shovel/.tox/py/bin/python -m pip install keyrings.google-artifactregistry-auth
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/magna-gate-1/akasha-pypi/simple
User for us-python.pkg.dev: %
@di
Copy link
Member

di commented Jun 8, 2021

Here's the configuration I'd recommend instead:

tox.ini:

[tox]
isolated_build = True
envlist = py
requires = keyrings.google-artifactregistry-auth

[testenv]
basepython = python3.7
skip_install = true
deps =
    -r requirements.txt
commands =

requirements.txt:

--extra-index-url https://us-python.pkg.dev/magna-gate-1/akasha-pypi/simple
akasha-structs

If that works for you, let me know here and I'll update the docs accordingly.

@untimtam
Copy link
Author

untimtam commented Jun 8, 2021

This works!

@di
Copy link
Member

di commented Jun 8, 2021

Great, #16 should resolve it. Thanks for the report!

@untimtam
Copy link
Author

untimtam commented Jun 8, 2021

This is not the right place to ask, but do you know if/when poetry support will come through?

@di
Copy link
Member

di commented Jun 8, 2021

@hellowor1dn I created #17 to track that.

@untimtam
Copy link
Author

untimtam commented Jun 8, 2021

Thanks again!

@untimtam untimtam closed this as completed Jun 8, 2021
@yateya
Copy link

yateya commented Oct 11, 2021

@di Thanks for work around.
Could you please also update the documentation at https://pypi.org/project/keyrings.google-artifactregistry-auth/ , because it still list the old way.

@red8888
Copy link

red8888 commented Jan 2, 2025

@di how do you do this with project.toml? I have no requirements.txt file. I tried setting the install_command but this fails with the above problem (its waiting for user creds to be entered)

install_command = pip install . --verbose --extra-index-url=https://us-python.pkg.dev/xxxxx/xxx-py-wheels/simple

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

Successfully merging a pull request may close this issue.

4 participants