summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects/snippets.py
Commit message (Collapse)AuthorAgeFilesLines
* refactor: avoid possible breaking change in iterator (#2107)John Villalovos2022-06-271-4/+10
| | | | | | | | Commit b6447211754e126f64e12fc735ad74fe557b7fb4 inadvertently introduced a possible breaking change as it added a new argument `iterator` and added it in between existing (potentially positional) arguments. This moves the `iterator` argument to the end of the argument list and requires it to be a keyword-only argument.
* feat(downloads): allow streaming downloads access to response iterator (#1956)Tom Catshoek2022-06-261-5/+11
| | | | | | | | | | | | | | | * 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
* chore: move `RequiredOptional` to the `gitlab.types` moduleJohn L. Villalovos2022-05-311-1/+2
| | | | | | By having `RequiredOptional` in the `gitlab.base` module it makes it difficult with circular imports. Move it to the `gitlab.types` module which has no dependencies on any other gitlab module.
* feat: display human-readable attribute in `repr()` if presentNejc Habjan2022-05-081-2/+2
|
* fix: use url-encoded ID in all pathsJohn L. Villalovos2022-01-131-2/+2
| | | | | | | | | | | | Make sure all usage of the ID in the URL path is encoded. Normally it isn't an issue as most IDs are integers or strings which don't contain a slash ('/'). But when the ID is a string with a slash character it will break things. Add a test case that shows this fixes wikis issue with subpages which use the slash character. Closes: #1079
* docs: use annotations for return typesdocs/sphinx-annotationsNejc Habjan2021-12-011-3/+3
|
* docs: only use type annotations for documentationNejc Habjan2021-11-281-7/+7
|
* chore: add type-hints to gitlab/v4/objects/snippets.pyjlvillal/mypy_snippetsJohn L. Villalovos2021-11-141-4/+32
|
* refactor: use new-style formatting for named placeholdersNejc Habjan2021-11-081-2/+2
|
* refactor: use f-strings for string formattingNejc Habjan2021-11-051-2/+2
|
* chore: convert to using type-annotations for managersJohn L. Villalovos2021-09-081-5/+0
| | | | | | | | | | | | | Convert our manager usage to be done via type annotations. Now to define a manager to be used in a RESTObject subclass can simply do: class ExampleClass(CRUDMixin, RESTObject): my_manager: MyManager Any type-annotation that annotates it to be of type *Manager (with the exception of RESTManager) will cause the manager to be created on the object.
* chore: improve type-hinting for managersJohn L. Villalovos2021-09-071-0/+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: fix import ordering using isortJohn L. Villalovos2021-05-251-2/+2
| | | | | | Fix the import ordering using isort. https://pycqa.github.io/isort/
* chore: fix F401 errors reported by flake8John L. Villalovos2021-04-181-3/+3
| | | | | | F401: Module imported but unused https://www.flake8rules.com/rules/F401.html
* chore: have _create_attrs & _update_attrs be a namedtupleJohn L. Villalovos2021-04-171-7/+13
| | | | | | Convert _create_attrs and _update_attrs to use a NamedTuple (RequiredOptional) to help with code readability. Update all code to use the NamedTuple.
* chore: remove usage of 'from ... import *'John L. Villalovos2021-02-231-2/+2
| | | | | | | | | | | | | | | | | | 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.
* refactor(api): explicitly export classes for star importsrefactor/split-objectsNejc Habjan2021-02-071-1/+9
|
* refactor(v4): split objects and managers per API resourceNejc Habjan2021-02-071-0/+110