From 89ef4402a5ac83168abf639ce2deb9eb9ac48fdc Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Wed, 28 Feb 2024 21:04:58 +0100 Subject: [PATCH 1/3] update workflow to use uv in place of pip-tools --- .github/workflows/upgrade-dependencies.yml | 27 ++++++---------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/.github/workflows/upgrade-dependencies.yml b/.github/workflows/upgrade-dependencies.yml index 04aff8493..686e71dbc 100644 --- a/.github/workflows/upgrade-dependencies.yml +++ b/.github/workflows/upgrade-dependencies.yml @@ -22,21 +22,7 @@ jobs: ssh-key: ${{ secrets.DEPLOY_KEY }} # START PYTHON DEPENDENCIES - - uses: actions/setup-python@v5 - with: - python-version: "3.8" - cache: pip - cache-dependency-path: 'pyproject.toml' - - uses: actions/setup-python@v5 - with: - python-version: "3.9" - cache: pip - cache-dependency-path: 'pyproject.toml' - - uses: actions/setup-python@v5 - with: - python-version: "3.10" - cache: pip - cache-dependency-path: 'pyproject.toml' + - uses: actions/setup-python@v5 with: python-version: "3.11" @@ -46,14 +32,15 @@ jobs: # ADD YOUR CUSTOM DEPENDENCY UPGRADE COMMANDS BELOW run: | set -x - flags="--extra pyqt5 --extra pyqt6 --extra pyside2 --extra pyside6" - flags+=" --extra test --extra pyinstaller --allow-unsafe --strip-extras --resolver=backtracking" + pip install -U uv + set -x + flags=(--extra pyqt5 --extra pyqt6 --extra pyside2 --extra pyside6 --extra test --extra pyinstaller) for pyv in 3.8 3.9 3.10 3.11; do - python${pyv} -m pip install -U pip pip-tools - python${pyv} -m piptools compile --upgrade -o requirements/constraints_py${pyv}.txt pyproject.toml requirements/version_denylist.txt ${flags} + uv pip compile --python-version ${pyv} --upgrade --output-file requirements/constraints_py${pyv}.txt pyproject.toml requirements/version_denylist.txt "${flags[@]}" done - python3.11 -m piptools compile --upgrade -o requirements/constraints_py3.11_docs.txt pyproject.toml requirements/version_denylist.txt --allow-unsafe --strip-extras --extra docs --extra pyqt6 + set +x + uv pip compile --python-version 3.11 --upgrade --output-file requirements/constraints_py3.11_docs.txt pyproject.toml requirements/version_denylist.txt --extra docs --extra pyqt6 # END PYTHON DEPENDENCIES - name: Check updated packages From 0ebc2a1b94f1995dc7e259c13e23c811a6cd30c5 Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Wed, 28 Feb 2024 21:12:50 +0100 Subject: [PATCH 2/3] fix script for checking packages --- build_utils/check_updated_packages.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/build_utils/check_updated_packages.py b/build_utils/check_updated_packages.py index 4e472986e..a357ea635 100644 --- a/build_utils/check_updated_packages.py +++ b/build_utils/check_updated_packages.py @@ -2,9 +2,10 @@ import re import subprocess # nosec import sys -from configparser import ConfigParser from pathlib import Path +from tomli import loads + name_re = re.compile(r"[\w-]+") changed_name_re = re.compile(r"\+([\w-]+)") @@ -31,12 +32,14 @@ sys.exit(0) -config = ConfigParser() -config.read(src_dir / "setup.cfg") +config = loads((src_dir / "pyproject.toml").read_text()) + +metadata = config["project"] + packages = ( - config["options"]["install_requires"].split("\n") - + config["options.extras_require"]["pyinstaller"].split("\n") - + config["options.extras_require"]["all"].split("\n") + metadata["dependencies"] + + metadata["optional-dependencies"]["pyinstaller"] + + metadata["optional-dependencies"]["all"] ) packages = [name_re.match(package).group().lower() for package in packages if name_re.match(package)] From a5d33e4b0152a837967e6ad8cfdb040edebf5afd Mon Sep 17 00:00:00 2001 From: Grzegorz Bokota Date: Wed, 28 Feb 2024 21:21:09 +0100 Subject: [PATCH 3/3] remove obosolete `set -x` and set +x` --- .github/workflows/upgrade-dependencies.yml | 2 -- build_utils/check_updated_packages.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/upgrade-dependencies.yml b/.github/workflows/upgrade-dependencies.yml index 686e71dbc..e73c8f9d9 100644 --- a/.github/workflows/upgrade-dependencies.yml +++ b/.github/workflows/upgrade-dependencies.yml @@ -33,13 +33,11 @@ jobs: run: | set -x pip install -U uv - set -x flags=(--extra pyqt5 --extra pyqt6 --extra pyside2 --extra pyside6 --extra test --extra pyinstaller) for pyv in 3.8 3.9 3.10 3.11; do uv pip compile --python-version ${pyv} --upgrade --output-file requirements/constraints_py${pyv}.txt pyproject.toml requirements/version_denylist.txt "${flags[@]}" done - set +x uv pip compile --python-version 3.11 --upgrade --output-file requirements/constraints_py3.11_docs.txt pyproject.toml requirements/version_denylist.txt --extra docs --extra pyqt6 # END PYTHON DEPENDENCIES diff --git a/build_utils/check_updated_packages.py b/build_utils/check_updated_packages.py index a357ea635..e49a8d0ea 100644 --- a/build_utils/check_updated_packages.py +++ b/build_utils/check_updated_packages.py @@ -4,7 +4,7 @@ import sys from pathlib import Path -from tomli import loads +from tomllib import loads name_re = re.compile(r"[\w-]+") changed_name_re = re.compile(r"\+([\w-]+)")