10000 Merge pull request #2 from python-gitlab/main · python-gitlab/python-gitlab@1b9db33 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1b9db33

Browse files
authored
Merge pull request #2 from python-gitlab/main
meh
2 parents 412d92d + 0ceebd0 commit 1b9db33

File tree

13 files changed

+124
-24
lines changed

13 files changed

+124
-24
lines changed

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
sphinx:
2323
runs-on: ubuntu-22.04
2424
steps:
25-
- uses: actions/checkout@v4.1.7
25+
- uses: actions/checkout@v4.2.0
2626
- name: Set up Python
2727
uses: actions/setup-python@v5.2.0
2828
with:
@@ -42,7 +42,7 @@ jobs:
4242
twine-check:
4343
runs-on: ubuntu-22.04
4444
steps:
45-
- uses: actions/checkout@v4.1.7
45+
- uses: actions/checkout@v4.2.0
4646
- name: Set up Python
4747
uses: actions/setup-python@v5.2.0
4848
with:

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
lint:
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@v4.1.7
25+
- uses: actions/checkout@v4.2.0
2626
with:
2727
fetch-depth: 0
2828
- uses: actions/setup-python@v5.2.0

.github/workflows/pre_commit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
pre_commit:
3030
runs-on: ubuntu-latest
3131
steps:
32-
- uses: actions/checkout@v4.1.7
32+
- uses: actions/checkout@v4.2.0
3333
- uses: actions/setup-python@v5.2.0
3434
with:
3535
python-version: "3.11"

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ jobs:
1414
id-token: write
1515
environment: pypi.org
1616
steps:
17-
- uses: actions/checkout@v4.1.7
17+
- uses: actions/checkout@v4.2.0
1818
with:
1919
fetch-depth: 0
2020
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
2121

2222
- name: Python Semantic Release
2323
id: release
24-
uses: python-semantic-release/python-semantic-release@v9.8.8
24+
uses: python-semantic-release/python-semantic-release@v9.9.0
2525
with:
2626
github_token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
2727

@@ -32,7 +32,7 @@ jobs:
3232
if: steps.release.outputs.released == 'true'
3333

3434
- name: Publish package distributions to GitHub Releases
35-
uses: python-semantic-release/upload-to-gh-release@fa2bbbf8e61069551abd513fdc5627e14c8637c7 # v9.8.8
35+
uses: python-semantic-release/upload-to-gh-release@0a92b5d7ebfc15a84f9801ebd1bf706343d43711 # v9.8.9
3636
if: steps.release.outputs.released == 'true'
3737
with:
3838
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
version: "3.12"
4949
toxenv: py312,smoke
5050
steps:
51-
- uses: actions/checkout@v4.1.7
51+
- uses: actions/checkout@v4.2.0
5252
- name: Set up Python ${{ matrix.python.version }}
5353
uses: actions/setup-python@v5.2.0
5454
with:
@@ -66,7 +66,7 @@ jobs:
6666
matrix:
6767
toxenv: [api_func_v4, cli_func_v4]
6868
steps:
69-
- uses: actions/checkout@v4.1.7
69+
- uses: actions/checkout@v4.2.0
7070
- name: Set up Python
7171
uses: actions/setup-python@v5.2.0
7272
with:
@@ -88,7 +88,7 @@ jobs:
8888
coverage:
8989
runs-on: ubuntu-22.04
9090
steps:
91-
- uses: actions/checkout@v4.1.7
91+
- uses: actions/checkout@v4.2.0
9292
- name: Set up Python ${{ matrix.python-version }}
9393
uses: actions/setup-python@v5.2.0
9494
with:
@@ -112,7 +112,7 @@ jobs:
112112
runs-on: ubuntu-latest
113113
name: Python wheel
114114
steps:
115-
- uses: actions/checkout@v4.1.7
115+
- uses: actions/checkout@v4.2.0
116116
- uses: actions/setup-python@v5.2.0
117117
with:
118118
python-version: "3.12"
@@ -130,7 +130,7 @@ jobs:
130130
runs-on: ubuntu-latest
131131
needs: [dist]
132132
steps:
133-
- uses: actions/checkout@v4.1.7
133+
- uses: actions/checkout@v4.2.0
134134
- name: Set up Python
135135
uses: actions/setup-python@v5.2.0
136136
with:

.gitlab-ci.yml

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,44 @@
11
image: python:3.12
22

33
stages:
4+
- build
45
- deploy
56
- promote
67

