| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|\
| |
| | |
fix: handle tags like debian/2%2.6-21 as identifiers
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Git refnames are relatively free-form and can contain all sort for
special characters, not just `/` and `#`, see
http://git-scm.com/docs/git-check-ref-format
In particular, Debian's DEP-14 standard for storing packaging in git
repositories mandates the use of the `%` character in tags in some
cases like `debian/2%2.6-21`.
Unfortunately python-gitlab currently only escapes `/` to `%2F` and in
some cases `#` to `%23`. This means that when using the commit API to
retrieve information about the `debian/2%2.6-21` tag only the slash is
escaped before being inserted in the URL path and the `%` is left
untouched, resulting in something like
`/api/v4/projects/123/repository/commits/debian%2F2%2.6-21`. When
urllib3 seees that it detects the invalid `%` escape and then urlencodes
the whole string, resulting in
`/api/v4/projects/123/repository/commits/debian%252F2%252.6-21`, where
the original `/` got escaped twice and produced `%252F`.
To avoid the issue, fully urlencode identifiers and parameters to avoid
the urllib3 auto-escaping in all cases.
Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
|
| |
| |
| |
| |
| |
| |
| | |
* Added type-hints for gitlab/mixins.py
* Changed use of filter with a lambda expression to
list-comprehension. mypy was not able to understand the previous
code. Also list-comprehension is better :)
|
|\ \
| | |
| | | |
chore: add type hints to gitlab/base.py:RESTManager
|
| |/
| |
| |
| | |
Add some additional type hints to gitlab/base.py
|
|\ \
| |/
|/| |
chore: Put assert statements inside 'if TYPE_CHECKING:'
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
To be safe that we don't assert while running, put the assert
statements, which are used by mypy to check that types are correct,
inside an 'if TYPE_CHECKING:' block.
Also, instead of asserting that the item is a dict, instead assert
that it is not a requests.Response object. Theoretically the JSON
could return as a list or dict, though at this time we are assuming a
dict.
|
|/
|
|
|
| |
Remove usage of 'import *' in
gitlab/v4/objects/project_access_tokens.py.
|
|
|
|
|
|
|
|
|
|
| |
Don't allow a partially annotated function definition. Either none of
the function is annotated or all of it must be.
Update code to ensure no-more partially annotated functions.
Update gitlab/cli.py with better type-hints. Changed Tuple[Any, ...]
to Tuple[str, ...]
|
|\
| |
| | |
chore(api): move repository endpoints into separate module
|
| | |
|
|\ \
| | |
| | | |
chore: add and fix some type-hints in gitlab/client.py
|
| | |
| | |
| | |
| | | |
Was able to figure out better type-hints for gitlab/client.py
|
|\ \ \
| |_|/
|/| | |
chore: add additional type-hints for gitlab/base.py
|
| |/
| |
| |
| |
| |
| |
| | |
Add type-hints for the variables which are set via self.__dict__
mypy doesn't see them when they are assigned via self.__dict__. So
declare them in the class definition.
|
|\ \
| |/
|/| |
feat(users): add follow/unfollow API
|
| | |
|
|\ \
| | |
| | | |
chore: add type-hints to gitlab/client.py
|
| | |
| | |
| | |
| | | |
Adding some initial type-hints to gitlab/client.py
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Initially when extracting out the gitlab/client.py code we tried to
remove this but functional tests failed.
Later we fixed the functional test that was failing, so now remove the
unneeded import.
|
|/ /
| |
| |
| | |
Determined the base class for obj_cls and adding type-hints for it.
|
|\ \
| | |
| | | |
chore: add type-hints to gitlab/cli.py
|
| | | |
|
|/ /
| |
| |
| |
| | |
The classes UserStatus and UserStatusManager were each declared twice.
Remove the duplicate declarations.
|
|\ \
| | |
| | | |
Add type-hints to gitlab/const.py
|
| | | |
|
|\ \ \
| | | |
| | | | |
chore: add type hints to gitlab/utils.py
|
| |/ / |
|
|\ \ \
| | | |
| | | | |
chore: add type-hints to gitlab/config.py
|
| |/ / |
|
|/ /
| |
| |
| |
| | |
Discovered this when I ran flake8 on the file. Unfortunately I was the
one who introduced this wrong variable name :(
|
|\ \
| |/
|/| |
chore: remove usage of 'from ... import *'
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In gitlab/v4/objects/*.py remove usage of:
* from gitlab.base import *
* from gitlab.mixins import *
Change them to:
* from gitlab.base import CLASS_NAME
* from gitlab.mixins import CLASS_NAME
Programmatically update code to explicitly import needed classes only.
After the change the output of:
$ flake8 gitlab/v4/objects/*py | grep 'REST\|Mixin'
Is empty. Before many messages about unable to determine if it was a
valid name.
|
| |
| |
| | |
Co-authored-by: Nejc Habjan <hab.nejc@gmail.com>
|
|/ |
|
|
|
|
| |
Discovered that there were some undefined names.
|
|
|
|
|
|
| |
The function _construct_url() was used by the v3 API. All usage of the
function was removed in commit
fe89b949922c028830dd49095432ba627d330186
|
| |
|
|
|
|
| |
Add an initial mypy test to test gitlab/base.py and gitlab/__init__.py
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In gitlab/client.py remove usage of:
* from gitlab.const import *
* from gitlab.exceptions import *
Change them to:
* import gitlab.const
* import gitlab.exceptions
Update code to explicitly reference things in gitlab.const and
gitlab.exceptions
A flake8 run no longer lists any undefined variables. Before it listed
possible undefined variables.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As we only support the v4 Gitlab API, explicitly import
gitlab.v4.objects and gitlab.v4.clie instead of dynamically importing
it depending on the API version.
This has the added benefit of mypy being able to type check the Gitlab
__init__() function as currently it will fail if we enable type
checking of __init__() it will fail.
Also, this also helps by not confusing tools like pyinstaller/cx_freeze with
dynamic imports so you don't need hooks for standalone executables. And
according to https://docs.gitlab.com/ee/api/,
"GraphQL co-exists with the current v4 REST API. If we have a v5 API, this
should be a compatibility layer on top of GraphQL."
|
|
|
|
| |
Helps getting the real state of the project from the server.
|
| |
|
|\
| |
| | |
feat: add project audit endpoint
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
| |
Move the classes Gitlab and GitlabList from gitlab/__init__.py to the
newly created gitlab/client.py file.
Update one test case that was depending on requests being defined in
gitlab/__init__.py
|
|
|
|
| |
See: https://docs.gitlab.com/ee/api/personal_access_tokens.html
|