Revert "Revert 1 padil2842 patch 1 (#3)"
This reverts commit c427560b3d
.
This commit is contained in:
parent
c427560b3d
commit
72097aa198
|
@ -1 +0,0 @@
|
|||
* @actions/virtual-environments-owners
|
|
@ -1,33 +0,0 @@
|
|||
name: Create Pull Request
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: pwsh
|
||||
|
||||
jobs:
|
||||
create_pr:
|
||||
name: Create Pull Request
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Create versions-manifest.json
|
||||
run: |
|
||||
./helpers/packages-generation/manifest-generator.ps1 -RepositoryFullName "$env:GITHUB_REPOSITORY" `
|
||||
-GitHubAccessToken "${{secrets.GITHUB_TOKEN}}" `
|
||||
-OutputFile "./versions-manifest.json" `
|
||||
-ConfigurationFile "./config/python-manifest-config.json"
|
||||
- name: Create GitHub PR
|
||||
run: |
|
||||
$formattedDate = Get-Date -Format "MM/dd/yyyy"
|
||||
./helpers/github/create-pull-request.ps1 `
|
||||
-RepositoryFullName "$env:GITHUB_REPOSITORY" `
|
||||
-AccessToken "${{secrets.GITHUB_TOKEN}}" `
|
||||
-BranchName "update-versions-manifest-file" `
|
||||
-CommitMessage "Update versions-manifest" `
|
||||
-PullRequestTitle "[versions-manifest] Update for release from ${formattedDate}" `
|
||||
-PullRequestBody "Update versions-manifest.json for release from ${formattedDate}"
|
|
@ -1,18 +0,0 @@
|
|||
name: Create release
|
||||
on:
|
||||
repository_dispatch:
|
||||
types: [create-release]
|
||||
|
||||
jobs:
|
||||
create_release:
|
||||
name: Create release ${{ github.event.client_payload.ToolVersion }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Create release for Python ${{ github.event.client_payload.ToolVersion }}
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.event.client_payload.TagName }}
|
||||
release_name: ${{ github.event.client_payload.ToolVersion }}
|
||||
body: ${{ github.event.client_payload.ReleaseBody }}
|
|
@ -1,34 +0,0 @@
|
|||
name: Test Python version
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Python version to build'
|
||||
required: true
|
||||
architecture:
|
||||
description: 'The target architecture (x86, x64) of the Python'
|
||||
required: false
|
||||
default: 'x64'
|
||||
|
||||
jobs:
|
||||
test-python:
|
||||
name: Test Python ${{ github.event.inputs.version }} ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, windows-latest, ubuntu-18.04, ubuntu-20.04]
|
||||
steps:
|
||||
- name: Setup Python ${{ github.event.inputs.version }}
|
||||
uses: actions/setup-python@main
|
||||
with:
|
||||
python-version: ${{ github.event.inputs.version }}
|
||||
architecture: ${{ github.event.inputs.architecture }}
|
||||
|
||||
- name: Validate version
|
||||
run: |
|
||||
python --version
|
||||
shell: pwsh
|
||||
|
||||
- name: Run simple code
|
||||
run: python -c 'import math; print(math.factorial(5))'
|
|
@ -116,17 +116,3 @@ stages:
|
|||
Architecture: x86
|
||||
jobs:
|
||||
- template: /azure-pipelines/templates/test-job.yml
|
||||
|
||||
- stage: Publish_Release
|
||||
dependsOn: [Test_Python_MacOS, Test_Python_Ubuntu_1604, Test_Python_Ubuntu_1804, Test_Python_Ubuntu_2004, Test_Python_x64_Windows, Test_Python_x86_Windows]
|
||||
jobs:
|
||||
- deployment: Publish_Release
|
||||
pool:
|
||||
name: Azure Pipelines
|
||||
vmImage: ubuntu-18.04
|
||||
environment: 'Get Available Tools Versions - Publishing Approval'
|
||||
strategy:
|
||||
runOnce:
|
||||
deploy:
|
||||
steps:
|
||||
- template: /azure-pipelines/templates/publish-release-steps.yml
|
||||
|
|
|
@ -7,7 +7,7 @@ jobs:
|
|||
steps:
|
||||
- checkout: self
|
||||
submodules: true
|
||||
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Build Python $(VERSION)'
|
||||
inputs:
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
steps:
|
||||
- download: none
|
||||
|
||||
- checkout: self
|
||||
submodules: true
|
||||
|
||||
- task: DownloadPipelineArtifact@2
|
||||
inputs:
|
||||
source: 'current'
|
||||
path: $(Build.BinariesDirectory)
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Create release Python $(VERSION)'
|
||||
inputs:
|
||||
TargetType: inline
|
||||
script: |
|
||||
$tagName = "$(VERSION)-$(Build.BuildId)"
|
||||
$releaseBody = "Python $(VERSION)"
|
||||
./helpers/github/create-release.ps1 -RepositoryFullName "$(Build.Repository.Name)" `
|
||||
-AccessToken "$(GITHUB_TOKEN)" `
|
||||
-ToolVersion "$(VERSION)" `
|
||||
-TagName "$tagName" `
|
||||
-ReleaseBody "$releaseBody" `
|
||||
-EventType "$(EVENT_TYPE)"
|
||||
- task: GitHubRelease@1
|
||||
displayName: 'Upload release assets'
|
||||
inputs:
|
||||
gitHubConnection: 'Github Connection'
|
||||
action: edit
|
||||
tag: '$(VERSION)-$(Build.BuildId)'
|
||||
title: '$(VERSION)'
|
||||
releaseNotesSource: inline
|
||||
releaseNotesInline: '$(RELEASE_NOTES_CONTENT)'
|
||||
assets: '$(Build.BinariesDirectory)/*/*'
|
||||
assetUploadMode: replace
|
||||
addChangeLog: false
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Trigger "Create Pull Request" workflow'
|
||||
inputs:
|
||||
TargetType: inline
|
||||
script: |
|
||||
Import-Module (Join-Path (Get-Location).Path "github-api.psm1")
|
||||
$gitHubApi = Get-GitHubApi -RepositoryFullName "$(Build.Repository.Name)" -AccessToken "$(GITHUB_TOKEN)"
|
||||
$gitHubApi.CreateWorkflowDispatch("$(WORKFLOW_FILE_NAME)", "$(WORKFLOW_DISPATCH_REF)", "$(INPUTS)")
|
||||
Write-Host "Please find created Pull request here: $(Build.Repository.Uri)/pulls"
|
||||
workingDirectory: '$(Build.SourcesDirectory)/helpers/github'
|
|
@ -27,7 +27,6 @@ jobs:
|
|||
archiveFilePatterns: '$(Build.BinariesDirectory)/python-$(VERSION)-$(Platform)-$(Architecture).*'
|
||||
destinationFolder: $(Build.BinariesDirectory)
|
||||
cleanDestinationFolder: false
|
||||
overwriteExistingFiles: true
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Apply build artifact to the local machines'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using module "./win-python-builder.psm1"
|
||||
using module "./ubuntu-python-builder.psm1"
|
||||
using module "./macos-python-builder.psm1"
|
||||
using module "./builders/win-python-builder.psm1"
|
||||
using module "./builders/ubuntu-python-builder.psm1"
|
||||
using module "./builders/macos-python-builder.psm1"
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using module "./nix-python-builder.psm1"
|
||||
using module "./builders/nix-python-builder.psm1"
|
||||
|
||||
class macOSPythonBuilder : NixPythonBuilder {
|
||||
<#
|
||||
|
@ -40,10 +40,10 @@ class macOSPythonBuilder : NixPythonBuilder {
|
|||
### and then add the appropriate paths for the header and library files to configure command.
|
||||
### Link to documentation (https://cpython-devguide.readthedocs.io/setup/#build-dependencies)
|
||||
if ($this.Version -lt "3.7.0") {
|
||||
$env:LDFLAGS = "-L/usr/local/opt/openssl@1.1/lib"
|
||||
$env:CFLAGS = "-I/usr/local/opt/openssl@1.1/include"
|
||||
$env:LDFLAGS = "-L$(brew --prefix openssl)/lib"
|
||||
$env:CFLAGS = "-I$(brew --prefix openssl)/include"
|
||||
} else {
|
||||
$configureString += " --with-openssl=/usr/local/opt/openssl@1.1"
|
||||
$configureString += " --with-openssl=/usr/local/opt/openssl"
|
||||
}
|
||||
|
||||
### Compile with support of loadable sqlite extensions. Unavailable for Python 2.*
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using module "./python-builder.psm1"
|
||||
using module "./builders/python-builder.psm1"
|
||||
|
||||
class NixPythonBuilder : PythonBuilder {
|
||||
<#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using module "./nix-python-builder.psm1"
|
||||
using module "./builders/nix-python-builder.psm1"
|
||||
|
||||
class UbuntuPythonBuilder : NixPythonBuilder {
|
||||
<#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using module "./python-builder.psm1"
|
||||
using module "./builders/python-builder.psm1"
|
||||
|
||||
class WinPythonBuilder : PythonBuilder {
|
||||
<#
|
||||
|
|
2
helpers
2
helpers
|
@ -1 +1 @@
|
|||
Subproject commit f8f76caff1878d249468db3d55f045c0b707493b
|
||||
Subproject commit 1069e7a4ece355bd321909454fc1f9f7244eb03b
|
|
@ -50,7 +50,7 @@ chmod +x ../python $PYTHON_MAJOR $PYTHON_MAJOR_DOT_MINOR $PYTHON_MAJORMINOR pyth
|
|||
|
||||
echo "Upgrading PIP..."
|
||||
./python -m ensurepip
|
||||
./python -m pip install --ignore-installed pip --no-warn-script-location
|
||||
./python -m pip install --ignore-installed pip
|
||||
|
||||
echo "Create complete file"
|
||||
touch $PYTHON_TOOLCACHE_VERSION_PATH/x64.complete
|
||||
|
|
|
@ -28,20 +28,16 @@ function Remove-RegistryEntries {
|
|||
$versionFilter = Get-RegistryVersionFilter -Architecture $Architecture -MajorVersion $MajorVersion -MinorVersion $MinorVersion
|
||||
|
||||
$regPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products"
|
||||
if (Test-Path -Path Registry::$regPath) {
|
||||
$regKeys = Get-ChildItem -Path Registry::$regPath -Recurse | Where-Object Property -Ccontains DisplayName
|
||||
foreach ($key in $regKeys) {
|
||||
if ($key.getValue("DisplayName") -match $versionFilter) {
|
||||
Remove-Item -Path $key.PSParentPath -Recurse -Force -Verbose
|
||||
}
|
||||
$regKeys = Get-ChildItem -Path Registry::$regPath -Recurse | Where-Object Property -Ccontains DisplayName
|
||||
foreach ($key in $regKeys) {
|
||||
if ($key.getValue("DisplayName") -match $versionFilter) {
|
||||
Remove-Item -Path $key.PSParentPath -Recurse -Force -Verbose
|
||||
}
|
||||
}
|
||||
|
||||
$regPath = "HKEY_CLASSES_ROOT\Installer\Products"
|
||||
if (Test-Path -Path Registry::$regPath) {
|
||||
Get-ChildItem -Path Registry::$regPath | Where-Object { $_.GetValue("ProductName") -match $versionFilter } | ForEach-Object {
|
||||
Remove-Item Registry::$_ -Recurse -Force -Verbose
|
||||
}
|
||||
Get-ChildItem -Path Registry::$regPath | Where-Object { $_.GetValue("ProductName") -match $versionFilter } | ForEach-Object {
|
||||
Remove-Item Registry::$_ -Recurse -Force -Verbose
|
||||
}
|
||||
|
||||
$uninstallRegistrySections = @(
|
||||
|
@ -125,14 +121,9 @@ if ($LASTEXITCODE -ne 0) {
|
|||
Throw "Error happened during Python installation"
|
||||
}
|
||||
|
||||
Write-Host "Create `python3` symlink"
|
||||
if ($MajorVersion -ne "2") {
|
||||
New-Item -Path "$PythonArchPath\python3.exe" -ItemType SymbolicLink -Value "$PythonArchPath\python.exe"
|
||||
}
|
||||
|
||||
Write-Host "Install and upgrade Pip"
|
||||
$PythonExePath = Join-Path -Path $PythonArchPath -ChildPath "python.exe"
|
||||
cmd.exe /c "$PythonExePath -m ensurepip && $PythonExePath -m pip install --upgrade pip --no-warn-script-location"
|
||||
cmd.exe /c "$PythonExePath -m ensurepip && $PythonExePath -m pip install --upgrade pip"
|
||||
|
||||
Write-Host "Create complete file"
|
||||
New-Item -ItemType File -Path $PythonVersionPath -Name "$Architecture.complete" | Out-Null
|
||||
|
|
|
@ -7,7 +7,6 @@ param (
|
|||
|
||||
Import-Module (Join-Path $PSScriptRoot "../helpers/pester-extensions.psm1")
|
||||
Import-Module (Join-Path $PSScriptRoot "../helpers/common-helpers.psm1")
|
||||
Import-Module (Join-Path $PSScriptRoot "../builders/python-version.psm1")
|
||||
|
||||
function Analyze-MissingModules([string] $buildOutputLocation) {
|
||||
$searchStringStart = "Failed to build these modules:"
|
||||
|
@ -21,14 +20,9 @@ function Analyze-MissingModules([string] $buildOutputLocation) {
|
|||
$regexMatch = [regex]::match($SplitBuiltOutput, $Pattern)
|
||||
if ($regexMatch.Success)
|
||||
{
|
||||
$module = $regexMatch.Groups[1].Value.Trim()
|
||||
Write-Host "Failed missing modules:"
|
||||
Write-Host $module
|
||||
if ( ($module -eq "_tkinter") -and ( ($Version -like "3.10.0-beta*") -or ($Version -like "3.10.0-alpha*") ) ) {
|
||||
Write-Host "$module $Version ignored"
|
||||
} else {
|
||||
return 1
|
||||
}
|
||||
Write-Host $regexMatch.Groups[1].Value
|
||||
return 1
|
||||
}
|
||||
|
||||
return 0
|
||||
|
@ -53,11 +47,6 @@ Describe "Tests" {
|
|||
}
|
||||
}
|
||||
|
||||
It "Run pip" {
|
||||
"pip install requests" | Should -ReturnZeroExitCode
|
||||
"pip uninstall requests -y" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
if (IsNixPlatform $Platform) {
|
||||
|
||||
It "Check for failed modules in build_output" {
|
||||
|
@ -70,8 +59,7 @@ Describe "Tests" {
|
|||
}
|
||||
|
||||
It "Check if python configuration is correct" {
|
||||
$nativeVersion = Convert-Version -version $Version
|
||||
"python ./sources/python-config-test.py $Version $nativeVersion" | Should -ReturnZeroExitCode
|
||||
"python ./sources/python-config-test.py $Version" | Should -ReturnZeroExitCode
|
||||
}
|
||||
|
||||
It "Check if shared libraries are linked correctly" {
|
||||
|
@ -80,11 +68,11 @@ Describe "Tests" {
|
|||
}
|
||||
|
||||
# Pyinstaller 3.5 does not support Python 3.8.0. Check issue https://github.com/pyinstaller/pyinstaller/issues/4311
|
||||
if ($Version -lt "3.8.0" -and $Version.Major -ne "2") {
|
||||
if ($Version -lt "3.8.0") {
|
||||
It "Validate Pyinstaller" {
|
||||
"pip install pyinstaller" | Should -ReturnZeroExitCode
|
||||
"pyinstaller --onefile ./sources/simple-test.py" | Should -ReturnZeroExitCode
|
||||
"./dist/simple-test" | Should -ReturnZeroExitCode
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
import distutils.sysconfig
|
||||
from distutils.version import LooseVersion
|
||||
import sysconfig
|
||||
import sys
|
||||
import platform
|
||||
|
@ -8,7 +7,6 @@ import os
|
|||
# Define variables
|
||||
os_type = platform.system()
|
||||
version = sys.argv[1]
|
||||
nativeVersion = sys.argv[2]
|
||||
|
||||
lib_dir_path = sysconfig.get_config_var('LIBDIR')
|
||||
ld_library_name = sysconfig.get_config_var('LDLIBRARY')
|
||||
|
@ -43,7 +41,7 @@ else:
|
|||
### Validate macOS
|
||||
if os_type == 'Darwin':
|
||||
### Validate openssl links
|
||||
if LooseVersion(nativeVersion) < LooseVersion("3.7.0"):
|
||||
if version < "3.7.0":
|
||||
expected_ldflags = '-L/usr/local/opt/openssl@1.1/lib'
|
||||
ldflags = sysconfig.get_config_var('LDFLAGS')
|
||||
|
||||
|
@ -51,8 +49,8 @@ if os_type == 'Darwin':
|
|||
print('Invalid ldflags: %s; Expected: %s' % (ldflags, expected_ldflags))
|
||||
exit(1)
|
||||
else:
|
||||
expected_openssl_includes = '-I/usr/local/opt/openssl@1.1/include'
|
||||
expected_openssl_ldflags ='-L/usr/local/opt/openssl@1.1/lib'
|
||||
expected_openssl_includes = '-I/usr/local/opt/openssl/include'
|
||||
expected_openssl_ldflags ='-L/usr/local/opt/openssl/lib'
|
||||
|
||||
openssl_includes = sysconfig.get_config_var('OPENSSL_INCLUDES')
|
||||
openssl_ldflags = sysconfig.get_config_var('OPENSSL_LDFLAGS')
|
||||
|
|
|
@ -139,7 +139,6 @@ standard_library = [
|
|||
'sre_constants',
|
||||
'sre_parse',
|
||||
'ssl',
|
||||
'_ssl',
|
||||
'stat',
|
||||
'string',
|
||||
'stringprep',
|
||||
|
@ -256,11 +255,6 @@ if sys.version_info > (3, 7):
|
|||
if sys.version_info > (3, 8):
|
||||
standard_library.remove('dummy_threading')
|
||||
|
||||
# 'symbol' and 'formatter' modules have been removed from Python 3.10
|
||||
if sys.version_info >= (3, 10):
|
||||
standard_library.remove('symbol')
|
||||
standard_library.remove('formatter')
|
||||
|
||||
# Remove tkinter and Easter eggs
|
||||
excluded_modules = [
|
||||
'antigravity',
|
||||
|
@ -271,6 +265,7 @@ excluded_modules = [
|
|||
def check_missing_modules(expected_modules):
|
||||
missing = []
|
||||
for module in expected_modules:
|
||||
print('Try to import module ', module)
|
||||
try:
|
||||
importlib.import_module(module)
|
||||
except:
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue