diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 53232f4c4b453f8f0f676e870adae2a6d9686b8e..3f725b46e113e84fefb11209f701ecf488182a58 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -2832,7 +2832,7 @@ Defaults to `true`. ## python -Currently the only Python package manager is `pip` - specifically for `requirements.txt` and `requirements.pip` files - so adding any config to this `python` object is essentially the same as adding it to the `pip_requirements` object instead. +Currently the only Python package manager is `pip` - specifically for `requirements.txt` and `requirements.pip` files, or any file that matches the pattern `requirements-*.(txt|pip)` - so adding any config to this `python` object is essentially the same as adding it to the `pip_requirements` object instead. ## rangeStrategy diff --git a/docs/usage/python.md b/docs/usage/python.md index 2bc96d3b854aa68049261a067846d3d6e76052cd..5c26884db95e8cad0072c0172e64726b8c420a9d 100644 --- a/docs/usage/python.md +++ b/docs/usage/python.md @@ -26,6 +26,9 @@ Legacy versions with the `===` prefix are ignored. ## Alternative file names For the `pip_requirements` manager, the default file matching regex for `requirements.txt` follows common file name conventions. + +It will match `requirements.txt` and `requirements.pip`, and any file in the format `requirements-*.txt` or `requirements-*.pip`, to allow for common filename patterns such as `requirements-dev.txt`. + But Renovate may not find all your files. You can tell Renovate where to find your file(s) by setting your own `fileMatch` regex: diff --git a/lib/modules/manager/pip_requirements/index.ts b/lib/modules/manager/pip_requirements/index.ts index 4fe319227f5bc21457824104b8b4be06c608af51..6140bdd15f788dc16d8d90befeecae9f781d8fd0 100644 --- a/lib/modules/manager/pip_requirements/index.ts +++ b/lib/modules/manager/pip_requirements/index.ts @@ -8,7 +8,7 @@ export { extractPackageFile } from './extract'; export const language: ProgrammingLanguage = 'python'; export const defaultConfig = { - fileMatch: ['(^|/)([\\w-]*)requirements\\.(txt|pip)$'], + fileMatch: ['(^|/)[\\w-]*requirements(-\\w+)?\\.(txt|pip)$'], }; export const supportedDatasources = [PypiDatasource.id, GitTagsDatasource.id]; diff --git a/lib/modules/manager/pip_requirements/readme.md b/lib/modules/manager/pip_requirements/readme.md index 33bf37c8045cdbac13adb3e4ab3d648de62aa020..5c89d80660809a5c0a98aacded5f1b73bca6ebbf 100644 --- a/lib/modules/manager/pip_requirements/readme.md +++ b/lib/modules/manager/pip_requirements/readme.md @@ -1 +1 @@ -Supports `requirements.txt` and `requirements.pip` files. The default file pattern is fairly flexible in an attempt to catch similarly named ones too but may be extended/changed. +Supports `requirements.txt` and `requirements.pip` files. The default file pattern is fairly flexible in an attempt to catch similarly named ones too (eg `requirements-*.txt` and `requirements-*.pip`) but may be extended/changed.