diff --git a/.github/workflows/upgrade-dependencies.yml b/.github/workflows/upgrade-dependencies.yml index 04aff8493..e73c8f9d9 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,13 @@ 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 + 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 + 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 diff --git a/build_utils/check_updated_packages.py b/build_utils/check_updated_packages.py index 4e472986e..e49a8d0ea 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 tomllib 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)]