Skip to content

Commit

Permalink
Merge branch 'miurahr:master' into pr/fix_msvc_mingw
Browse files Browse the repository at this point in the history
  • Loading branch information
iakov authored Nov 14, 2023
2 parents 035d1a2 + d1c5550 commit 43ebc96
Show file tree
Hide file tree
Showing 46 changed files with 2,021 additions and 268 deletions.
4 changes: 4 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git_archival.txt export-subst
2 changes: 1 addition & 1 deletion .github/workflows/check-combinations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
check_combinations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
with:
fetch-depth: 20

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Check packaging 📦
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
with:
fetch-depth: 20
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 50
- name: Fetch release tag
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-note.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
create-release-notes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
- name: Create Release Notes
uses: docker://decathlon/release-notes-generator-action:2.0.0
env:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/test-install-qt.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Test on GH actions environment

on: push
on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macOS-latest, ubuntu-latest]
py: ["3.10"]
py: ["3.8", "3.10", "3.11"]
qtver: [5.9.9, 5.12.8, 6.1.0]
artifact: [standard]
include:
Expand All @@ -25,7 +25,7 @@ jobs:
py: "3.10"
qtver: 6.1.0
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
with:
fetch-depth: 20
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
Expand Down Expand Up @@ -112,15 +112,16 @@ jobs:
if qtver.startswith('6'):
command_line6 = []
command_line6.extend(prefix)
if platform == 'ubuntu-20.04':
if platform.startswith("ubuntu"):
command_line6.extend([qtver, "linux", "android", "android_armv7"])
timeout = 360
elif platform == "macOS-latest":
elif platform.startswith("macOS"):
command_line6.extend([qtver, "mac", "ios", "ios"])
timeout = 360
else:
command_line6.extend([qtver, "windows", "android", "android_armv7"])
timeout = 360
print("Execute: {}".format(command_line6))
try:
res = subprocess.run(command_line6, timeout=timeout, check=True)
except subprocess.CalledProcessError as cpe:
Expand Down
47 changes: 27 additions & 20 deletions .github/workflows/upload-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,66 +12,73 @@ on:

jobs:
build-standalone:
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.system.os }}
strategy:
matrix:
os: [windows-latest]
system: [
{os: windows-latest, arch: x86, output_file: 'aqt_x86.exe', primary_artifact: '', secondary_artifact: 'aqt_x86.exe'},
{os: windows-latest, arch: x64, output_file: 'aqt_x64.exe', primary_artifact: 'aqt.exe', secondary_artifact: 'aqt_x64.exe'},
{os: macOS-latest, arch: x64, output_file: 'aqt_x64', primary_artifact: 'aqt-macos', secondary_artifact: 'aqt-macos_x64'}
]
py: [3.9]
arch: [x86, x64]
defaults:
run:
shell: ${{ matrix.system.os == 'windows-latest' && 'pwsh' || 'bash' }} {0}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
with:
fetch-depth: 20
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.py }}
architecture: ${{ matrix.arch }}
architecture: ${{ matrix.system.arch }}
- name: Build standalone binary
run: |
python -m venv venv
venv/Scripts/activate.ps1
${{ matrix.system.os == 'windows-latest' && 'venv/Scripts/activate.ps1' || 'chmod +x venv/bin/activate && venv/bin/activate' }}
python -m pip install -U pip wheel setuptools setuptools_scm pyinstaller
python -m pip install .
python tools/build_standalone.py ${{ matrix.arch }}
deactivate
Remove-Item venv -Recurse -Force
shell: pwsh
python tools/build_standalone.py ${{ matrix.system.arch }}
${{ matrix.system.os == 'windows-latest' && 'deactivate' || 'chmod +x venv/bin/deactivate && venv/bin/deactivate' }}
${{ matrix.system.os == 'windows-latest' && 'Remove-Item venv -Recurse -Force' || 'rm -rf venv' }}
- name: Upload to Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist\aqt_x64.exe
asset_name: aqt.exe
file: dist/${{ matrix.system.output_file }}
asset_name: ${{ matrix.system.primary_artifact }}
tag: ${{ github.ref }}
overwrite: true
if: matrix.arch=='x64' && startsWith(github.ref, 'refs/tags/v')
if: matrix.system.primary_artifact!='' && startsWith(github.ref, 'refs/tags/v')
- name: Upload to Release for all architectures
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist\aqt_${{ matrix.arch }}.exe
file: dist/${{ matrix.system.output_file }}
asset_name: ${{ matrix.system.secondary_artifact }}
tag: ${{ github.ref }}
overwrite: true
if: startsWith(github.ref, 'refs/tags/v')
if: matrix.system.secondary_artifact!='' && startsWith(github.ref, 'refs/tags/v')
- name: Update continuous build
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
overwrite: true
prerelease: true
tag: Continuous
file: dist\aqt_x64.exe
asset_name: aqt.exe
if: matrix.arch=='x64' && startsWith(github.ref, 'refs/tags/v')
file: dist/${{ matrix.system.output_file }}
asset_name: ${{ matrix.system.primary_artifact }}
if: matrix.system.primary_artifact!='' && startsWith(github.ref, 'refs/tags/v')
- name: Update continuous build for all architectures
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
overwrite: true
prerelease: true
tag: Continuous
file: dist\aqt_${{ matrix.arch }}.exe
if: startsWith(github.ref, 'refs/tags/v')
file: dist/${{ matrix.system.output_file }}
asset_name: ${{ matrix.system.secondary_artifact }}
if: matrix.system.secondary_artifact!='' && startsWith(github.ref, 'refs/tags/v')
1 change: 0 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ python:
path: .
extra_requirements:
- docs
system_packages: false

build:
os: ubuntu-22.04
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
include *.rst
include *.txt
include LICENSE
include pyproject.toml
include .flake8
Expand Down
13 changes: 11 additions & 2 deletions aqt/archives.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

from defusedxml import ElementTree

from aqt.exceptions import ArchiveDownloadError, ArchiveListError, NoPackageFound
from aqt.exceptions import ArchiveDownloadError, ArchiveListError, ChecksumDownloadFailure, NoPackageFound
from aqt.helper import Settings, get_hash, getUrl, ssplit
from aqt.metadata import QtRepoProperty, Version

Expand Down Expand Up @@ -390,7 +390,16 @@ def _get_archives_base(self, name, target_packages):

def _download_update_xml(self, update_xml_path):
"""Hook for unit test."""
xml_hash = get_hash(update_xml_path, "sha256", self.timeout)
if not Settings.ignore_hash:
try:
xml_hash = get_hash(update_xml_path, Settings.hash_algorithm, self.timeout)
except ChecksumDownloadFailure:
self.logger.warning(
"Failed to download checksum for the file 'Updates.xml'. This may happen on unofficial mirrors."
)
xml_hash = None
else:
xml_hash = None
return getUrl(posixpath.join(self.base, update_xml_path), self.timeout, xml_hash)

def _parse_update_xml(self, os_target_folder, update_xml_text, target_packages: Optional[ModuleToPackage]):
Expand Down
Loading

0 comments on commit 43ebc96

Please sign in to comment.