You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let me first describe my issue. I have one or more packages that come from a private PyPi repo. This repo is described in my pip config file with install.extra-index-url. (I know there are security issues now associated with this approach, we'll ignore those for now). I do not wish to embed the password information for the private repo in this URL, therefore, I am using the keyring package to store the credential in the system credential manager. This works without a hitch in my normal operations, as I can do
pip install my-private-package
with no issue.
However, when it comes to setting up a tox environment with this package, this workflow fails due to the fact that keyring is not part of the virtualenv seed package set. Unfortunately I can't simply do
because these packages appear to all get installed with a single pip command, so pip cannot make use of keyring to install the later package.
Neither does it seem to help to include keyring in tox.requires, because that places limitations on the base environment that tox runs out of, not the virtualenv starting packages. (I already have keyring satisfied in the base environment).
My current workaround for this is to add PIP_FIND_LINKS to testenv.passenv and call tox with
There are a few ways I could see solving this from within tox. The first would be to use a custom virtualenv with keyring as an included seed package. I have not looked into this yet due to the relative difficulty of building and integrating such a package.
Another solution that appeals to me would be to add a commands_pre_install section to the environment definition. These commands would run after the virtualenv is created but before the deps and artifact under test are installed.
For example, for my use case
Such a command could also be used for upgrading the virtualenv seed packages if desired before the main install. If necessary, one could just skip the deps section entirely and completely customize the virtualenv setup process using these commands. This would alleviate issues caused by e.g. the deprecation of the indexserver option.
I should clarify this is not the same as command_pre. This setup does not work either.
However, when it comes to setting up a tox environment with this package, this workflow fails due to the fact that keyring is not part of the virtualenv seed package set.
Let me first describe my issue. I have one or more packages that come from a private PyPi repo. This repo is described in my pip config file with install.extra-index-url. (I know there are security issues now associated with this approach, we'll ignore those for now). I do not wish to embed the password information for the private repo in this URL, therefore, I am using the keyring package to store the credential in the system credential manager. This works without a hitch in my normal operations, as I can do
with no issue.
However, when it comes to setting up a tox environment with this package, this workflow fails due to the fact that keyring is not part of the virtualenv seed package set. Unfortunately I can't simply do
because these packages appear to all get installed with a single pip command, so pip cannot make use of keyring to install the later package.
Neither does it seem to help to include keyring in tox.requires, because that places limitations on the base environment that tox runs out of, not the virtualenv starting packages. (I already have keyring satisfied in the base environment).
My current workaround for this is to add PIP_FIND_LINKS to testenv.passenv and call tox with
There are a few ways I could see solving this from within tox. The first would be to use a custom virtualenv with keyring as an included seed package. I have not looked into this yet due to the relative difficulty of building and integrating such a package.
Another solution that appeals to me would be to add a commands_pre_install section to the environment definition. These commands would run after the virtualenv is created but before the deps and artifact under test are installed.
For example, for my use case
Such a command could also be used for upgrading the virtualenv seed packages if desired before the main install. If necessary, one could just skip the deps section entirely and completely customize the virtualenv setup process using these commands. This would alleviate issues caused by e.g. the deprecation of the indexserver option.
I should clarify this is not the same as command_pre. This setup does not work either.
It seems a similar solution was proposed in #715 as well.
The text was updated successfully, but these errors were encountered: