Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split on == and ~= for requirements.txt #185

Merged
merged 2 commits into from
Feb 12, 2021
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
14 changes: 7 additions & 7 deletions ext-src/models/IqComponentModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ export class IqComponentModel implements ComponentModel {
constructor(
options: ComponentModelOptions
) {
this.applicationPublicId = options.configuration.get(NEXUS_IQ_PUBLIC_APPLICATION_ID) + "";
// remove trailing slash if it exists
this.url = String(options.configuration.get(NEXUS_IQ_SERVER_URL)).replace(/\/$/, "");
const username = options.configuration.get(NEXUS_IQ_USERNAME) + "";
this.applicationPublicId = options.configuration.get(NEXUS_IQ_PUBLIC_APPLICATION_ID) as string;
this.url = options.configuration.get(NEXUS_IQ_SERVER_URL) as string;
const username = options.configuration.get(NEXUS_IQ_USERNAME) as string;
// this one is converted rather than cast as string
const maximumEvaluationPollAttempts = parseInt(
options.configuration.get(NEXUS_IQ_MAX_EVAL_POLL_ATTEMPTS) + "", 10);
const password = options.configuration.get(NEXUS_IQ_USER_PASSWORD) + "";
String(options.configuration.get(NEXUS_IQ_MAX_EVAL_POLL_ATTEMPTS)), 10);
const password = options.configuration.get(NEXUS_IQ_USER_PASSWORD) as string;
const strictSSL = options.configuration.get(NEXUS_IQ_STRICT_SSL) as boolean;

this.requestService = new IqRequestService(this.url, username, password, maximumEvaluationPollAttempts, strictSSL, options.logger);
Expand Down Expand Up @@ -181,7 +181,7 @@ export class IqComponentModel implements ComponentModel {
resolve();
}).then(() => {
if (!this.reportUrl.startsWith(this.url)) {
this.reportUrl = `${this.url}/${this.reportUrl}`;
this.reportUrl = new URL(this.reportUrl, this.url).href
}

window.showInformationMessage(`Nexus IQ Server Results in, build with confidence!\n Report available at: ${this.reportUrl}`);
Expand Down
2 changes: 1 addition & 1 deletion ext-src/packages/pypi/PyPiUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class PyPiUtils {
console.debug("Found comment, skipping");
} else {
// remove any conditionals after semicolon, split result to get package and version
const dependencyParts: string[] = dep.split(";")[0].trim().split("==");
const dependencyParts: string[] = dep.split(";")[0].trim().split(/==|~=/);
if (!dependencyParts || dependencyParts.length != 2) {
// Short circuit, we couldn't split, move on to next one
return;
Expand Down