Pipfile with different indexes for each environement

Viewed 32

I encounter a small problem with my Python/Django and pipenv projects, in particular for the management of package indexes according to the environment.

Indeed on my local machine I cannot install packages from https://pypi.org/simple I have to use an artifactory specific to my company. Locally I therefore install all my packages from this index, the Pipfile.lock is also generated according to this index.

The problem is that on my dev or production environment, the artifactory index no longer works (because no longer on the company network) and I therefore have to use Pypi. So I can't manage to use only artifactory locally and only Pypi in the dev/production environment.

This is what my local Pipfile looks like not working on dev/production.

   [[source]]
    url = "https://artifactory-xxxxx/artifactory/api/pypi/remote-pypi/simple"
    verify_ssl = true
    name = "artifactory-xxxxxxx"
    
    [packages]
    wagtail = ">=3.0.1"
    django = "<4.1,>=4.0"
    django-tailwind = "*"
    wagtailmedia = "*"
    wagtailcodeblock = "*"
    wagtailfontawesome = "*"
    mozilla-django-oidc = "*"
    psycopg2-binary = "*"
    gunicorn = "*"
    
    [dev-packages]
    psycopg2 = {version = "*", index = "artifactory-xxxx"}
    
    [requires]
    python_version = "3.9"
0 Answers
Related