7-
deploy-images:
8-
stage: deploy
8+
build-images:
9+
stage: build
910
image:
1011
name: gcr.io/kaniko-project/executor:debug
1112
entrypoint: [""]
1213
script:
13-
- executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-alpine
14-
- executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-slim-bullseye --build-arg PYTHON_FLAVOR=slim-bullseye
14+
- executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE/$OS_ARCH:$CI_COMMIT_TAG-alpine
15+
- executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE/$OS_ARCH:$CI_COMMIT_TAG-slim-bullseye --build-arg PYTHON_FLAVOR=slim-bullseye
16+
rules:
17+
- if: $CI_COMMIT_TAG
18+
tags:
19+
- $RUNNER_TAG
20+
parallel:
21+
matrix:
22+
# See tags in https://docs.gitlab.com/ee/ci/runners/hosted_runners/linux.html
23+
- RUNNER_TAG: saas-linux-medium-amd64
24+
OS_ARCH: linux/amd64
25+
- RUNNER_TAG: saas-linux-medium-arm64
26+
OS_ARCH: linux/arm64
27+
28+
deploy-images:
29+
stage: deploy
30+
image:
31+
name: mplatform/manifest-tool:alpine-v2.0.4@sha256:38b399ff66f9df247af59facceb7b60e2cd01c2d649aae318da7587efb4bbf87
32+
entrypoint: [""]
33+
script:
34+
- manifest-tool --username $CI_REGISTRY_USER --password $CI_REGISTRY_PASSWORD push from-args
35+
--platforms linux/amd64,linux/arm64
36+
--template $CI_REGISTRY_IMAGE/OS/ARCH:$CI_COMMIT_TAG-alpine
37+
--target $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-alpine
38+
- manifest-tool --username $CI_REGISTRY_USER --password $CI_REGISTRY_PASSWORD push from-args
39+
--platforms linux/amd64,linux/arm64
40+
--template $CI_REGISTRY_IMAGE/OS/ARCH:$CI_COMMIT_TAG-slim-bullseye
41+
--target $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG-slim-bullseye
1542
rules:
1643
- if: $CI_COMMIT_TAG
1744

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repos:
77
hooks:
88
- id: black
99
- repo: https://github.com/commitizen-tools/commitizen
10-
rev: v3.29.0
10+
rev: v3.29.1
1111
hooks:
1212
- id: commitizen
1313
stages: [commit-msg]
@@ -20,7 +20,7 @@ repos:
2020
hooks:
2121
- id: isort
2222
- repo: https://github.com/pycqa/pylint
23-
rev: v3.2.7
23+
rev: v3.3.1
2424
hooks:
2525
- id: pylint
2626
additional_dependencies:
@@ -51,6 +51,6 @@ repos:
5151
- id: rst-directive-colons
5252
- id: rst-inline-touching-normal
5353
- repo: https://github.com/maxbrunet/pre-commit-renovate
54-
rev: 38.80.0
54+
rev: 38.103.1
5555
hooks:
5656
- id: renovate-config-validator

CHANGELOG.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,75 @@
11
# CHANGELOG
22

