| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
utils.EncodedId() has basically the same functionalityy of using
utils._url_encode(). So remove utils._url_encode() as we don't need
it.
|
|
|
|
|
|
|
|
|
|
| |
We were using `str.replace()` calls to take care of URL encoding
issues.
Switch them to use our `utils._url_encode()` function which itself uses
`urllib.parse.quote()`
Closes: #1356
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the CLI we need to make sure the components put into the path
portion of the URL are url-encoded. Otherwise they will be interpreted
as part of the path. For example can specify the project ID as a path,
but in the URL it must be url-encoded or it doesn't work.
Also stop adding the components of the path as query parameters in the
URL.
Closes: #783
Closes: #1498
|
|
|
|
|
|
|
|
| |
Fix pylint error "expression-not-assigned" and remove check from the
disabled list.
And I personally think it is much more readable now and is less lines
of code.
|
| |
|
|
|
|
|
|
|
| |
* Add type-hints to some of the files in gitlab/v4/objects/
* Fix issues detected when adding type-hints
* Changed mypy exclusion to explicitly list the 13 files that have
not yet had type-hints added.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The 'managers' are dynamically created. This unfortunately means that
we don't have any type-hints for them and so editors which understand
type-hints won't know that they are valid attributes.
* Add the type-hints for the managers we define.
* Add a unit test that makes sure that the type-hints and the
'_managers' attribute are kept in sync with each other.
* Add unit test that makes sure specified managers in '_managers'
have a name ending in 'Managers' to keep with current convention.
* Make RESTObject._managers always present with a default value of
None.
* Fix a type-issue revealed now that mypy knows what the type is
|
|
|
|
|
|
| |
* Add type-hints to gitlab/v4/cli.py
* Add required type-hints to other files based on adding type-hints
to gitlab/v4/cli.py
|
|
|
|
|
|
|
| |
Code was using inspect.getmro() to replicate the functionality of the
built-in function issubclass()
Switch to using issubclass()
|
|
|
|
|
|
| |
Fix the import ordering using isort.
https://pycqa.github.io/isort/
|
| |
|
|\
| |
| | |
chore: make Get.*Mixin._optional_get_attrs always present
|
| |
| |
| |
| |
| |
| |
| |
| | |
Always create GetMixin/GetWithoutIdMixin._optional_get_attrs attribute
with a default value of tuple()
This way we don't need to use hasattr() and we will know the type of
the attribute.
|
|\ \
| | |
| | | |
chore: make ListMixin._list_filters always present
|
| |/
| |
| |
| |
| |
| |
| |
| | |
Always create ListMixin._list_filters attribute with a default value
of tuple().
This way we don't need to use hasattr() and we will know the type of
the attribute.
|
|/
|
|
|
|
|
|
| |
Always create RESTObject._short_print_attrs with a default value of
None.
This way we don't need to use hasattr() and we will know the type of
the attribute.
|
|
|
|
|
|
| |
Convert _create_attrs and _update_attrs to use a NamedTuple
(RequiredOptional) to help with code readability. Update all code to
use the NamedTuple.
|
|
|
|
|
|
|
| |
Add the attributes: _create_attrs and _update_attrs to the RESTManager
class. This is so that we stop using getattr() if we don't need to.
This also helps with type-hints being available for these attributes.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to commit 3727cbd21fc40b312573ca8da56e0f6cf9577d08
RESTManager._from_parent_attrs did not exist unless it was explicitly
set. But commit 3727cbd21fc40b312573ca8da56e0f6cf9577d08 set it to a
default value of {}.
So the checks using hasattr() were no longer valid.
Update the checks to check if RESTManager._from_parent_attrs has a
value.
|
|
|
|
|
|
|
|
|
|
| |
We now create _types = {} in RESTManager class.
By making _types always present in RESTManager it makes the code
simpler. We no longer have to do:
types = getattr(self, "_types", {})
And the type checker now understands the type.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Fixes #717
Fixes #727
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Fixes #606
|
|
|
|
| |
Closes #559
|
| |
|
|
|
|
| |
Closes #548
|
|
|
|
| |
Closes #433
|
| |
|
|
|
|
|
|
|
|
| |
Some attributes need to be parsed/modified to work with the API (for
instance lists). This patch provides two attribute types that will
simplify parts of the code, and fix some CLI bugs.
Fixes #443
|
| |
|
| |
|
|
|
|
| |
Fixes #381
|
| |
|
| |
|
|
|
|
| |
Fixes #438
|
|
|
|
| |
Fixes #319
|
| |
|
| |
|
| |
|
|
|
|
| |
This mimics the v3 behavior.
|
|
|
|
|
|
| |
Verbose mode only works with the legacy output. Also add support for
filtering the output by defining the list of fields that need to be
displayed (yaml and json only).
|
|
|