Skip to content

Commit

Permalink
fix(manager/poetry): use containerbase python as datasource (#24463)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeshuaro committed Sep 17, 2023
1 parent 34f0ce3 commit ce75693
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
6 changes: 4 additions & 2 deletions lib/modules/manager/poetry/__snapshots__/extract.spec.ts.snap
Expand Up @@ -474,12 +474,13 @@ exports[`modules/manager/poetry/extract extractPackageFile() extracts multiple d
{
"commitMessageTopic": "Python",
"currentValue": "~2.7 || ^3.4",
"datasource": "docker",
"datasource": "github-releases",
"depName": "python",
"depType": "dependencies",
"managerData": {
"nestedVersion": false,
},
"packageName": "containerbase/python-prebuild",
"registryUrls": null,
"versioning": "poetry",
},
Expand Down Expand Up @@ -569,12 +570,13 @@ exports[`modules/manager/poetry/extract extractPackageFile() resolves lockedVers
{
"commitMessageTopic": "Python",
"currentValue": "^3.9",
"datasource": "docker",
"datasource": "github-releases",
"depName": "python",
"depType": "dependencies",
"managerData": {
"nestedVersion": false,
},
"packageName": "containerbase/python-prebuild",
"registryUrls": null,
"versioning": "poetry",
},
Expand Down
5 changes: 3 additions & 2 deletions lib/modules/manager/poetry/extract.spec.ts
@@ -1,7 +1,7 @@
import { codeBlock } from 'common-tags';
import { Fixtures } from '../../../../test/fixtures';
import { fs } from '../../../../test/util';
import { DockerDatasource } from '../../datasource/docker';
import { GithubReleasesDatasource } from '../../datasource/github-releases';
import { GithubTagsDatasource } from '../../datasource/github-tags';
import { extractPackageFile } from '.';

Expand Down Expand Up @@ -298,8 +298,9 @@ describe('modules/manager/poetry/extract', () => {
expect(res).toHaveLength(1);
expect(res[0]).toMatchObject({
depName: 'python',
packageName: 'containerbase/python-prebuild',
currentValue: '^3.11',
datasource: DockerDatasource.id,
datasource: GithubReleasesDatasource.id,
commitMessageTopic: 'Python',
registryUrls: null,
});
Expand Down
7 changes: 5 additions & 2 deletions lib/modules/manager/poetry/extract.ts
Expand Up @@ -7,7 +7,7 @@ import {
readLocalFile,
} from '../../../util/fs';
import { Result } from '../../../util/result';
import { DockerDatasource } from '../../datasource/docker';
import { GithubReleasesDatasource } from '../../datasource/github-releases';
import type { PackageFileContent } from '../types';
import { Lockfile, PoetrySchemaToml } from './schema';

Expand Down Expand Up @@ -40,7 +40,10 @@ export async function extractPackageFile(
}
return {
...dep,
datasource: DockerDatasource.id,
// We use containerbase python as source, as there are a lot docker tags which can cause
// issues with poetry versioning.
packageName: 'containerbase/python-prebuild',
datasource: GithubReleasesDatasource.id,
commitMessageTopic: 'Python',
registryUrls: null,
};
Expand Down
4 changes: 2 additions & 2 deletions lib/modules/manager/poetry/index.ts
@@ -1,5 +1,5 @@
import type { Category } from '../../../constants';
import { DockerDatasource } from '../../datasource/docker';
import { GithubReleasesDatasource } from '../../datasource/github-releases';
import { GithubTagsDatasource } from '../../datasource/github-tags';
import { PypiDatasource } from '../../datasource/pypi';

Expand All @@ -10,7 +10,7 @@ export { updateLockedDependency } from './update-locked';
export const supportedDatasources = [
PypiDatasource.id,
GithubTagsDatasource.id,
DockerDatasource.id,
GithubReleasesDatasource.id,
];

export const supportsLockFileMaintenance = true;
Expand Down

0 comments on commit ce75693

Please sign in to comment.