Python-gitlab

Latest version: v5.6.0

Safety actively analyzes 723119 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 13

23.1.0

12.4

- Send python-gitlab version as user-agent
([`c22d49d`](https://github.com/python-gitlab/python-gitlab/commit/c22d49d084d1e03426cfab0d394330f8ab4bd85a))

- **auth**: Remove deprecated session auth
([`b751cdf`](https://github.com/python-gitlab/python-gitlab/commit/b751cdf424454d3859f3f038b58212e441faafaf))

- **doc**: Remove refs to api v3 in docs
([`6beeaa9`](https://github.com/python-gitlab/python-gitlab/commit/6beeaa993f8931d6b7fe682f1afed2bd4c8a4b73))

- **test**: Unused unittest2, type -> isinstance
([`33b1801`](https://github.com/python-gitlab/python-gitlab/commit/33b180120f30515d0f76fcf635cb8c76045b1b42))

Testing

- Remove warning about open files from test_todo()
([`d6419aa`](https://github.com/python-gitlab/python-gitlab/commit/d6419aa86d6ad385e15d685bf47242bb6c67653e))

When running unittests python warns that the json file from test_todo() was still open. Use with to
open, read, and create encoded json data that is used by resp_get_todo().

- **projects**: Support `approval_rules` endpoint for projects
([`94bac44`](https://github.com/python-gitlab/python-gitlab/commit/94bac4494353e4f597df0251f0547513c011e6de))

5.6.0

Features

- **group**: Add support for group level MR approval rules
([`304bdd0`](https://github.com/python-gitlab/python-gitlab/commit/304bdd09cd5e6526576c5ec58cb3acd7e1a783cb))

5.5.0

Chores

- Add deprecation warning for mirror_pull functions
([`7f6fd5c`](https://github.com/python-gitlab/python-gitlab/commit/7f6fd5c3aac5e2f18adf212adbce0ac04c7150e1))

- Relax typing constraints for response action
([`f430078`](https://github.com/python-gitlab/python-gitlab/commit/f4300782485ee6c38578fa3481061bd621656b0e))

- **tests**: Catch deprecation warnings
([`0c1af08`](https://github.com/python-gitlab/python-gitlab/commit/0c1af08bc73611d288f1f67248cff9c32c685808))

Documentation

- Add usage of pull mirror
([`9b374b2`](https://github.com/python-gitlab/python-gitlab/commit/9b374b2c051f71b8ef10e22209b8e90730af9d9b))

- Remove old pull mirror implementation
([`9e18672`](https://github.com/python-gitlab/python-gitlab/commit/9e186726c8a5ae70ca49c56b2be09b34dbf5b642))

Features

- **functional**: Add pull mirror test
([`3b31ade`](https://github.com/python-gitlab/python-gitlab/commit/3b31ade152eb61363a68cf0509867ff8738ccdaf))

- **projects**: Add pull mirror class
([`2411bff`](https://github.com/python-gitlab/python-gitlab/commit/2411bff4fd1dab6a1dd70070441b52e9a2927a63))

- **unit**: Add pull mirror tests
([`5c11203`](https://github.com/python-gitlab/python-gitlab/commit/5c11203a8b281f6ab34f7e85073fadcfc395503c))

5.4.0

Bug Fixes

- **api**: Make type ignores more specific where possible
([`e3cb806`](https://github.com/python-gitlab/python-gitlab/commit/e3cb806dc368af0a495087531ee94892d3f240ce))

Instead of using absolute ignore ` type: ignore` use a more specific ignores like ` type:
ignore[override]`. This might help in the future where a new bug might be introduced and get
ignored by a general ignore comment but not a more specific one.

Signed-off-by: Igor Ponomarev <igor.ponomarevcollabora.com>

- **api**: Return the new commit when calling cherry_pick
([`de29503`](https://github.com/python-gitlab/python-gitlab/commit/de29503262b7626421f3bffeea3ff073e63e3865))

- **files**: Add optional ref parameter for cli project-file raw (python-gitlab3032)
([`22f03bd`](https://github.com/python-gitlab/python-gitlab/commit/22f03bdc2bac92138225563415f5cf6fa36a5644))

The ef parameter was removed in python-gitlab v4.8.0. This will add ef back as an optional parameter
for the project-file raw cli command.

Chores

- Fix missing space in deprecation message
([`ba75c31`](https://github.com/python-gitlab/python-gitlab/commit/ba75c31e4d13927b6a3ab0ce427800d94e5eefb4))

- Fix pytest deprecation
([`95db680`](https://github.com/python-gitlab/python-gitlab/commit/95db680d012d73e7e505ee85db7128050ff0db6e))

pytest has changed the function argument name to `start_path`

- Fix warning being generated
([`0eb5eb0`](https://github.com/python-gitlab/python-gitlab/commit/0eb5eb0505c5b837a2d767cfa256a25b64ceb48b))

The CI shows a warning. Use `get_all=False` to resolve issue.

- Resolve DeprecationWarning message in CI run
([`accd5aa`](https://github.com/python-gitlab/python-gitlab/commit/accd5aa757ba5215497c278da50d48f10ea5a258))

Catch the DeprecationWarning in our test, as we expect it.

- **ci**: Set a 30 minute timeout for 'functional' tests
([`e8d6953`](https://github.com/python-gitlab/python-gitlab/commit/e8d6953ec06dbbd817852207abbbc74eab8a27cf))

Currently the functional API test takes around 17 minutes to run. And the functional CLI test takes
around 12 minutes to run.

Occasionally a job gets stuck and will sit until the default 360 minutes job timeout occurs.

Now have a 30 minute timeout for the 'functional' tests.

- **deps**: Update all non-major dependencies
([`939505b`](https://github.com/python-gitlab/python-gitlab/commit/939505b9c143939ba1e52c5cb920d8aa36596e19))

- **deps**: Update all non-major dependencies
([`cbd4263`](https://github.com/python-gitlab/python-gitlab/commit/cbd4263194fcbad9d6c11926862691f8df0dea6d))

- **deps**: Update gitlab ([3088](https://github.com/python-gitlab/python-gitlab/pull/3088),
[`9214b83`](https://github.com/python-gitlab/python-gitlab/commit/9214b8371652be2371823b6f3d531eeea78364c7))

Co-authored-by: renovate[bot] <29139614+renovate[bot]users.noreply.github.com>

- **deps**: Update gitlab/gitlab-ee docker tag to v17.7.1-ee.0
([3082](https://github.com/python-gitlab/python-gitlab/pull/3082),
[`1e95944`](https://github.com/python-gitlab/python-gitlab/commit/1e95944119455875bd239752cdf0fe5cc27707ea))

Co-authored-by: renovate[bot] <29139614+renovate[bot]users.noreply.github.com>

- **deps**: Update mypy to 1.14 and resolve issues
([`671e711`](https://github.com/python-gitlab/python-gitlab/commit/671e711c341d28ae0bc61ccb12d2e986353473fd))

mypy 1.14 has a change to Enum Membership Semantics:
https://mypy.readthedocs.io/en/latest/changelog.html

Resolve the issues with Enum and typing, and update mypy to 1.14

- **test**: Prevent 'job_with_artifact' fixture running forever
([`e4673d8`](https://github.com/python-gitlab/python-gitlab/commit/e4673d8aeaf97b9ad5d2500e459526b4cf494547))

Previously the 'job_with_artifact' fixture could run forever. Now give it up to 60 seconds to
complete before failing.

Continuous Integration

- Use gitlab-runner:v17.7.1 for the CI
([`2dda9dc`](https://github.com/python-gitlab/python-gitlab/commit/2dda9dc149668a99211daaa1981bb1f422c63880))

The `latest` gitlab-runner image does not have the `gitlab-runner` user and it causes our tests to
fail.

Closes: 3091

Features

- **api**: Add argument that appends extra HTTP headers to a request
([`fb07b5c`](https://github.com/python-gitlab/python-gitlab/commit/fb07b5cfe1d986c3a7cd7879b11ecc43c75542b7))

Currently the only way to manipulate the headers for a request is to use `Gitlab.headers` attribute.
However, this makes it very concurrently unsafe because the `Gitlab` object can be shared between
multiple requests at the same time.

Instead add a new keyword argument `extra_headers` which will update the headers dictionary with new
values just before the request is sent.

For example, this can be used to download a part of a artifacts file using the `Range` header:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests

Signed-off-by: Igor Ponomarev <igor.ponomarevcollabora.com>

- **api**: Add support for external status check
([`175b355`](https://github.com/python-gitlab/python-gitlab/commit/175b355d84d54a71f15fe3601c5275dc35984b9b))

- **api**: Narrow down return type of download methods using typing.overload
([`44fd9dc`](https://github.com/python-gitlab/python-gitlab/commit/44fd9dc1176a2c5529c45cc3186c0e775026175e))

Currently the download methods such as `ProjectJob.artifacts` have return type set to
`Optional[Union[bytes, Iterator[Any]]]` which means they return either `None` or `bytes` or
`Iterator[Any]`.

However, the actual return type is determined by the passed `streamed` and `iterator` arguments.
Using `typing.overload` decorator it is possible to return a single type based on the passed
arguments.

Add overloads in the following order to all download methods:

1. If `streamed=False` and `iterator=False` return `bytes`. This is the default argument values
therefore it should be first as it will be used to lookup default arguments. 2. If `iterator=True`
return `Iterator[Any]`. This can be combined with both `streamed=True` and `streamed=False`. 3. If
`streamed=True` and `iterator=False` return `None`. In this case `action` argument can be set to a
callable that accepts `bytes`.

Signed-off-by: Igor Ponomarev <igor.ponomarevcollabora.com>

- **api**: Narrow down return type of ProjectFileManager.raw using typing.overload
([`36d9b24`](https://github.com/python-gitlab/python-gitlab/commit/36d9b24ff27d8df514c1beebd0fff8ad000369b7))

This is equivalent to the changes in 44fd9dc1176a2c5529c45cc3186c0e775026175e but for
`ProjectFileManager.raw` method that I must have missed in the original commit.

Signed-off-by: Igor Ponomarev <igor.ponomarevcollabora.com>

5.3.1

Bug Fixes

- **api**: Allow configuration of keep_base_url from file
([`f4f7d7a`](https://github.com/python-gitlab/python-gitlab/commit/f4f7d7a63716f072eb45db2c7f590db0435350f0))

- **registry-protection**: Fix api url
([`8c1aaa3`](https://github.com/python-gitlab/python-gitlab/commit/8c1aaa3f6a797caf7bd79a7da083eae56c6250ff))

See:
https://docs.gitlab.com/ee/api/container_repository_protection_rules.html#list-container-repository-protection-rules

Chores

- Bump to 5.3.1
([`912e1a0`](https://github.com/python-gitlab/python-gitlab/commit/912e1a0620a96c56081ffec284c2cac871cb7626))

- **deps**: Update dependency jinja2 to v3.1.5 [security]
([`01d4194`](https://github.com/python-gitlab/python-gitlab/commit/01d41946cbb1a4e5f29752eac89239d635c2ec6f))

Page 1 of 13

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.