3+
## v4.12.2 (2024-10-01)
4+
5+
### Fix
6+
7+
* fix: raise GitlabHeadError in `project.files.head()` method (#3006)
8+
9+
When an error occurs, raise `GitlabHeadError` in
10+
`project.files.head()` method.
11+
12+
Closes: #3004 ([`9bf26df`](https://github.com/python-gitlab/python-gitlab/commit/9bf26df9d1535ca2881c43706a337a972b737fa0))
13+
14+
## v4.12.1 (2024-09-30)
15+
16+
### Chore
17+
18+
* chore(deps): update all non-major dependencies (#3000)
19+
20+
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> ([`d3da326`](https://github.com/python-gitlab/python-gitlab/commit/d3da326828274ed0c5f76b01a068519d360995c8))
21+
22+
* chore(deps): update gitlab/gitlab-ee docker tag to v17.4.1-ee.0 ([`64eed5d`](https://github.com/python-gitlab/python-gitlab/commit/64eed5d388252135a42a252b9100ffc75d9fb0ea))
23+
24+
### Fix
25+
26+
* fix(ci): do not rely on GitLab.com runner arch variables (#3003) ([`c848d12`](https://github.com/python-gitlab/python-gitlab/commit/c848d12252763c32fc2b1c807e7d9887f391a761))
27+
28+
* fix(files): correctly raise GitlabGetError in get method ([`190ec89`](https://github.com/python-gitlab/python-gitlab/commit/190ec89bea12d7eec719a6ea4d15706cfdacd159))
29+
30+
## v4.12.0 (2024-09-28)
31+
32+
### Chore
33+
34+
* chore(deps): update all non-major dependencies ([`ae132e7`](https://github.com/python-gitlab/python-gitlab/commit/ae132e7a1efef6b0ae2f2a7d335668784648e3c7))
35+
36+
* chore: update pylint to 3.3.1 and resolve issues (#2997)
37+
38+
pylint 3.3.1 appears to have added "too-many-positional-arguments"
39+
check with a value of 5.
40+
41+
I don't disagree with this, but we have many functions which exceed
42+
this value. We might think about converting some of positional
43+
arguments over to keyword arguments in the future. But that is for
44+
another time.
45+
46+
For now disable the check across the project. ([`a0729b8`](https://github.com/python-gitlab/python-gitlab/commit/a0729b83e63bcd74f522bf57a87a5800b1cf19d1))
47+
48+
* chore(deps): update dependency types-setuptools to v75 ([`a2ab54c`](https://github.com/python-gitlab/python-gitlab/commit/a2ab54ceb40eca1e6e71f7779a418591426b2b2c))
49+
50+
* chore(deps): update gitlab/gitlab-ee docker tag to v17.4.0-ee.0 ([`8601808`](https://github.com/python-gitlab/python-gitlab/commit/860180862d952ed25cf95df1a4f825664f7e1c4b))
51+
52+
* chore(deps): update all non-major dependencies ([`10ee58a`](https://github.com/python-gitlab/python-gitlab/commit/10ee58a01fdc8071f29ae0095d9ea8a4424fa728))
53+
54+
* chore(deps): update gitlab/gitlab-ee docker tag to v17.3.2-ee.0 ([`5cd1ab2`](https://github.com/python-gitlab/python-gitlab/commit/5cd1ab202e3e7b64d626d2c4e62b1662a4285015))
55+
56+
### Feature
57+
58+
* feat(build): build multi-arch images (#2987) ([`29f617d`](https://github.com/python-gitlab/python-gitlab/commit/29f617d7d368636791baf703ecdbd22583356674))
59+
60+
* feat: introduce related_issues to merge requests (#2996) ([`174d992`](https://github.com/python-gitlab/python-gitlab/commit/174d992e49f1e5171fee8893a1713f30324bbf97))
61+
62+
### Fix
63+
64+
* fix(api): head requests for projectfilemanager (#2977)
65+
66+
* fix(api): head requests for projectfilemanager
67+
68+
---------
69+
70+
Co-authored-by: Patrick Evans <patrick.evans@gehealthcare.com>
71+
Co-authored-by: Nejc Habjan <hab.nejc@gmail.com> ([`96a18b0`](https://github.com/python-gitlab/python-gitlab/commit/96a18b065dac4ce612a128f03e2fc6d1b4ccd69e))
72+
373
## v4.11.1 (2024-09-13)
474

575
### Fix

gitlab/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
__email__ = "gauvainpocentek@gmail.com"
44
__license__ = "LGPL3"
55
__title__ = "python-gitlab"
6-
__version__ = "4.11.1"
6+
__version__ = "4.12.2"

gitlab/v4/objects/files.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ class ProjectFileManager(CreateMixin, UpdateMixin, DeleteMixin, RESTManager):
112112
@cli.register_custom_action(
113113
cls_names="ProjectFileManager", required=("file_path", "ref")
114114
)
115+
@exc.on_http_error(exc.GitlabGetError)
115116
def get(self, file_path: str, ref: str, **kwargs: Any) -> ProjectFile:
116117
"""Retrieve a single file.
117118
@@ -136,6 +137,7 @@ def get(self, file_path: str, ref: str, **kwargs: Any) -> ProjectFile:
136137
assert isinstance(server_data, dict)
137138
return self._obj_cls(self, server_data)
138139

140+
@exc.on_http_error(exc.GitlabHeadError)
139141
def head(
140142
self, file_path: str, ref: str, **kwargs: Any
141143
) -> "requests.structures.CaseInsensitiveDict[Any]":

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ disable = [
124124
"too-many-instance-attributes",
125125
"too-many-lines",
126126
"too-many-locals",
127+
"too-many-positional-arguments",
127128
"too-many-public-methods",
128129
"too-many-statements",
129130
"unsubscriptable-object",

requirements-lint.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
-r requirements.txt
22
argcomplete==2.0.0
33
black==24.8.0
4-
commitizen==3.29.0
4+
commitizen==3.29.1
55
flake8==7.1.1
66
isort==5.13.2
77
mypy==1.11.2
8-
pylint==3.2.7
8+
pylint==3.3.1
99
pytest==8.3.3
1010
responses==0.25.3
1111
respx==0.21.1
12-
types-PyYAML==6.0.12.20240808
12+
types-PyYAML==6.0.12.20240917
1313
types-requests==2.32.0.20240914
1414
types-setuptools==75.1.0.20240917

tests/functional/fixtures/.env

Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
GITLAB_IMAGE=gitlab/gitlab-ee
2-
GITLAB_TAG=17.4.0-ee.0
2+
GITLAB_TAG=17.4.1-ee.0