summaryrefslogtreecommitdiff
path: root/gitlab/v4/cli.py
Commit message (Collapse)AuthorAgeFilesLines
* refactor: use f-strings for string formattingrefactor/f-stringsNejc Habjan2021-11-021-30/+30
|
* chore: improve type-hinting for managersJohn L. Villalovos2021-09-071-1/+4
| | | | | | | | | | | | | | | 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
* chore: add type-hints to gitlab/v4/cli.pyJohn L. Villalovos2021-05-311-39/+120
| | | | | | * 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
* chore: use built-in function issubclass() instead of getmro()John L. Villalovos2021-05-281-12/+10
| | | | | | | Code was using inspect.getmro() to replicate the functionality of the built-in function issubclass() Switch to using issubclass()
* chore: fix import ordering using isortJohn L. Villalovos2021-05-251-1/+1
| | | | | | Fix the import ordering using isort. https://pycqa.github.io/isort/
* fix(cli): fix parsing CLI objects to classnamesNejc Habjan2021-05-151-2/+2
|
* Merge pull request #1412 from JohnVillalovos/jlvillal/optional_get_attrsNejc Habjan2021-04-261-7/+4
|\ | | | | chore: make Get.*Mixin._optional_get_attrs always present
| * chore: make Get.*Mixin._optional_get_attrs always presentJohn L. Villalovos2021-04-241-7/+4
| | | | | | | | | | | | | | | | 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.
* | Merge pull request #1411 from JohnVillalovos/jlvillal/list_filtersMax Wittig2021-04-251-7/+4
|\ \ | | | | | | chore: make ListMixin._list_filters always present
| * | chore: make ListMixin._list_filters always presentJohn L. Villalovos2021-04-241-7/+4
| |/ | | | | | | | | | | | | | | 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.
* | chore: make RESTObject._short_print_attrs always presentJohn L. Villalovos2021-04-241-1/+1
|/ | | | | | | | 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.
* chore: have _create_attrs & _update_attrs be a namedtupleJohn L. Villalovos2021-04-171-4/+4
| | | | | | Convert _create_attrs and _update_attrs to use a NamedTuple (RequiredOptional) to help with code readability. Update all code to use the NamedTuple.
* chore: add _create_attrs & _update_attrs to RESTManagerJohn L. Villalovos2021-03-101-23/+12
| | | | | | | 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.
* fix: checking if RESTManager._from_parent_attrs is setJohn L. Villalovos2021-03-071-13/+7
| | | | | | | | | | | | 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.
* chore: make _types always present in RESTManagerJohn L. Villalovos2021-03-071-3/+2
| | | | | | | | | | 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.
* fix(cli): write binary data to stdout bufferNejc Habjan2020-10-121-0/+2
|
* chore(cli): remove python2 codeNejc Habjan2020-10-121-5/+1
|
* chore: remove remnants of python2 importsNejc Habjan2020-08-221-1/+0
|
* refactor: remove six dependencyMax Wittig2019-12-181-4/+2
|
* fix(cli): don't fail when the short print attr value is Nonexarx002019-07-211-2/+2
| | | | | Fixes #717 Fixes #727
* refactor: format everything blackrefactor/blackMax Wittig2019-05-161-108/+153
|
* Revert "Custom cli actions fix"revert-760-custom_cli_actions_fixMax Wittig2019-05-101-5/+5
|
* fix -/_ replacament for *Manager custom actionsKarol Ossowski2019-04-241-3/+3
|
* dont ask for id attr if this is *Manager originating custom actionKarol Ossowski2019-04-241-2/+2
|
* docs(cli): add PyYAML requirement noticeci-output-optionMax Wittig2018-10-091-6/+16
| | | | Fixes #606
* [cli] Fix the project-export downloadGauvain Pocentek2018-08-251-2/+24
| | | | Closes #559
* [cli] Fix the case where we have nothing to printGauvain Pocentek2018-07-121-2/+1
|
* [cli] Output: handle bytes in API responsesGauvain Pocentek2018-07-091-0/+3
| | | | Closes #548
* [cli] Fix the non-verbose output of ProjectCommitCommentGauvain Pocentek2018-06-221-1/+8
| | | | Closes #433
* Add project push rules configuration (#520)Eric Sabouraud2018-06-111-2/+3
|
* Implement attribute types to handle special casesGauvain Pocentek2018-03-171-0/+8
| | | | | | | | 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
* pep8 fixGauvain Pocentek2018-03-111-1/+2
|
* [cli] Fix listing of stringsGauvain Pocentek2018-03-111-0/+3
|
* [cli] Restore the --help option behaviorGauvain Pocentek2018-03-111-1/+1
| | | | Fixes #381
* [cli] _id_attr is required on creationGauvain Pocentek2018-03-021-2/+2
|
* CLI: display_list need to support **kwargsGauvain Pocentek2018-03-021-2/+2
|
* [cli] fix listing for json and yaml outputGauvain Pocentek2018-03-021-24/+35
| | | | Fixes #438
* Fix the CLI for objects without ID (API v4)Gauvain Pocentek2017-11-011-7/+12
| | | | Fixes #319
* adds project upload feature (#239)James Johnson2017-09-121-0/+2
|
* [v4] fix CLI for some mixin methodsGauvain Pocentek2017-09-071-3/+6
|
* [v4] Make sudo the first argument in CLI helpGauvain Pocentek2017-08-201-1/+1
|
* [v4] Use - instead of _ in CLI legacy outputGauvain Pocentek2017-08-201-3/+3
| | | | This mimics the v3 behavior.
* CLI: yaml and json outputs for v4Gauvain Pocentek2017-08-181-14/+45
| | | | | | 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).
* [v4] CLI support is backGauvain Pocentek2017-08-171-0/+296