# PyPI Integration

pip resolves packages using the configured index URL. Routing pip through the Lineaje Proxy requires setting PIP\_INDEX\_URL (or pip's --index-url flag) to the Proxy's PyPI endpoint.

**Proxy PyPI URL**

```
// Enforce Mode: block all non-compliant builds  
https://enforce.fortknox.v2.prod.veedna.com/artifactory/api/pypi/gos-all-proxy-python/simple 

// Observe Mode: Report all non-compliant dependency downloads  
https://observe.fortknox.v2.prod.veedna.com/artifactory/api/pypi/gos-all-proxy-python/simple 
```

<details>

<summary>Jenkinsfile Configuration Example</summary>

```groovy
pipeline { 
  agent any 
  environment { 
 ARTIFACTORY_CREDS = credentials(‘<ID>’) 
    ARTIFACTORY_URL = 'https://enforce.fortknox.v2.prod.veedna.com' + 
                      '/artifactory/api/pypi/gos-all-proxy-python/simple' 
  } 
stages { 
        stage('Build') { 
            steps { 
                script { 
                    // Set up the pip index URL with authentication 
                    // We encode the URL to include the credentials safely in the environment 
                    def pipIndexUrl = "https://${ARTIFACTORY_CREDS_USR}:${ARTIFACTORY_CREDS_PSW}@${ARTIFACTORY_URL}" 
                    withEnv(["PIP_INDEX_URL=${pipIndexUrl}"]) { 
                         // Optional: Create a virtual environment 
                        sh 'python3 -m venv venv' 
     // Install dependencies 
     // PIP_INDEX_URL env var is automatically picked up by pip 
                        sh './venv/bin/python -m pip install -vvv --no-cache-dir --index-url "${PIP_INDEX_URL}" --trusted-host enforce.fortknox.v2.prod.veedna.com -r requirements.txt' 
                        // Run the script 
                        sh './venv/bin/python main.py' 
                    } 
                } 
            } 
        } 
    } 
} 
```

</details>

<details>

<summary>pip.conf Alternative (for non-Jenkins environments)</summary>

If configuring pip outside of Jenkins (e.g., Docker image build, local developer machine, GitHub Actions), use pip.conf:

```
# ~/.config/pip/pip.conf  (Linux/macOS) 
# %APPDATA%\pip\pip.ini   (Windows) 
[global] 
index-url = https://<ARTIFACTORY_CREDS_USR>:< ARTIFACTORY_CREDS_PSW >@enforce.fortknox.v2.prod.veedna.com/artifactory/api/pypi/gos-all-proxy-python/simple 
trusted-host = enforce.fortknox.v2.prod.veedna.com 
```

Alternatively, pass the URL directly on the command line:

```
pip install urllib3==2.0.5 \ 
  --index-url https://<USER>:<TOKEN>@enforce.fortknox.v2.prod.veedna.com/ 
              artifactory/api/pypi/gos-all-proxy-python/simple \ 
  -vvv
```

</details>

<details>

<summary>Verifying Proxy Routing</summary>

The -vvv (verbose) flag causes pip to log the full URL of each package fetched. Confirm the Proxy URL appears in the output:

```
# Expected in build log: 
  GET https://enforce.fortknox.v2.prod.veedna.com/artifactory/api/pypi/ 
      gos-all-proxy-python/packages/.../urllib3-2.0.5-py3-none-any.whl 
  200 OK 
```

To detect policy violations, search build logs for the string. To learn more, see Detecting Policy Violations in Build Logs.

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.veedna.com/gold-open-source-gos/gold-catalog/oss-packages/integrating-lineaje-gos-artifactory-proxy-into-your-ci-cd-pipeline/pypi-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
