Skip to content

Commit 0f3b8dc

Browse files
committed
f
1 parent 350a5fc commit 0f3b8dc

File tree

8 files changed

+23
-23
lines changed

8 files changed

+23
-23
lines changed

.github/workflows/test-pypy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
uses: ./
8585
with:
8686
python-version: ${{ matrix.pypy }}
87-
no-environment-update: true
87+
update-environment: false
8888

8989
- name: PyPy and Python version
9090
run: ${{ steps.setup-python.outputs.python-path }} --version

.github/workflows/test-python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ jobs:
165165
uses: ./
166166
with:
167167
python-version: ${{ matrix.python }}
168-
no-environment-update: true
168+
update-environment: false
169169

170170
- name: Python version
171171
run: ${{ steps.setup-python.outputs.python-path }} --version

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,12 +320,12 @@ steps:
320320
- run: pipenv install
321321
```
322322
323-
# No environment update
323+
# Environment variables
324324
325-
The `no-environment-update` flag defaults to `false`.
325+
The `update-environment` flag defaults to `true`.
326326
With this setting, the action will add/update environment variables (e.g. `PATH`, `PKG_CONFIG_PATH`, `pythonLocation`) for `python` to just work out of the box.
327327

328-
If `no-environment-update` is set to `true`, the action will not add/update environment variables.
328+
If `update-environment` is set to `false`, the action will not add/update environment variables.
329329
This can prove useful if you want the only side-effect to be to ensure python is installed and rely on the `python-path` output to run python.
330330
Such a requirement on side-effect could be because you don't want your composite action messing with your user's workflows.
331331

@@ -336,7 +336,7 @@ steps:
336336
id: cp310
337337
with:
338338
python-version: '3.10'
339-
no-environment-update: true
339+
update-environment: false
340340
- run: ${{ steps.cp310.outputs.python-path }} my_script.py
341341
```
342342

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ inputs:
1717
default: ${{ github.token }}
1818
cache-dependency-path:
1919
description: 'Used to specify the path to dependency files. Supports wildcards or a list of file names for caching multiple dependencies.'
20-
no-environment-update:
21-
description: 'Set this option if you want the action not to update environment variables.'
22-
default: false
20+
update-environment:
21+
description: 'Set this option if you want the action to update environment variables.'
22+
default: true
2323
outputs:
2424
python-version:
2525
description: "The installed python version. Useful when given a version range as input."

