Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit c641695

Browse files
author
Maxim Lobanov
committed
mplement script to build and prepare packages for Python
0 parents  commit c641695

37 files changed

+2558
-0
lines changed

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Python Tools for Visual Studio (PTVS)
2+
__pycache__/
3+
*.pyc
4+
5+
# Visual studio / VS Code cache
6+
.vs/
7+
.vscode/
8+
9+
# Desktop Service Store
10+
.DS_Store

CODE_OF_CONDUCT.md

+76
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 [email protected]. 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

CONTRIBUTING.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
## Contributing
2+
3+
[fork]: https://github.com/actions/python-versions/fork
4+
[pr]: https://github.com/actions/python-versions/compare
5+
[code-of-conduct]: CODE_OF_CONDUCT.md
6+
7+
Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.
8+
9+
Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [MIT](LICENSE.md).
10+
11+
Please note that this project is released with a [Contributor Code of Conduct][code-of-conduct]. By participating in this project you agree to abide by its terms.
12+
13+
## Submitting a pull request
14+
15+
1. [Fork][fork] and clone the repository
16+
1. Create a new branch: `git checkout -b my-branch-name`
17+
1. Make your changes
18+
1. Push to your fork and [submit a pull request][pr]
19+
1. Make sure that checks in your pull request are green
20+
21+
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
22+
23+
- Please include a summary of the change and which issue is fixed. Also include relevant motivation and context.
24+
- Follow the style guide for [PowerShell](https://github.com/PoshCode/PowerShellPracticeAndStyle).
25+
- Write [good commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
26+
27+
## Code structure
28+
29+
### Directory structure
30+
```
31+
TOOLCACHE-PYTHON-GENERATION
32+
├── azure-pipelines/
33+
| └──templates/
34+
├── builders/
35+
├── helpers/
36+
├── installers/
37+
└── tests/
38+
└──sources/
39+
```
40+
- `azure-pipelines*` - contains global YAML definitions for build pipelines. Reusable templates for specific jobs are located in `templates` subfolder.
41+
- `builders` - contains Python builder classes and functions.
42+
- `helpers` - contains global helper functions and functions.
43+
- `installers` - contains installation script templates.
44+
- `tests` - contains test scripts. Required tests sources are located in `sources` subfolder.
45+
46+
\* _We use Azure Pipelines because there are a few features that Actions is still missing, we'll move to Actions as soon as possible_.
47+
48+
## Resources
49+
50+
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
51+
- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/)
52+
- [GitHub Help](https://help.github.com)

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 GitHub
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Python for Actions
2+
This repository contains the code and scripts that we use to build Python packages used in [virtual-environments](https://github.com/actions/virtual-environments) and accessible through the [setup-python](https://github.com/actions/setup-python) Action.
3+
File [versions-manifest.json](./versions-manifest.json) contains the list of available and released versions.
4+
5+
> Caution: this is prepared for and only permitted for use by actions `virtual-environments` and `setup-python` action.
6+
7+
**Status**: Currently under development and in use for beta and preview actions. This repo is undergoing rapid changes.
8+
9+
Some versions are pre-installed on [virtual-environments](https://github.com/actions/virtual-environments) images.
10+
More versions will (soon!) be available to install on-the-fly through the [`setup-python`](https://github.com/actions/setup-python) action.
11+
12+
## Adding new versions
13+
We are trying to build and release new versions of Python as soon as they are released. Please open an issue if any versions are missing.
14+
15+
## Contribution
16+
Contributions are welcome! See [Contributor's Guide](./CONTRIBUTING.md) for more details about contribution process and code structure

SECURITY.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
If you discover a security issue in this repo, please submit it through the [GitHub Security Bug Bounty](https://hackerone.com/github)
2+
3+
Thanks for helping make GitHub Actions safe for everyone.
+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: $(date:yyyyMMdd)$(rev:.r)-Python-$(VERSION)
2+
trigger: none
3+
pr: none
4+
5+
stages:
6+
- stage: Build_Python_MacOS
7+
dependsOn: []
8+
variables:
9+
VmImage: 'macOS-10.14'
10+
Platform: macos-1014
11+
Architecture: x64
12+
jobs:
13+
- template: /azure-pipelines/templates/build-job.yml
14+
15+
- stage: Test_Python_MacOS
16+
condition: succeeded()
17+
dependsOn: Build_Python_MacOS
18+
variables:
19+
VmImage: 'macOS-10.14'
20+
Platform: macos-1014
21+
Architecture: x64
22+
jobs:
23+
- template: /azure-pipelines/templates/test-job.yml
24+
25+
- stage: Build_Python_Ubuntu_1604
26+
dependsOn: []
27+
variables:
28+
VmImage: 'ubuntu-16.04'
29+
Platform: ubuntu-1604
30+
Architecture: x64
31+
jobs:
32+
- template: /azure-pipelines/templates/build-job.yml
33+
34+
- stage: Test_Python_Ubuntu_1604
35+
condition: succeeded()
36+
dependsOn: Build_Python_Ubuntu_1604
37+
variables:
38+
VmImage: 'ubuntu-16.04'
39+
Platform: ubuntu-1604
40+
Architecture: x64
41+
jobs:
42+
- template: /azure-pipelines/templates/test-job.yml
43+
44+
- stage: Build_Python_Ubuntu_1804
45+
dependsOn: []
46+
variables:
47+
VmImage: 'ubuntu-18.04'
48+
Platform: ubuntu-1804
49+
Architecture: x64
50+
jobs:
51+
- template: /azure-pipelines/templates/build-job.yml
52+
53+
- stage: Test_Python_Ubuntu_1804
54+
condition: succeeded()
55+
dependsOn: Build_Python_Ubuntu_1804
56+
variables:
57+
VmImage: 'ubuntu-18.04'
58+
Platform: ubuntu-1804
59+
Architecture: x64
60+
jobs:
61+
- template: /azure-pipelines/templates/test-job.yml
62+
63+
- stage: Build_Python_X64_Windows
64+
dependsOn: []
65+
variables:
66+
VmImage: 'vs2017-win2016'
67+
Platform: windows-2016
68+
Architecture: x64
69+
jobs:
70+
- template: /azure-pipelines/templates/build-job.yml
71+
72+
- stage: Test_Python_x64_Windows
73+
condition: succeeded()
74+
dependsOn: Build_Python_X64_Windows
75+
variables:
76+
VmImage: 'vs2017-win2016'
77+
Platform: windows-2016
78+
Architecture: x64
79+
jobs:
80+
- template: /azure-pipelines/templates/test-job.yml
81+
82+
- stage: Build_Python_x86_Windows
83+
dependsOn: []
84+
variables:
85+
VmImage: 'vs2017-win2016'
86+
Platform: windows-2016
87+
Architecture: x86
88+
jobs:
89+
- template: /azure-pipelines/templates/build-job.yml
90+
91+
- stage: Test_Python_x86_Windows
92+
condition: succeeded()
93+
dependsOn: Build_Python_x86_Windows
94+
variables:
95+
VmImage: 'vs2017-win2016'
96+
Platform: windows-2016
97+
Architecture: x86
98+
jobs:
99+
- template: /azure-pipelines/templates/test-job.yml

azure-pipelines/run-ci-builds.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
trigger: none
2+
pr:
3+
autoCancel: true
4+
branches:
5+
include:
6+
- master
7+
paths:
8+
exclude:
9+
- versions-manifest.json
10+
11+
jobs:
12+
- job: Run_Builds
13+
pool:
14+
name: Azure Pipelines
15+
vmImage: 'ubuntu-latest'
16+
17+
steps:
18+
- checkout: self
19+
submodules: true
20+
21+
- task: PowerShell@2
22+
displayName: 'Run build'
23+
inputs:
24+
targetType: filePath
25+
filePath: './helpers/azure-devops/run-ci-builds.ps1 '
26+
arguments: |
27+
-TeamFoundationCollectionUri $(System.TeamFoundationCollectionUri) `
28+
-AzureDevOpsProjectName $(System.TeamProject) `
29+
-AzureDevOpsAccessToken $(System.AccessToken) `
30+
-SourceBranch $(Build.SourceBranch) `
31+
-SourceVersion $(Build.SourceVersion) `
32+
-ToolVersions "$(PYTHON_VERSIONS)" `
33+
-DefinitionId $(DEFINITION_ID)
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
jobs:
2+
- job: Build_Python
3+
timeoutInMinutes: 90
4+
pool:
5+
name: Azure Pipelines
6+
vmImage: $(VmImage)
7+
steps:
8+
- checkout: self
9+
submodules: true
10+
11+
- task: PowerShell@2
12+
displayName: 'Build Python $(VERSION)'
13+
inputs:
14+
targetType: filePath
15+
filePath: './builders/build-python.ps1'
16+
arguments: '-Version $(VERSION) -Platform $(Platform) -Architecture $(Architecture)'
17+
18+
- task: PublishPipelineArtifact@1
19+
displayName: 'Publish Artifact: Python $(VERSION)'
20+
inputs:
21+
targetPath: '$(Build.ArtifactStagingDirectory)'
22+
artifactName: 'python-$(VERSION)-$(Platform)-$(Architecture)'

0 commit comments

Comments
 (0)