Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dbfda6e

Browse filesBrowse files
authored
Merge branch 'actions:main' into main
2 parents a200bff + c57f793 commit dbfda6e
Copy full SHA for dbfda6e

File tree

Expand file treeCollapse file tree

9 files changed

+122
-6
lines changed
Filter options
Expand file treeCollapse file tree

9 files changed

+122
-6
lines changed

‎.github/workflows/test-pypy.yml

Copy file name to clipboardExpand all lines: .github/workflows/test-pypy.yml
+14Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,17 @@ jobs:
4444

4545
- name: Run simple code
4646
run: python -c 'import math; print(math.factorial(5))'
47+
48+
- name: Assert PyPy is running
49+
run: |
50+
import platform
51+
assert platform.python_implementation().lower() == "pypy"
52+
shell: python
53+
54+
- name: Assert expected binaries (or symlinks) are present
55+
run: |
56+
EXECUTABLE=${{ matrix.pypy }}
57+
EXECUTABLE=${EXECUTABLE/-/} # remove the first '-' in "pypy-X.Y" -> "pypyX.Y" to match executable name
58+
EXECUTABLE=${EXECUTABLE%%-*} # remove any -* suffixe
59+
${EXECUTABLE} --version
60+
shell: bash

‎CODE_OF_CONDUCT.md

Copy file name to clipboard
+76Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to make participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies within all project spaces, and it also applies when
49+
an individual is representing the project or its community in public spaces.
50+
Examples of representing a project or community include using an official
51+
project e-mail address, posting via an official social media account, or acting
52+
as an appointed representative at an online or offline event. Representation of
53+
a project may be further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at opensource+actions/setup-python@github.com. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

‎README.md

