Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/data/monorepo.json
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@
"slim-message-bus": "https://github.com/zarusz/SlimMessageBus",
"spectre-console": "https://github.com/spectreconsole/spectre.console",
"springfox": "https://github.com/springfox/springfox",
"stack-exchange-redis-extensions": "https://github.com/imperugo/StackExchange.Redis.Extensions",
"steeltoe": "https://github.com/SteeltoeOSS/steeltoe",
"storybook": "https://github.com/storybookjs/storybook",
"storybook-react-native": "https://github.com/storybookjs/react-native",
Expand Down
32 changes: 31 additions & 1 deletion lib/modules/manager/pep621/extract.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,14 @@ describe('modules/manager/pep621/extract', () => {
);

expect(result?.deps).toEqual([
{
commitMessageTopic: 'Python',
currentValue: '>=3.7',
datasource: 'python-version',
depType: 'requires-python',
packageName: 'python',
versioning: 'pep440',
},
{
packageName: 'blinker',
depName: 'blinker',
Expand Down Expand Up @@ -507,6 +515,14 @@ describe('modules/manager/pep621/extract', () => {
expect(res).toMatchObject({
extractedConstraints: { python: '>=3.11' },
deps: [
{
commitMessageTopic: 'Python',
currentValue: '>=3.11',
datasource: 'python-version',
depType: 'requires-python',
packageName: 'python',
versioning: 'pep440',
},
{
packageName: 'jwcrypto',
depName: 'jwcrypto',
Expand Down Expand Up @@ -567,6 +583,14 @@ describe('modules/manager/pep621/extract', () => {
expect(res).toMatchObject({
extractedConstraints: { python: '>=3.11' },
deps: [
{
commitMessageTopic: 'Python',
currentValue: '>=3.11',
datasource: 'python-version',
depType: 'requires-python',
packageName: 'python',
versioning: 'pep440',
},
{
packageName: 'attrs',
depName: 'attrs',
Expand Down Expand Up @@ -595,6 +619,12 @@ describe('modules/manager/pep621/extract', () => {
expect(res).toMatchObject({
extractedConstraints: { python: '>=3.11' },
deps: [
{
packageName: 'python',
depType: 'requires-python',
datasource: 'python-version',
versioning: 'pep440',
},
{
packageName: 'attrs',
depName: 'attrs',
Expand Down Expand Up @@ -623,7 +653,7 @@ describe('modules/manager/pep621/extract', () => {
readme = "README.md"
`;
const res = await extractPackageFile(content, 'pyproject.toml');
expect(res?.deps).toHaveLength(2);
expect(res?.deps).toHaveLength(3);
});
});
});
21 changes: 18 additions & 3 deletions lib/modules/manager/pep621/extract.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import is from '@sindresorhus/is';
import { logger } from '../../../logger';
import { PythonVersionDatasource } from '../../datasource/python-version';
import * as pep440 from '../../versioning/pep440';
import type {
ExtractConfig,
PackageDependency,
Expand Down Expand Up @@ -29,9 +31,22 @@ export async function extractPackageFile(

const packageFileVersion = def.project?.version;
const pythonConstraint = def.project?.['requires-python'];
const extractedConstraints = is.nonEmptyString(pythonConstraint)
? { extractedConstraints: { python: pythonConstraint } }
: {};
let extractedConstraints;
if (is.nonEmptyString(pythonConstraint)) {
extractedConstraints = {
extractedConstraints: { python: pythonConstraint },
};
deps.push({
packageName: 'python',
depType: 'requires-python',
currentValue: pythonConstraint,
commitMessageTopic: 'Python',
datasource: PythonVersionDatasource.id,
versioning: pep440.id,
});
} else {
extractedConstraints = {};
}

// pyProject standard definitions
deps.push(
Expand Down
4 changes: 3 additions & 1 deletion lib/modules/manager/pep621/processors/pdm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ export class PdmProcessor implements PyProjectProcessor {
registryUrls.push(source.url);
}
for (const dep of deps) {
dep.registryUrls = [...registryUrls];
if (dep.datasource === PypiDatasource.id) {
dep.registryUrls = [...registryUrls];
}
}

return deps;
Expand Down
43 changes: 43 additions & 0 deletions lib/modules/platform/azure/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,21 @@ steps:
inputs:
workingFile: .npmrc

- bash: |
add-apt-repository ppa:git-core/ppa
apt update && apt install git -y
displayName: 'Install latest version of Git'

- bash: |
git config --global user.email 'bot@renovateapp.com'
git config --global user.name 'Renovate Bot'
npx --userconfig .npmrc renovate
env:
RENOVATE_PLATFORM: azure
RENOVATE_ENDPOINT: $(System.CollectionUri)
RENOVATE_CONFIG_FILE: $(Build.SourcesDirectory)/renovate_bot_config.json
RENOVATE_TOKEN: $(System.AccessToken)
LOG_LEVEL: debug
```

### Create a .npmrc file
Expand Down Expand Up @@ -91,6 +98,42 @@ module.exports = {

For the `repositories` key, replace `YOUR-PROJECT/YOUR-REPO` with your Azure DevOps project and repository.

### Using Azure DevOps internal API for pipeline tasks versions

<!-- prettier-ignore -->
!!! info
Renovate now uses the set of APIs that Azure provides to query the azure-pipelines tasks versions directly from the instance. Read [pull request 32966](https://github.com/renovatebot/renovate/pull/32966) and [discussion 24820](https://github.com/renovatebot/renovate/discussions/24820) for more background information on this change.

To let Renovate use the Azure DevOps internal API, you must set these variables in your config:

- `platform` = `azure`
- `endpoint` = `$(System.CollectionUri)`, this is an [Azure predefined variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml)
- `hostRules.hostType` = `azure-pipelines-tasks`

```json title="Example config file in JSON format"
"platform": "azure",
"endpoint": "https://dev.azure.com/ORG_NAME",
"azure-pipelines": {
"enabled": true
},
"repositories": ["PROJECT_NAME/REPO_NAME"],
"prHourlyLimit": 0,
"baseBranches": ["main"],
"hostRules": [
{
"matchHost": "https://dev.azure.com/",
"hostType": "azure-pipelines-tasks"
}
],
"packageRules": [
{
"matchDatasources": ["azure-pipelines-tasks"],
"extractVersion": "^(?<version>\\d+)"
}
]
}
```

### Yarn users

To do a successful `yarn install` you need to match the URL of the registry fully.
Expand Down
Loading