https://github.com/theredfoxlee/pdm-pip-index-url
A pdm plugin that automatically converts PIP_*INDEX_URL to PDM_PYPI_* envs.
https://github.com/theredfoxlee/pdm-pip-index-url
pdm pip plugin python
Last synced: about 2 months ago
JSON representation
A pdm plugin that automatically converts PIP_*INDEX_URL to PDM_PYPI_* envs.
- Host: GitHub
- URL: https://github.com/theredfoxlee/pdm-pip-index-url
- Owner: theredfoxlee
- Created: 2023-06-03T05:31:23.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-18T13:28:57.000Z (about 2 years ago)
- Last Synced: 2024-11-17T00:33:36.097Z (8 months ago)
- Topics: pdm, pip, plugin, python
- Language: Python
- Homepage: https://pypi.org/project/pdm-pip-index-url
- Size: 81.1 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-pdm - pdm-pip-index-url - A PDM plugin that automatically converts `PIP_*INDEX_URL` to `PDM_PYPI_*` envs (Plugins)
README
# pdm-pip-index-url
[](https://github.com/theredfoxlee/pdm-pip-index-url/actions/workflows/ci.yaml)
[](https://pypi.org/project/pdm-pip-index-url/)
[](./pyproject.toml)
[](https://pypistats.org/packages/pdm-pip-index-url)
`pdm-pip-index-url` is a pdm plugin that automatically converts `PIP_*INDEX_URL` to `PDM_PYPI_*` envs.
For each pdm sub-command invocation, pdm will search for `PIP_*INDEX_URL` environment variables to convert them to coressponding `PDM_PYPI_*` values (see `process_pip_envs` in [./plugin.py](./pdm_pip_index_url/plugin.py) for detailed logic description).
## Usage
1. Install plugin: `pdm self add pdm-pip-index-url`
### Logging
Turn on logging by adding `-v` to executed command, e.g.: `pdm add -v black`.
### Example [Use Case]
Consider a scenario where you are using PDM in an environment that does not provide a way to authenticate it to a private PyPI server but supports pip authentication (e.g., Azure Pipelines). Here is an example:
```yaml
# 1. Set PIP_INDEX_URL for .
- task: PipAuthenticate@1
inputs:
artifactFeeds:
# 2. Install pdm.
- script: pip install pdm==2.7.4
# 3. Install this plugin.
- script: pdm self add pdm-pip-index-url==0.1.1
# 4. Use PIP_INDEX_URL env to install from .
- script: pdm add
```