summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects/releases.py
Commit message (Collapse)AuthorAgeFilesLines
* refactor: use new-style formatting for named placeholdersNejc Habjan2021-11-081-2/+2
|
* chore: enforce type-hints on most files in gitlab/v4/objects/jlvillal/mypy_small_files_1John L. Villalovos2021-11-081-0/+12
| | | | | | | * 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.
* chore: convert to using type-annotations for managersJohn L. Villalovos2021-09-081-1/+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/+2
| | | | | | | | | | | | | | | 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
* fix(api): do not require Release name for creationEric Davies2021-07-271-1/+1
| | | | | Stop requiring a `name` attribute for creating a Release, since a release name has not been required since GitLab 12.5.
* feat(release): allow to update releasePierre Paques2021-06-261-3/+6
| | | | Release API now supports PUT.
* chore: fix import ordering using isortJohn L. Villalovos2021-05-251-1/+0
| | | | | | Fix the import ordering using isort. https://pycqa.github.io/isort/
* fix: add a check to ensure the MRO is correctJohn L. Villalovos2021-04-241-1/+1
| | | | | | | | | | | | | | | Add a check to ensure the MRO (Method Resolution Order) is correct for classes in gitlab.v4.objects when doing type-checking. An example of an incorrect definition: class ProjectPipeline(RESTObject, RefreshMixin, ObjectDeleteMixin): ^^^^^^^^^^ This should be at the end. Correct way would be: class ProjectPipeline(RefreshMixin, ObjectDeleteMixin, RESTObject): Correctly at the end ^^^^^^^^^^ Also fix classes which have the issue.
* chore: fix F401 errors reported by flake8John L. Villalovos2021-04-181-2/+0
| | | | | | 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-4/+8
| | | | | | 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.
* feat(objects): add Release Links API supportNejc Habjan2021-02-211-0/+36