Skip to content

Commit

Permalink
fix: convert python package name key value to lowercase, upgrade Exho…
Browse files Browse the repository at this point in the history
…rt Javascript API version (#221)

Signed-off-by: Ilona Shishov <[email protected]>
  • Loading branch information
IlonaShishov authored Nov 1, 2023
1 parent 30baf01 commit 23d8d40
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"dist"
],
"dependencies": {
"@RHEcosystemAppEng/exhort-javascript-api": "^0.0.2-ea.45",
"@RHEcosystemAppEng/exhort-javascript-api": "^0.0.2-ea.46",
"@xml-tools/ast": "^5.0.5",
"@xml-tools/parser": "^1.0.11",
"json-to-ast": "^2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Config
this.utmSource = process.env.VSCEXT_UTM_SOURCE || '';
this.exhortDevMode = process.env.VSCEXT_EXHORT_DEV_MODE || 'false';
this.exhortSnykToken = process.env.VSCEXT_EXHORT_SNYK_TOKEN || '';
this.matchManifestVersions = process.env.VSCEXT_MATCH_MANIFEST_VERSIONS;
this.matchManifestVersions = process.env.VSCEXT_MATCH_MANIFEST_VERSIONS || 'true';
this.exhortMvnPath = process.env.VSCEXT_EXHORT_MVN_PATH || 'mvn';
this.exhortNpmPath = process.env.VSCEXT_EXHORT_NPM_PATH || 'npm';
this.exhortGoPath = process.env.VSCEXT_EXHORT_GO_PATH || 'go';
Expand Down
2 changes: 1 addition & 1 deletion src/providers/requirements.txt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class NaivePyParser {
// skip empty lines
if (pkgName.length > 0) {
const version = (parsedRequirement[1] || '').trim();
const entry: IKeyValueEntry = new KeyValueEntry(pkgName, { line: 0, column: 0 });
const entry: IKeyValueEntry = new KeyValueEntry(pkgName.toLowerCase(), { line: 0, column: 0 });
entry.value = new Variant(ValueType.String, version);
entry.valuePosition = { line: index + 1, column: req.indexOf(version) + 1 };
dependencies.push(new Dependency(entry));
Expand Down
2 changes: 1 addition & 1 deletion test/providers/requirements.txt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('PyPi requirements.txt parser test', () => {

it('tests valid requirements.txt', async () => {
const deps = await collector.collect(`a==1
b==2.1.1
B==2.1.1
c>=10.1
d<=20.1.2.3.4.5.6.7.8
`);
Expand Down

0 comments on commit 23d8d40

Please sign in to comment.