| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Handle the case with the CLI where a list response is returned from
GitLab and json/yaml output is requested.
Add a functional CLI test to validate it works.
Closes: #2287
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Add a custom argparse help formatter that overrides the output
format to list items vertically.
The formatter is derived from argparse.HelpFormatter with minimal changes.
Co-authored-by: John Villalovos <john@sodarock.com>
Co-authored-by: Nejc Habjan <nejc.habjan@siemens.com>
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Enable the pylint "unused-argument" check and resolve issues it found.
* Quite a few functions were accepting `**kwargs` but not then
passing them on through to the next level. Now pass `**kwargs` to
next level.
* Other functions had no reason to accept `**kwargs`, so remove it
* And a few other fixes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* feat(downloads): allow streaming downloads access to response iterator
Allow access to the underlying response iterator when downloading in
streaming mode by specifying `iterator=True`.
Update type annotations to support this change.
* docs(api-docs): add iterator example to artifact download
Document the usage of the `iterator=True` option when downloading
artifacts
* test(packages): add tests for streaming downloads
|
|
|
|
|
| |
Make the parser name more user friendly by renaming from generic
"object" to "GitLab resource"
|
|\
| |
| | |
chore: enable more pylint checks
|
| |
| |
| |
| | |
Enable the pylint check "no-self-use" and fix the errors detected.
|
|/
|
|
|
| |
Rename the variables `whaction` and `action` to `resource_action` to
improve code-readability.
|
|\
| |
| | |
chore: rename `what` to `gitlab_resource`
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Naming a variable `what` makes it difficult to understand what it is
used for.
Rename it to `gitlab_resource` as that is what is being stored.
The Gitlab documentation talks about them being resources:
https://docs.gitlab.com/ee/api/api_resources.html
This will improve code readability.
|
|\ \
| |/
| | |
chore: rename `__call__()` to `run()` in GitlabCLI
|
| |
| |
| |
| | |
Less confusing to have it be a normal method.
|
|/
|
|
|
| |
Enable the 'consider-using-sys-exit' pylint check and fix errors
raised.
|
| |
|
|
|
|
|
| |
Since ac1c619cae6481833f5df91862624bf0380fef67 we delete parent arg keys
from the args dict so this has been trying to access the wrong attribute.
|
|
|
|
|
|
|
|
|
|
| |
Python 3.11 added an additional check in the argparse libary which
detected duplicate subparsers being added. We had duplicate subparsers
being added.
Make sure we don't add duplicate subparsers.
Closes: #2015
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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
|