Skip to content

Commit

Permalink
fix(pypi): skip compatibility check if not a version
Browse files Browse the repository at this point in the history
Closes #6142
  • Loading branch information
rarkins committed May 6, 2020
1 parent e531a93 commit 3f14af3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/datasource/pypi/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { parse } from 'node-html-parser';
import { logger } from '../../logger';
import { Http } from '../../util/http';
import { matches } from '../../versioning/pep440';
import * as pep440 from '../../versioning/pep440';
import { GetReleasesConfig, ReleaseResult } from '../common';

export const id = 'pypi';
Expand All @@ -19,7 +20,7 @@ function compatibleVersions(
compatibility: Record<string, string>
): string[] {
const versions = Object.keys(releases);
if (!(compatibility && compatibility.python)) {
if (!(compatibility?.python && pep440.isVersion(compatibility.python))) {
return versions;
}
return versions.filter((version) =>
Expand Down
2 changes: 1 addition & 1 deletion lib/versioning/pep440/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const isSingleVersion = (constraint: string): string =>
isVersion(constraint) ||
(constraint.startsWith('==') && isVersion(constraint.substring(2).trim()));

export { matches };
export { isVersion, matches };

export const api: VersioningApi = {
equals,
Expand Down

0 comments on commit 3f14af3

Please sign in to comment.