diff --git a/docs/usage/getting-started/private-packages.md b/docs/usage/getting-started/private-packages.md index b4997da2fd146f2b3350840632a0d2b48c013eed..61343ad5f8be90467ca559984465040758243839 100644 --- a/docs/usage/getting-started/private-packages.md +++ b/docs/usage/getting-started/private-packages.md @@ -391,6 +391,25 @@ hostRules: [ ]; ``` +### pip + +If a `requirements.txt` file has a index-url then Renovate follows that link, instead of following any link set in the `registryUrls` array. +To override the URL found in `requirements.txt`, you must create a custom `packageRules` setting. +This is because `packageRules` are applied _after_ package file extraction. + +For example: + +```json +{ + "packageRules": [ + { + "matchManagers": ["pip_requirements"], + "registryUrls": ["https://docker.mycompany.domain"] + } + ] +} +``` + ### poetry For every Poetry source, a `hostRules` search is done and then any found credentials are added to env like `POETRY_HTTP_BASIC_X_USERNAME` and `POETRY_HTTP_BASIC_X_PASSWORD`, where `X` represents the normalized name of the source in `pyproject.toml`. diff --git a/docs/usage/python.md b/docs/usage/python.md index 220a25787883738678498797662e395042638912..b8ec7532911c2af0fd552de29d30e19933a5bec9 100644 --- a/docs/usage/python.md +++ b/docs/usage/python.md @@ -15,22 +15,25 @@ Renovate supports the following Python package managers: ## Versioning support -The [PEP440](https://www.python.org/dev/peps/pep-0440/) versioning scheme has been rewritten for JavaScript for the purposes of use in this project is published as [@renovatebot/pep440](https://github.com/renovatebot/pep440). -It supports both pinned versions as well as ranges. -Legacy versions (`===` prefix) are ignored. +We've written a JavaScript version of the [PEP440 specification](https://www.python.org/dev/peps/pep-0440/) so we can use it in Renovate bot. +You can find this project in our [`renovatebot/pep440` repository](https://github.com/renovatebot/pep440). + +Our PEP440 implementation supports pinned versions and ranges. +Legacy versions with the `===` prefix are ignored. ## How it works 1. Renovate searches through each repository for package files 1. Existing dependencies are extracted from the package files -1. Renovate looks up the latest version on [PyPI](https://pypi.org/) to determine if any upgrades are available -1. If the source package includes a GitHub URL as its source, and has a "changelog" file or uses GitHub releases, a Release Note will be embedded in the generated PR +1. Renovate searches for the latest version on [PyPI](https://pypi.org/) to decide if there are upgrades +1. If the source package includes a GitHub URL as its source, and has a "changelog" file _or_ uses GitHub releases, a Release Note will be embedded in the generated PR ## Alternative file names -The default file matching regex for `requirements.txt` aims to pick up the most popular conventions for file naming, but it's possible that some get missed. -If you have a specific file or file pattern you want the Renovate bot to find, use the `fileMatch` field in the `pip_requirements` object. -e.g.: +For the `pip_requirements` manager, the default file matching regex for `requirements.txt` follows common file name conventions. +But Renovate may not find all your files. + +You can tell Renovate where to find your file(s) by setting your own `fileMatch` regex: ```json { @@ -42,13 +45,18 @@ e.g.: ## Alternate registries -By default Renovate performs all lookups on pypi.org, but you can configure alternative index URLs. -There are two ways to do this: +By default Renovate checks for upgrades on the `pypi.org` registry. + +If you want, you can set alternative index URLs. +There are three ways to do this: + +- index-url in `requirements.txt` +- sources in `Pipfile` +- set URL in Renovate configuration ### index-url in `requirements.txt` -The index URL can be specified in the first line of the file. -For example: +You can set the index URL in the first line of the `requirements.txt`, for example: ``` --index-url http://example.com/private-pypi/ @@ -58,7 +66,7 @@ some-other-package==1.0.0 ### Sources in `Pipfile` -Renovate detects any custom-configured sources in `Pipfile` and uses them. +Renovate finds and uses any custom sources in your `Pipfile`. ### Sources in `pyproject.toml` @@ -66,8 +74,8 @@ Renovate detects any custom-configured sources in `pyproject.toml` and uses them ### Specify URL in configuration -You can use the `registryUrls` array to configure alternate index URL(s). -e.g.: +Create a `python` object and put a `registryUrls` array in it. +Fill the array with alternate index URL(s). ```json { @@ -79,12 +87,15 @@ e.g.: <!-- prettier-ignore --> !!! tip - The index-url found in the `requirements.txt` file takes precedence over a `registryUrl` configured like the above. - To override the URL found in `requirements.txt`, you need to configure it in `packageRules`, as they are applied _after_ package file extraction. + If a `requirements.txt` file has a index-url then Renovate follows that link, instead of following any link set in the `registryUrls` array. + To override the URL found in `requirements.txt`, you must create a custom `packageRules` setting. + This is because `packageRules` are applied _after_ package file extraction. + OPTION 1: Create new secion in private packages docs, and add this link: Go to the [private package support docs](https://docs.renovatebot.com/getting-started/private-packages/#pip). + OPTION 2: Link to [specify URL in Python docs](https://docs.renovatebot.com/python/#specify-url-in-configuration) ## Disabling Python support -The most direct way to disable all Python support in Renovate is like this: +To disable all managers with `language` set to `python` in Renovate, do this: ```json { @@ -94,8 +105,8 @@ The most direct way to disable all Python support in Renovate is like this: } ``` -Alternatively, maybe you only want one package manager, such as `npm`. -In that case this would enable _only_ `npm`: +Alternatively, you can use `enabledManagers` to tell Renovate what package managers it can use. +For example, if you only want to use Renovate's `npm` package manager: ```json {