diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 90f7d3fd5..899f8fabf 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -22,9 +22,9 @@ jobs: sphinx: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v6.0.1 + - uses: actions/checkout@v6.0.2 - name: Set up Python - uses: actions/setup-python@v6.1.0 + uses: actions/setup-python@v6.2.0 with: python-version: "3.14" - name: Install dependencies @@ -37,9 +37,9 @@ jobs: twine-check: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v6.0.1 + - uses: actions/checkout@v6.0.2 - name: Set up Python - uses: actions/setup-python@v6.1.0 + uses: actions/setup-python@v6.2.0 with: python-version: "3.14" - name: Install dependencies diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 01bee8a33..7a0dd38dc 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,10 +22,10 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6.0.1 + - uses: actions/checkout@v6.0.2 with: fetch-depth: 0 - - uses: actions/setup-python@v6.1.0 + - uses: actions/setup-python@v6.2.0 with: python-version: "3.14" - run: pip install --upgrade tox diff --git a/.github/workflows/pre_commit.yml b/.github/workflows/pre_commit.yml index 4be228d66..993606750 100644 --- a/.github/workflows/pre_commit.yml +++ b/.github/workflows/pre_commit.yml @@ -29,8 +29,8 @@ jobs: pre_commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6.0.1 - - uses: actions/setup-python@v6.1.0 + - uses: actions/checkout@v6.0.2 + - uses: actions/setup-python@v6.2.0 with: python-version: "3.14" - name: install tox diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ff04716dd..01829b244 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: id-token: write environment: pypi.org steps: - - uses: actions/checkout@v6.0.1 + - uses: actions/checkout@v6.0.2 with: fetch-depth: 0 token: ${{ secrets.RELEASE_GITHUB_TOKEN }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index e4fd014a5..167deac9b 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -17,7 +17,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v10.1.1 + - uses: actions/stale@v10.2.0 with: operations-per-run: 500 stale-issue-label: "stale" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0f2af115e..829a8603d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,9 +46,9 @@ jobs: version: "3.14" toxenv: py314,smoke steps: - - uses: actions/checkout@v6.0.1 + - uses: actions/checkout@v6.0.2 - name: Set up Python ${{ matrix.python.version }} - uses: actions/setup-python@v6.1.0 + uses: actions/setup-python@v6.2.0 with: python-version: ${{ matrix.python.version }} - name: Install dependencies @@ -65,9 +65,9 @@ jobs: matrix: toxenv: [api_func_v4, cli_func_v4] steps: - - uses: actions/checkout@v6.0.1 + - uses: actions/checkout@v6.0.2 - name: Set up Python - uses: actions/setup-python@v6.1.0 + uses: actions/setup-python@v6.2.0 with: python-version: "3.14" - name: Install dependencies @@ -87,9 +87,9 @@ jobs: coverage: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v6.0.1 + - uses: actions/checkout@v6.0.2 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6.1.0 + uses: actions/setup-python@v6.2.0 with: python-version: "3.14" - name: Install dependencies @@ -111,8 +111,8 @@ jobs: runs-on: ubuntu-latest name: Python wheel steps: - - uses: actions/checkout@v6.0.1 - - uses: actions/setup-python@v6.1.0 + - uses: actions/checkout@v6.0.2 + - uses: actions/setup-python@v6.2.0 with: python-version: "3.14" - name: Install dependencies @@ -120,7 +120,7 @@ jobs: pip install -r requirements-test.txt - name: Build package run: python -m build -o dist/ - - uses: actions/upload-artifact@v6.0.0 + - uses: actions/upload-artifact@v7.0.0 with: name: dist path: dist @@ -129,12 +129,12 @@ jobs: runs-on: ubuntu-latest needs: [dist] steps: - - uses: actions/checkout@v6.0.1 + - uses: actions/checkout@v6.0.2 - name: Set up Python - uses: actions/setup-python@v6.1.0 + uses: actions/setup-python@v6.2.0 with: python-version: '3.14' - - uses: actions/download-artifact@v7.0.0 + - uses: actions/download-artifact@v8.0.0 with: name: dist path: dist diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ef93b5552..30f22fb1d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,11 +3,11 @@ default_language_version: repos: - repo: https://github.com/psf/black - rev: 25.12.0 + rev: 26.3.0 hooks: - id: black - repo: https://github.com/commitizen-tools/commitizen - rev: v4.11.6 + rev: v4.13.9 hooks: - id: commitizen stages: [commit-msg] @@ -20,7 +20,7 @@ repos: hooks: - id: isort - repo: https://github.com/pycqa/pylint - rev: v4.0.4 + rev: v4.0.5 hooks: - id: pylint additional_dependencies: @@ -51,6 +51,6 @@ repos: - id: rst-directive-colons - id: rst-inline-touching-normal - repo: https://github.com/maxbrunet/pre-commit-renovate - rev: 42.84.0 + rev: 43.60.0 hooks: - id: renovate-config-validator diff --git a/CHANGELOG.md b/CHANGELOG.md index ef85c5019..7168b6f88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,50 @@ All versions below are listed in reverse chronological order. +## v8.1.0 (2026-02-28) + +### Bug Fixes + +- **types**: Add explicit submodule import for pyright compatibility + ([`84ad3fd`](https://github.com/python-gitlab/python-gitlab/commit/84ad3fd19cfbc236e962ac77c910571b0888c000)) + +### Features + +- **api**: Add support for order_by filter in runner jobs + ([`d5dc73d`](https://github.com/python-gitlab/python-gitlab/commit/d5dc73d0f82a15d96a956c1d868c253c9586e1bf)) + +- **api**: Add support for sort filter in runner jobs + ([`b117ee3`](https://github.com/python-gitlab/python-gitlab/commit/b117ee3d139f422e463ebeb5007517a2052af8a4)) + + +## v8.0.0 (2026-01-28) + +### Bug Fixes + +- Actually define project repr_attr + ([`4187a69`](https://github.com/python-gitlab/python-gitlab/commit/4187a69420dd7b2e60c2d833ab246aec745d35cb)) + +- File save start_branch as a body attribute + ([`1001d93`](https://github.com/python-gitlab/python-gitlab/commit/1001d934e8c36cc3b14408b46b41030bf705a294)) + +### Chores + +- **black**: Run black v26 on code + ([`4a8d82b`](https://github.com/python-gitlab/python-gitlab/commit/4a8d82bec8f09fa142e8134589a0f40ef4f9c3be)) + +- **precommit**: Update dependency black to v26 + ([`ad43b76`](https://github.com/python-gitlab/python-gitlab/commit/ad43b763acdcd8d7db832972921fb071ea0a826f)) + +### Features + +- **graphql**: Update to gql 4.0.0 + ([`6f0da67`](https://github.com/python-gitlab/python-gitlab/commit/6f0da671b4586b23232ae89d57622254fa8a7945)) + +### Breaking Changes + +- **graphql**: GraphQL.execute() no longer accepts graphql.Source + + ## v7.1.0 (2025-12-28) ### Bug Fixes diff --git a/gitlab/_version.py b/gitlab/_version.py index 8305f3a6c..9ec122c99 100644 --- a/gitlab/_version.py +++ b/gitlab/_version.py @@ -3,4 +3,4 @@ __email__ = "gauvainpocentek@gmail.com" __license__ = "LGPL3" __title__ = "python-gitlab" -__version__ = "7.1.0" +__version__ = "8.1.0" diff --git a/gitlab/v4/objects/files.py b/gitlab/v4/objects/files.py index 757d16eeb..3bcf931a2 100644 --- a/gitlab/v4/objects/files.py +++ b/gitlab/v4/objects/files.py @@ -29,6 +29,7 @@ class ProjectFile(SaveMixin, ObjectDeleteMixin, RESTObject): file_path: str manager: ProjectFileManager content: str # since the `decode()` method uses `self.content` + start_branch: str | None = None def decode(self) -> bytes: """Returns the decoded content of the file. @@ -41,7 +42,11 @@ def decode(self) -> bytes: # NOTE(jlvillal): Signature doesn't match SaveMixin.save() so ignore # type error def save( # type: ignore[override] - self, branch: str, commit_message: str, **kwargs: Any + self, + branch: str, + commit_message: str, + start_branch: str | None = None, + **kwargs: Any, ) -> None: """Save the changes made to the file to the server. @@ -50,6 +55,7 @@ def save( # type: ignore[override] Args: branch: Branch in which the file will be updated commit_message: Message to send with the commit + start_branch: Name of the branch to start the new branch from **kwargs: Extra options to send to the server (e.g. sudo) Raises: @@ -58,6 +64,7 @@ def save( # type: ignore[override] """ self.branch = branch self.commit_message = commit_message + self.start_branch = start_branch self.file_path = utils.EncodedId(self.file_path) super().save(**kwargs) diff --git a/gitlab/v4/objects/projects.py b/gitlab/v4/objects/projects.py index 035b9b861..751ac4c1f 100644 --- a/gitlab/v4/objects/projects.py +++ b/gitlab/v4/objects/projects.py @@ -178,6 +178,8 @@ class Project( _repr_attr = "path_with_namespace" _upload_path = "/projects/{id}/uploads" + path_with_namespace: str + access_tokens: ProjectAccessTokenManager accessrequests: ProjectAccessRequestManager additionalstatistics: ProjectAdditionalStatisticsManager diff --git a/gitlab/v4/objects/repositories.py b/gitlab/v4/objects/repositories.py index 71935caaa..a621cda43 100644 --- a/gitlab/v4/objects/repositories.py +++ b/gitlab/v4/objects/repositories.py @@ -17,6 +17,8 @@ if TYPE_CHECKING: # When running mypy we use these as the base classes + import gitlab.base + _RestObjectBase = gitlab.base.RESTObject else: _RestObjectBase = object diff --git a/gitlab/v4/objects/runners.py b/gitlab/v4/objects/runners.py index e4a37e8e3..ba7256cf5 100644 --- a/gitlab/v4/objects/runners.py +++ b/gitlab/v4/objects/runners.py @@ -38,7 +38,7 @@ class RunnerJobManager(ListMixin[RunnerJob]): _path = "/runners/{runner_id}/jobs" _obj_cls = RunnerJob _from_parent_attrs = {"runner_id": "id"} - _list_filters = ("status",) + _list_filters = ("status", "order_by", "sort") class Runner(SaveMixin, ObjectDeleteMixin, RESTObject): diff --git a/requirements-lint.txt b/requirements-lint.txt index c559885b2..220f0c407 100644 --- a/requirements-lint.txt +++ b/requirements-lint.txt @@ -1,14 +1,14 @@ -r requirements.txt argcomplete==2.0.0 -black==26.1.0 -commitizen==4.11.6 +black==26.3.1 +commitizen==4.13.9 flake8==7.3.0 -isort==7.0.0 +isort==8.0.1 mypy==1.19.1 -pylint==4.0.4 +pylint==4.0.5 pytest==9.0.2 -responses==0.25.8 +responses==0.26.0 respx==0.22.0 types-PyYAML==6.0.12.20250915 types-requests==2.32.4.20260107 -types-setuptools==80.9.0.20251223 +types-setuptools==82.0.0.20260210 diff --git a/requirements-test.txt b/requirements-test.txt index e1e2b5d81..a6e9a82b1 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,13 +1,13 @@ -r requirements.txt anyio==4.12.1 build==1.4.0 -coverage==7.13.1 +coverage==7.13.4 pytest-console-scripts==1.4.1 pytest-cov==7.0.0 -pytest-github-actions-annotate-failures==0.3.0 +pytest-github-actions-annotate-failures==0.4.0 pytest==9.0.2 PyYaml==6.0.3 -responses==0.25.8 +responses==0.26.0 respx==0.22.0 -trio==0.32.0 -wheel==0.45.1 +trio==0.33.0 +wheel==0.46.3 diff --git a/tests/functional/fixtures/.env b/tests/functional/fixtures/.env index 617457fdc..a220cbfb4 100644 --- a/tests/functional/fixtures/.env +++ b/tests/functional/fixtures/.env @@ -1,4 +1,4 @@ GITLAB_IMAGE=gitlab/gitlab-ee -GITLAB_TAG=18.8.0-ee.0 +GITLAB_TAG=18.9.1-ee.0 GITLAB_RUNNER_IMAGE=gitlab/gitlab-runner GITLAB_RUNNER_TAG=96856197