dist/setup/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63865,7 +63865,7 @@ const utils_1 = __nccwpck_require__(1314);
6386563865
const semver = __importStar(__nccwpck_require__(1383));
6386663866
const core = __importStar(__nccwpck_require__(2186));
6386763867
const tc = __importStar(__nccwpck_require__(7784));
63868-
function findPyPyVersion(versionSpec, architecture, envUpdate) {
63868+
function findPyPyVersion(versionSpec, architecture, updateEnvironment) {
6386963869
return __awaiter(this, void 0, void 0, function* () {
6387063870
let resolvedPyPyVersion = '';
6387163871
let resolvedPythonVersion = '';
@@ -63884,7 +63884,7 @@ function findPyPyVersion(versionSpec, architecture, envUpdate) {
6388463884
const binaryExtension = utils_1.IS_WINDOWS ? '.exe' : '';
6388563885
const pythonPath = path.join(utils_1.IS_WINDOWS ? installDir : _binDir, `python${binaryExtension}`);
6388663886
const pythonLocation = pypyInstall.getPyPyBinaryPath(installDir);
63887-
if (envUpdate) {
63887+
if (updateEnvironment) {
6388863888
core.exportVariable('pythonLocation', installDir);
6388963889
core.exportVariable('PKG_CONFIG_PATH', pythonLocation + '/lib/pkgconfig');
6389063890
core.addPath(pythonLocation);
@@ -64021,7 +64021,7 @@ function binDir(installDir) {
6402164021
return path.join(installDir, 'bin');
6402264022
}
6402364023
}
64024-
function useCpythonVersion(version, architecture, envUpdate) {
64024+
function useCpythonVersion(version, architecture, updateEnvironment) {
6402564025
return __awaiter(this, void 0, void 0, function* () {
6402664026
const desugaredVersionSpec = desugarDevVersion(version);
6402764027
const semanticVersionSpec = pythonVersionToSemantic(desugaredVersionSpec);
@@ -64045,7 +64045,7 @@ function useCpythonVersion(version, architecture, envUpdate) {
6404564045
const _binDir = binDir(installDir);
6404664046
const binaryExtension = utils_1.IS_WINDOWS ? '.exe' : '';
6404764047
const pythonPath = path.join(utils_1.IS_WINDOWS ? installDir : _binDir, `python${binaryExtension}`);
64048-
if (envUpdate) {
64048+
if (updateEnvironment) {
6404964049
core.exportVariable('pythonLocation', installDir);
6405064050
core.exportVariable('PKG_CONFIG_PATH', installDir + '/lib/pkgconfig');
6405164051
if (utils_1.IS_LINUX) {
@@ -64471,14 +64471,14 @@ function run() {
6447164471
if (version) {
6447264472
let pythonVersion;
6447364473
const arch = core.getInput('architecture') || os.arch();
64474-
const updateEnv = !core.getBooleanInput('no-environment-update');
64474+
const updateEnvironment = core.getBooleanInput('update-environment');
6447564475
if (isPyPyVersion(version)) {
64476-
const installed = yield finderPyPy.findPyPyVersion(version, arch, updateEnv);
64476+
const installed = yield finderPyPy.findPyPyVersion(version, arch, updateEnvironment);
6447764477
pythonVersion = `${installed.resolvedPyPyVersion}-${installed.resolvedPythonVersion}`;
6447864478
core.info(`Successfully set up PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})`);
6447964479
}
6448064480
else {
64481-
const installed = yield finder.useCpythonVersion(version, arch, updateEnv);
64481+
const installed = yield finder.useCpythonVersion(version, arch, updateEnvironment);
6448264482
pythonVersion = installed.version;
6448364483
core.info(`Successfully set up ${installed.impl} (${pythonVersion})`);
6448464484
}

src/find-pypy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ interface IPyPyVersionSpec {
2121
export async function findPyPyVersion(
2222
versionSpec: string,
2323
architecture: string,
24-
envUpdate: boolean
24+
updateEnvironment: boolean
2525
): Promise<{resolvedPyPyVersion: string; resolvedPythonVersion: string}> {
2626
let resolvedPyPyVersion = '';
2727
let resolvedPythonVersion = '';
@@ -55,7 +55,7 @@ export async function findPyPyVersion(
5555
`python${binaryExtension}`
5656
);
5757
const pythonLocation = pypyInstall.getPyPyBinaryPath(installDir);
58-
if (envUpdate) {
58+
if (updateEnvironment) {
5959
core.exportVariable('pythonLocation', installDir);
6060
core.exportVariable('PKG_CONFIG_PATH', pythonLocation + '/lib/pkgconfig');
6161
core.addPath(pythonLocation);

src/find-python.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function binDir(installDir: string): string {
3333
export async function useCpythonVersion(
3434
version: string,
3535
architecture: string,
36-
envUpdate: boolean
36+
updateEnvironment: boolean
3737
): Promise<InstalledVersion> {
3838
const desugaredVersionSpec = desugarDevVersion(version);
3939
const semanticVersionSpec = pythonVersionToSemantic(desugaredVersionSpec);
@@ -76,7 +76,7 @@ export async function useCpythonVersion(
7676
IS_WINDOWS ? installDir : _binDir,
7777
`python${binaryExtension}`
7878
);
79-
if (envUpdate) {
79+
if (updateEnvironment) {
8080
core.exportVariable('pythonLocation', installDir);
8181
core.exportVariable('PKG_CONFIG_PATH', installDir + '/lib/pkgconfig');
8282

src/setup-python.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ async function run() {
6464
if (version) {
6565
let pythonVersion: string;
6666
const arch: string = core.getInput('architecture') || os.arch();
67-
const updateEnv = !core.getBooleanInput('no-environment-update');
67+
const updateEnvironment = core.getBooleanInput('update-environment');
6868
if (isPyPyVersion(version)) {
6969
const installed = await finderPyPy.findPyPyVersion(
7070
version,
7171
arch,
72-
updateEnv
72+
updateEnvironment
7373
);
7474
pythonVersion = `${installed.resolvedPyPyVersion}-${installed.resolvedPythonVersion}`;
7575
core.info(
@@ -79,7 +79,7 @@ async function run() {
7979
const installed = await finder.useCpythonVersion(
8080
version,
8181
arch,
82-
updateEnv
82+
updateEnvironment
8383
);
8484
pythonVersion = installed.version;
8585
core.info(`Successfully set up ${installed.impl} (${pythonVersion})`);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy