diff --git a/.github/common.env b/.github/common.env index fd2da1288..8b4f9aa63 100644 --- a/.github/common.env +++ b/.github/common.env @@ -1,6 +1,6 @@ # Shared common variables CI_IMAGE_VERSION=master-2856852845 -CI_TOXENV_MAIN=py310,py311,py312,py313,py314,py315 -CI_TOXENV_PLUGINS=py310-plugins,py311-plugins,py312-plugins,py313-plugins,py314-plugins,py315-plugins +CI_TOXENV_MAIN=py311,py312,py313,py314,py315 +CI_TOXENV_PLUGINS=py311-plugins,py312-plugins,py313-plugins,py314-plugins,py315-plugins CI_TOXENV_ALL="${CI_TOXENV_MAIN},${CI_TOXENV_PLUGINS}" diff --git a/.github/compose/ci.docker-compose.yml b/.github/compose/ci.docker-compose.yml index 2b594f3ce..f689d5146 100644 --- a/.github/compose/ci.docker-compose.yml +++ b/.github/compose/ci.docker-compose.yml @@ -38,10 +38,6 @@ services: <<: *tests-template image: registry.gitlab.com/buildstream/buildstream-docker-images/testsuite-fedora:45-${CI_IMAGE_VERSION:-latest} - ubuntu-22.04: - <<: *tests-template - image: registry.gitlab.com/buildstream/buildstream-docker-images/testsuite-ubuntu:22.04-${CI_IMAGE_VERSION:-latest} - # Ensure that tests also pass in the absence of a sandboxing tool fedora-missing-deps: <<: *tests-template @@ -96,11 +92,6 @@ services: # on the PyPA official 'manylinux' images that define the base ABI for # Python binary packages. - wheels-manylinux_2_28-cp310: - <<: *tests-template - image: quay.io/pypa/manylinux_2_28_x86_64 - command: .github/wheel-helpers/test-wheel-manylinux.sh cp310 /opt/python/cp310-cp310/bin/python3 - wheels-manylinux_2_28-cp311: <<: *tests-template image: quay.io/pypa/manylinux_2_28_x86_64 diff --git a/.github/run-ci.sh b/.github/run-ci.sh index ee6b67049..5acc395bc 100755 --- a/.github/run-ci.sh +++ b/.github/run-ci.sh @@ -102,7 +102,7 @@ function runServiceTest() { if [ -z "${test_names}" ]; then - for test_name in mypy debian-12 debian-13 fedora-44 fedora-45 fedora-missing-deps ubuntu-22.04; do + for test_name in mypy debian-12 debian-13 fedora-44 fedora-45 fedora-missing-deps; do if ! runTest "${test_name}"; then echo "Tests failed" exit 1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6f6b48cd..a0db3f387 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,6 @@ jobs: - fedora-44 - fedora-45 - fedora-missing-deps - - ubuntu-22.04 - lint - mypy @@ -153,7 +152,6 @@ jobs: # The names here should map to a valid service defined in # "../compose/ci.docker-compose.yml" test-name: - - wheels-manylinux_2_28-cp310 - wheels-manylinux_2_28-cp311 - wheels-manylinux_2_28-cp312 - wheels-manylinux_2_28-cp313 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e12fbb047..133b95404 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -89,7 +89,6 @@ jobs: # The names here should map to a valid service defined in # "../compose/ci.docker-compose.yml" test-name: - - wheels-manylinux_2_28-cp310 - wheels-manylinux_2_28-cp311 - wheels-manylinux_2_28-cp312 - wheels-manylinux_2_28-cp313 diff --git a/doc/source/main_install.rst b/doc/source/main_install.rst index 56f81454e..7ed07915b 100644 --- a/doc/source/main_install.rst +++ b/doc/source/main_install.rst @@ -67,7 +67,7 @@ Runtime requirements BuildStream requires the following Python environment to run: -- python3 >= 3.10 +- python3 >= 3.11 - PyPI packages as specified in `requirements.in `_. diff --git a/pyproject.toml b/pyproject.toml index 765e4a8c9..4d1e140c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ dynamic = ["version", "dependencies"] description = "A framework for modelling build pipelines in YAML" readme = "README.rst" license = "Apache-2.0" -requires-python = ">=3.10" +requires-python = ">=3.11" authors = [ { name = "The Apache Software Foundation", email = "dev@buildstream.apache.org" }, ] @@ -38,7 +38,6 @@ classifiers = [ "Intended Audience :: Developers", "Operating System :: POSIX", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", @@ -58,7 +57,7 @@ Tracker = "https://github.com/apache/buildstream/issues" bst = "buildstream._frontend:cli" [tool.black] -target-version = ["py310", "py311", "py312", "py313", "py314", "py315"] +target-version = ["py311", "py312", "py313", "py314", "py315"] line-length = 119 exclude = ''' ( diff --git a/requirements/cov-requirements.txt b/requirements/cov-requirements.txt index a8f44bbaf..4318ae236 100644 --- a/requirements/cov-requirements.txt +++ b/requirements/cov-requirements.txt @@ -1,12 +1,9 @@ -coverage==7.15.4 +coverage==7.16.2 pytest-cov==7.1.0 -pytest==9.0.3 -Cython==3.2.4 +pytest==9.1.1 +Cython==3.3.0 ## The following requirements were added by pip freeze: -exceptiongroup==1.3.1 -iniconfig==2.3.0 -packaging==26.2 -pluggy==1.6.0 -Pygments==2.20.0 -tomli==2.4.1 -typing_extensions==4.15.0 +iniconfig==2.3.1 +packaging==26.3 +pluggy==1.7.0 +Pygments==2.21.0 diff --git a/requirements/dev-requirements.txt b/requirements/dev-requirements.txt index 25307fc60..81049e928 100644 --- a/requirements/dev-requirements.txt +++ b/requirements/dev-requirements.txt @@ -1,26 +1,26 @@ pexpect==4.9.0 -pylint==4.0.5 +pylint==4.1.3 # Pytest 6.0.0 doesn't play well with pylint -pytest==9.0.3 +pytest==9.1.1 pytest-datafiles==3.0.1 -pytest-env==1.6.0 +pytest-env==1.8.1 pytest-xdist==3.8.0 pytest-timeout==2.4.0 pyftpdlib==2.2.0 ## The following requirements were added by pip freeze: -astroid==4.0.4 +astroid==4.3.4 dill==0.4.1 -exceptiongroup==1.3.1 execnet==2.1.2 -iniconfig==2.3.0 -isort==8.0.1 +iniconfig==2.3.1 +isort==9.0.2 mccabe==0.7.0 -packaging==26.2 -platformdirs==4.9.6 -pluggy==1.6.0 +mypy_extensions==1.1.0 +packaging==26.3 +platformdirs==4.13.5 +pluggy==1.7.0 ptyprocess==0.7.0 -Pygments==2.20.0 -python-dotenv==1.2.2 -tomli==2.4.1 -tomlkit==0.14.0 -typing_extensions==4.15.0 +pyasynchat==1.0.5 +pyasyncore==1.0.5 +Pygments==2.21.0 +python-dotenv==1.2.4 +tomlkit==0.15.2 diff --git a/requirements/requirements.txt b/requirements/requirements.txt index 081193959..7b3d2a7c4 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1,14 +1,14 @@ -click==8.3.3 -grpcio==1.80.0 +click==8.5.0 +grpcio==1.84.0 Jinja2==3.1.6 -packaging==26.2 +packaging==26.3 pluginbase==1.0.1 -protobuf==7.34.1 +protobuf==7.36.2 psutil==7.2.2 ruamel.yaml==0.19.1 ruamel.yaml.clib==0.2.15 -pyroaring==1.1.0 -ujson==5.12.0 +pyroaring==1.2.0 +ujson==6.0.0 ## The following requirements were added by pip freeze: -MarkupSafe==3.0.3 -typing_extensions==4.15.0 +MarkupSafe==3.0.4 +typing_extensions==4.16.0 diff --git a/setup.py b/setup.py index f2094bb77..365720fdf 100755 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ # Python requirements ################################################################## REQUIRED_PYTHON_MAJOR = 3 -REQUIRED_PYTHON_MINOR = 10 +REQUIRED_PYTHON_MINOR = 11 if sys.version_info[0] != REQUIRED_PYTHON_MAJOR or sys.version_info[1] < REQUIRED_PYTHON_MINOR: print("BuildStream requires Python >= " + str(REQUIRED_PYTHON_MAJOR) + "." + str(REQUIRED_PYTHON_MINOR)) diff --git a/src/buildstream/_artifact.py b/src/buildstream/_artifact.py index fc196bcff..6fbedcb41 100644 --- a/src/buildstream/_artifact.py +++ b/src/buildstream/_artifact.py @@ -288,10 +288,7 @@ def cache( # Capture queued files and store returned digests digests = self._cas.add_objects(paths=[entry[0] for entry in files_to_capture]) - # add_objects() should guarantee this. - # `zip(..., strict=True)` could be used in Python 3.10+ - assert len(files_to_capture) == len(digests) - for entry, digest in zip(files_to_capture, digests): + for entry, digest in zip(files_to_capture, digests, strict=True): entry[1].CopyFrom(digest) # store build dependencies diff --git a/src/buildstream/_cas/casdprocessmanager.py b/src/buildstream/_cas/casdprocessmanager.py index 3744617e3..926e5f561 100644 --- a/src/buildstream/_cas/casdprocessmanager.py +++ b/src/buildstream/_cas/casdprocessmanager.py @@ -20,7 +20,6 @@ import shutil import stat import subprocess -import sys import tempfile import time from subprocess import CalledProcessError @@ -146,12 +145,6 @@ def __init__( self._start_time = time.time() self._logfile = self._rotate_and_get_next_logfile() - # Create a new process group for buildbox-casd such that SIGINT won't reach it. - if sys.version_info >= (3, 11): - process_group_kwargs = {"process_group": 0} - else: - process_group_kwargs = {"preexec_fn": os.setpgrp} - with open(self._logfile, "w", encoding="utf-8") as logfile_fp: # The frontend will take care of terminating buildbox-casd. self.process = subprocess.Popen( # pylint: disable=consider-using-with @@ -160,7 +153,7 @@ def __init__( stdout=logfile_fp, stderr=subprocess.STDOUT, env=self.__buildbox_casd_env(), - **process_group_kwargs, + process_group=0, # Create a new process group for buildbox-casd such that SIGINT won't reach it ) self._casd_channel = None diff --git a/src/buildstream/_scheduler/resources.py b/src/buildstream/_scheduler/resources.py index 736227f44..9591faf15 100644 --- a/src/buildstream/_scheduler/resources.py +++ b/src/buildstream/_scheduler/resources.py @@ -105,7 +105,9 @@ def reserve(self, resources, exclusive=None, *, peek=False): # available. If we don't have enough, the job cannot be # scheduled. for resource in resources: - if self._max_resources[resource] > 0 and self._used_resources[resource] >= self._max_resources[resource]: + if ( # pylint: disable=chained-comparison + self._max_resources[resource] > 0 and self._used_resources[resource] >= self._max_resources[resource] + ): return False # Now we register the fact that our job is using the resources diff --git a/tox.ini b/tox.ini index e820dec31..68664b10e 100644 --- a/tox.ini +++ b/tox.ini @@ -16,7 +16,7 @@ # Tox global configuration # [tox] -envlist = py{310,311,312,313,314,315} +envlist = py{311,312,313,314,315} skip_missing_interpreters = true isolated_build = true @@ -33,30 +33,30 @@ BST_PLUGINS_VERSION = 79649529cffb695d0d22195ed9a4910c80ca6907 # 2.5.0 [testenv] usedevelop = # This is required by Cython in order to get coverage for cython files. - py{310,311,312,313,314,315}-!nocover: True + py{311,312,313,314,315}-!nocover: True commands = # Running with coverage reporting enabled - py{310,311,312,313,314,315}-!plugins-!nocover: pytest --basetemp {envtmpdir} --cov=buildstream --cov-config .coveragerc {posargs} + py{311,312,313,314,315}-!plugins-!nocover: pytest --basetemp {envtmpdir} --cov=buildstream --cov-config .coveragerc {posargs} # Running with coverage reporting disabled - py{310,311,312,313,314,315}-!plugins-nocover: pytest --basetemp {envtmpdir} {posargs} + py{311,312,313,314,315}-!plugins-nocover: pytest --basetemp {envtmpdir} {posargs} # Running external plugins tests with coverage reporting enabled - py{310,311,312,313,314,315}-plugins-!nocover: pytest --basetemp {envtmpdir} --cov=buildstream --cov-config .coveragerc --plugins {posargs} + py{311,312,313,314,315}-plugins-!nocover: pytest --basetemp {envtmpdir} --cov=buildstream --cov-config .coveragerc --plugins {posargs} # Running external plugins tests with coverage disabled - py{310,311,312,313,314,315}-plugins-nocover: pytest --basetemp {envtmpdir} --plugins {posargs} + py{311,312,313,314,315}-plugins-nocover: pytest --basetemp {envtmpdir} --plugins {posargs} commands_post: - py{310,311,312,313,314,315}-!nocover: mkdir -p .coverage-reports - py{310,311,312,313,314,315}-!nocover: mv {envtmpdir}/.coverage {toxinidir}/.coverage-reports/.coverage.{env:COVERAGE_PREFIX:}{envname} + py{311,312,313,314,315}-!nocover: mkdir -p .coverage-reports + py{311,312,313,314,315}-!nocover: mv {envtmpdir}/.coverage {toxinidir}/.coverage-reports/.coverage.{env:COVERAGE_PREFIX:}{envname} deps = - py{310,311,312,313,314,315}: -rrequirements/requirements.txt - py{310,311,312,313,314,315}: -rrequirements/dev-requirements.txt - py{310,311,312,313,314,315}: git+https://github.com/apache/buildstream-plugins.git@{env:BST_PLUGINS_VERSION:{[config]BST_PLUGINS_VERSION}} + py{311,312,313,314,315}: -rrequirements/requirements.txt + py{311,312,313,314,315}: -rrequirements/dev-requirements.txt + py{311,312,313,314,315}: git+https://github.com/apache/buildstream-plugins.git@{env:BST_PLUGINS_VERSION:{[config]BST_PLUGINS_VERSION}} # Install local sample plugins for testing pip plugin origins - py{310,311,312,313,314,315}: {toxinidir}/tests/plugins/sample-plugins + py{311,312,313,314,315}: {toxinidir}/tests/plugins/sample-plugins # Install external plugins for plugin tests - py{310,311,312,313,314,315}-plugins: git+https://gitlab.com/buildstream/buildstream-plugins-community.git@{env:BST_PLUGINS_COMMUNITY_VERSION:{[config]BST_PLUGINS_COMMUNITY_VERSION}}#egg=bst_plugins_community[deb] + py{311,312,313,314,315}-plugins: git+https://gitlab.com/buildstream/buildstream-plugins-community.git@{env:BST_PLUGINS_COMMUNITY_VERSION:{[config]BST_PLUGINS_COMMUNITY_VERSION}}#egg=bst_plugins_community[deb] # Only require coverage and pytest-cov when using it !nocover: -rrequirements/cov-requirements.txt @@ -84,18 +84,18 @@ passenv = # These keys are not inherited by any other sections # setenv = - py{310,311,312,313,314,315}: COVERAGE_FILE = {envtmpdir}/.coverage - py{310,311,312,313,314,315}: BST_TEST_HOME = {envtmpdir} - py{310,311,312,313,314,315}: BST_TEST_XDG_CACHE_HOME = {envtmpdir}/cache - py{310,311,312,313,314,315}: BST_TEST_XDG_CONFIG_HOME = {envtmpdir}/config - py{310,311,312,313,314,315}: BST_TEST_XDG_DATA_HOME = {envtmpdir}/share + py{311,312,313,314,315}: COVERAGE_FILE = {envtmpdir}/.coverage + py{311,312,313,314,315}: BST_TEST_HOME = {envtmpdir} + py{311,312,313,314,315}: BST_TEST_XDG_CACHE_HOME = {envtmpdir}/cache + py{311,312,313,314,315}: BST_TEST_XDG_CONFIG_HOME = {envtmpdir}/config + py{311,312,313,314,315}: BST_TEST_XDG_DATA_HOME = {envtmpdir}/share # This is required to get coverage for Cython - py{310,311,312,313,314,315}-!nocover: BST_CYTHON_TRACE = 1 + py{311,312,313,314,315}-!nocover: BST_CYTHON_TRACE = 1 randomized: PYTEST_ADDOPTS="--random-order-bucket=global" allowlist_externals = - py{310,311,312,313,314,315}: + py{311,312,313,314,315}: mv mkdir