I have a python package I want to test and build using Jenkins and tox. However, it depends on a package in our private artifactory. Although poetry picks up on it correctly, the moment tox kicks in (and uses pip over poetry to install dependencies), it can't find the package.
My poetry lock file has
reference = "snakepit"
type = "legacy"
url = "https://our private artifactory
My Jenkinsfile sets up POETRY_HTTP_BASIC_PYPI_USERNAME
and POETRY_HTTP_BASIC_PYPI_PASSWORD
which allows poetry to install without the url in the lock file having my credentials.
After some searching it seemed like I needed to extend legacy_tox_ini in the pyproject.toml. This now looks like:
legacy_tox_ini = """
[tox]
isolated_build = true
envlist = py36,py37,py38
indexserver =
default = https://pypi.python.org/simple
ourartifactory = https://{env:POETRY_HTTP_BASIC_PYPI_USERNAME}:{env:POETRY_HTTP_BASIC_PYPI_PASSWORD}@our artifactory url
[testenv]
deps =
pytest
pytest-cov
setenv =
SOME_ENV={env:SOME_ENV}
commands =
pytest tests
I also tested adding :ourartifactory:problempackage to deps here, but it doesn't help either.
How can I make pip recognize the private artifactory in this setting?