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

Add 'aqtsource' option that allows overriding where the action sources aqtinstall from #234

Merged
merged 2 commits into from
May 19, 2024
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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,12 @@ If you set either `no-qt-binaries` or `tools-only` to `true`, you will skip inst

Default: `false`

### `aqtsource`

The full specifier for a version of [aqtinstall](https://github.com/miurahr/aqtinstall) as passed to pip. For example: `git+https://github.com/miurahr/aqtinstall.git`. This is intended to be used to troubleshoot any bugs that might be caused or fixed by certain versions of aqtinstall. Note that when this is used, the value of `aqtversion` is ignored.

By default this is unset and ignored.

### `aqtversion`

Version of [aqtinstall](https://github.com/miurahr/aqtinstall) to use, given in the format used by pip, for example: `==0.7.1`, `>=0.7.1`, `==0.7.*`. This is intended to be used to troubleshoot any bugs that might be caused or fixed by certain versions of aqtinstall.
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ inputs:
tools-only:
description: Synonym for `no-qt-binaries`, used for backwards compatibility.
default: false
aqtsource:
description: Location to source aqtinstall from in case of issues
aqtversion:
description: Version of aqtinstall to use in case of issues
default: ==3.1.*
Expand Down Expand Up @@ -105,6 +107,7 @@ runs:
set-env: ${{ inputs.set-env }}
no-qt-binaries: ${{ inputs.no-qt-binaries }}
tools-only: ${{ inputs.tools-only }}
aqtsource: ${{ inputs.aqtsource }}
aqtversion: ${{ inputs.aqtversion }}
py7zrversion: ${{ inputs.py7zrversion }}
source: ${{ inputs.source }}
Expand Down
2 changes: 1 addition & 1 deletion action/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module.exports = {
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-invalid-this": "error",
"@typescript-eslint/no-loop-func": "error",
"@typescript-eslint/no-magic-numbers": ["error", { ignoreArrayIndexes: true }],
"@typescript-eslint/no-magic-numbers": ["error", { ignoreArrayIndexes: true, ignore: [0, 1] }],
"@typescript-eslint/no-redeclare": "error",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-restricted-imports": "error",
Expand Down
2 changes: 2 additions & 0 deletions action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ inputs:
tools-only:
description: Synonym for `no-qt-binaries`, used for backwards compatibility.
default: false
aqtsource:
description: Location to source aqtinstall from in case of issues
aqtversion:
description: Version of aqtinstall to use in case of issues
default: ==3.1.*
Expand Down
9 changes: 8 additions & 1 deletion action/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class Inputs {
readonly isInstallQtBinaries: boolean;
readonly setEnv: boolean;

readonly aqtSource: string;
readonly aqtVersion: string;
readonly py7zrVersion: string;

Expand Down Expand Up @@ -210,6 +211,7 @@ class Inputs {

this.setEnv = Inputs.getBoolInput("set-env");

this.aqtSource = core.getInput("aqtsource");
this.aqtVersion = core.getInput("aqtversion");

this.py7zrVersion = core.getInput("py7zrversion");
Expand Down Expand Up @@ -237,6 +239,7 @@ class Inputs {
this.version,
this.dir,
this.py7zrVersion,
this.aqtSource,
this.aqtVersion,
],
this.modules,
Expand Down Expand Up @@ -351,7 +354,11 @@ const run = async (): Promise<void> => {
await execPython("pip install", ["setuptools", "wheel", `"py7zr${inputs.py7zrVersion}"`]);

// Install aqtinstall separately: allows aqtinstall to override py7zr if required
await execPython("pip install", [`"aqtinstall${inputs.aqtVersion}"`]);
if (inputs.aqtSource.length > 0) {
await execPython("pip install", [`"${inputs.aqtSource}"`]);
} else {
await execPython("pip install", [`"aqtinstall${inputs.aqtVersion}"`]);
}

// This flag will install a parallel desktop version of Qt, only where required.
// aqtinstall will automatically determine if this is necessary.
Expand Down