Copy file name to clipboardExpand all lines: README.md
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,13 @@ Check out our detailed guide on using [Python with GitHub Actions](https://help.
162162
- For every minor version of Python, expect only the latest patch to be preinstalled.
163163
- If `3.8.1` is installed for example, and `3.8.2` is released, expect `3.8.1` to be removed and replaced by `3.8.2` in the tools cache.
164164
- If the exact patch version doesn't matter to you, specifying just the major and minor version will get you the latest preinstalled patch version. In the previous example, the version spec `3.8` will use the `3.8.2` Python version found in the cache.
165+
- Use `-dev` instead of a patch number (e.g., `3.11-dev`) to install the latest release of a minor version, *alpha and beta releases included*.
165166
- Downloadable Python versions from GitHub Releases ([actions/python-versions](https://github.com/actions/python-versions/releases)).
166167
- All available versions are listed in the [version-manifest.json](https://github.com/actions/python-versions/blob/main/versions-manifest.json) file.
167168
- If there is a specific version of Python that is not available, you can open an issue here
168169

170+
**Note:** Python versions used in this action are generated in the [python-versions](https://github.com/actions/python-versions) repository. For macOS and Ubuntu images python versions are built from the source code. For Windows the python-versions repository uses installation executable. For more information please refer to the [python-versions](https://github.com/actions/python-versions) repository.
171+
169172
# Available versions of PyPy
170173

171174
`setup-python` is able to configure PyPy from two sources:

‎dist/setup/index.js

Copy file name to clipboardExpand all lines: dist/setup/index.js
+10-2Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6117,18 +6117,21 @@ function run() {
61176117
if (isPyPyVersion(version)) {
61186118
const installed = yield finderPyPy.findPyPyVersion(version, arch);
61196119
pythonVersion = `${installed.resolvedPyPyVersion}-${installed.resolvedPythonVersion}`;
6120-
core.info(`Successfully setup PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})`);
6120+
core.info(`Successfully set up PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})`);
61216121
}
61226122
else {
61236123
const installed = yield finder.useCpythonVersion(version, arch);
61246124
pythonVersion = installed.version;
6125-
core.info(`Successfully setup ${installed.impl} (${pythonVersion})`);
6125+
core.info(`Successfully set up ${installed.impl} (${pythonVersion})`);
61266126
}
61276127
const cache = core.getInput('cache');
61286128
if (cache && utils_1.isCacheFeatureAvailable()) {
61296129
yield cacheDependencies(cache, pythonVersion);
61306130
}
61316131
}
6132+
else {
6133+
core.warning('The `python-version` input is not set. The version of Python currently in `PATH` will be used.');
6134+
}
61326135
const matchersPath = path.join(__dirname, '../..', '.github');
61336136
core.info(`##[add-matcher]${path.join(matchersPath, 'python.json')}`);
61346137
}
@@ -10300,11 +10303,14 @@ function createPyPySymlink(pypyBinaryPath, pythonVersion) {
1030010303
return __awaiter(this, void 0, void 0, function* () {
1030110304
const version = semver.coerce(pythonVersion);
1030210305
const pythonBinaryPostfix = semver.major(version);
10306+
const pythonMinor = semver.minor(version);
1030310307
const pypyBinaryPostfix = pythonBinaryPostfix === 2 ? '' : '3';
10308+
const pypyMajorMinorBinaryPostfix = `${pythonBinaryPostfix}.${pythonMinor}`;
1030410309
let binaryExtension = utils_1.IS_WINDOWS ? '.exe' : '';
1030510310
core.info('Creating symlinks...');
1030610311
utils_1.createSymlinkInFolder(pypyBinaryPath, `pypy${pypyBinaryPostfix}${binaryExtension}`, `python${pythonBinaryPostfix}${binaryExtension}`, true);
1030710312
utils_1.createSymlinkInFolder(pypyBinaryPath, `pypy${pypyBinaryPostfix}${binaryExtension}`, `python${binaryExtension}`, true);
10313+
utils_1.createSymlinkInFolder(pypyBinaryPath, `pypy${pypyBinaryPostfix}${binaryExtension}`, `pypy${pypyMajorMinorBinaryPostfix}${binaryExtension}`, true);
1030810314
});
1030910315
}
1031010316
function installPip(pythonLocation) {
@@ -52388,6 +52394,7 @@ function findPyPyVersion(versionSpec, architecture) {
5238852394
const _binDir = path.join(installDir, pipDir);
5238952395
const pythonLocation = pypyInstall.getPyPyBinaryPath(installDir);
5239052396
core.exportVariable('pythonLocation', pythonLocation);
52397+
core.exportVariable('PKG_CONFIG_PATH', pythonLocation + '/lib/pkgconfig');
5239152398
core.addPath(pythonLocation);
5239252399
core.addPath(_binDir);
5239352400
core.setOutput('python-version', 'pypy' + resolvedPyPyVersion.trim());
@@ -57023,6 +57030,7 @@ function useCpythonVersion(version, architecture) {
5702357030
].join(os.EOL));
5702457031
}
5702557032
core.exportVariable('pythonLocation', installDir);
57033+
core.exportVariable('PKG_CONFIG_PATH', installDir + '/lib/pkgconfig');
5702657034
if (utils_1.IS_LINUX) {
5702757035
const libPath = process.env.LD_LIBRARY_PATH
5702857036
? `:${process.env.LD_LIBRARY_PATH}`

‎package-lock.json

Copy file name to clipboardExpand all lines: package-lock.json
+2-2Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/find-pypy.ts

Copy file name to clipboardExpand all lines: src/find-pypy.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export async function findPyPyVersion(
5050
const _binDir = path.join(installDir, pipDir);
5151
const pythonLocation = pypyInstall.getPyPyBinaryPath(installDir);
5252
core.exportVariable('pythonLocation', pythonLocation);
53+
core.exportVariable('PKG_CONFIG_PATH', pythonLocation + '/lib/pkgconfig');
5354
core.addPath(pythonLocation);
5455
core.addPath(_binDir);
5556
core.setOutput('python-version', 'pypy' + resolvedPyPyVersion.trim());

‎src/find-python.ts

Copy file name to clipboardExpand all lines: src/find-python.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export async function useCpythonVersion(
7070
}
7171

7272
core.exportVariable('pythonLocation', installDir);
73+
core.exportVariable('PKG_CONFIG_PATH', installDir + '/lib/pkgconfig');
7374

7475
if (IS_LINUX) {
7576
const libPath = process.env.LD_LIBRARY_PATH

‎src/install-pypy.ts

Copy file name to clipboardExpand all lines: src/install-pypy.ts
+9Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ async function createPyPySymlink(
9898
) {
9999
const version = semver.coerce(pythonVersion)!;
100100
const pythonBinaryPostfix = semver.major(version);
101+
const pythonMinor = semver.minor(version);
101102
const pypyBinaryPostfix = pythonBinaryPostfix === 2 ? '' : '3';
103+
const pypyMajorMinorBinaryPostfix = `${pythonBinaryPostfix}.${pythonMinor}`;
102104
let binaryExtension = IS_WINDOWS ? '.exe' : '';
103105

104106
core.info('Creating symlinks...');
@@ -115,6 +117,13 @@ async function createPyPySymlink(
115117
`python${binaryExtension}`,
116118
true
117119
);
120+
121+
createSymlinkInFolder(
122+
pypyBinaryPath,
123+
`pypy${pypyBinaryPostfix}${binaryExtension}`,
124+
`pypy${pypyMajorMinorBinaryPostfix}${binaryExtension}`,
125+
true
126+
);
118127
}
119128

120129
async function installPip(pythonLocation: string) {

‎src/setup-python.ts

Copy file name to clipboardExpand all lines: src/setup-python.ts
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,22 @@ async function run() {
6363
const installed = await finderPyPy.findPyPyVersion(version, arch);
6464
pythonVersion = `${installed.resolvedPyPyVersion}-${installed.resolvedPythonVersion}`;
6565
core.info(
66-
`Successfully setup PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})`
66+
`Successfully set up PyPy ${installed.resolvedPyPyVersion} with Python (${installed.resolvedPythonVersion})`
6767
);
6868
} else {
6969
const installed = await finder.useCpythonVersion(version, arch);
7070
pythonVersion = installed.version;
71-
core.info(`Successfully setup ${installed.impl} (${pythonVersion})`);
71+
core.info(`Successfully set up ${installed.impl} (${pythonVersion})`);
7272
}
7373

7474
const cache = core.getInput('cache');
7575
if (cache && isCacheFeatureAvailable()) {
7676
await cacheDependencies(cache, pythonVersion);
7777
}
78+
} else {
79+
core.warning(
80+
'The `python-version` input is not set. The version of Python currently in `PATH` will be used.'
81+
);
7882
}
7983
const matchersPath = path.join(__dirname, '../..', '.github');
8084
core.info(`##[add-matcher]${path.join(matchersPath, 'python.json')}`);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.