| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
fix(types): prevent __dir__ in RestObject from producing duplicates
|
| | |
|
|/
|
|
|
|
| |
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.
|
|
|
|
| |
Add some additional type hints to gitlab/base.py
|
|
|
|
|
|
|
|
|
|
| |
Don't allow a partially annotated function definition. Either none of
the function is annotated or all of it must be.
Update code to ensure no-more partially annotated functions.
Update gitlab/cli.py with better type-hints. Changed Tuple[Any, ...]
to Tuple[str, ...]
|
|
|
|
|
|
|
| |
Add type-hints for the variables which are set via self.__dict__
mypy doesn't see them when they are assigned via self.__dict__. So
declare them in the class definition.
|
|\
| |
| | |
chore: add type-hints to gitlab/client.py
|
| |
| |
| |
| | |
Adding some initial type-hints to gitlab/client.py
|
|/
|
|
| |
Determined the base class for obj_cls and adding type-hints for it.
|
| |
|
| |
|
|
|
|
|
|
| |
This fixes and error, where deleted attributes would not show up
Fixes #1155
|
| |
|
|
|
|
| |
Co-Authored-By: Nejc Habjan <hab.nejc@gmail.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
To ease lists and sets manipulations.
|
|
|
|
| |
Drop the code, the tests, and update the documentation.
|
|
|
|
|
|
|
| |
This might happen in CLI context, where recursion to discover parent
attributes is not required (URL gets hardcoded)
Fix should fix the CLI CI.
|
|
|
|
|
|
|
|
| |
Make gitlab objects serializable
With current implementation of API v3 and v4 support, some instances
have properties of type module and are not serializable. Handle
these properties manually with setstate and getstate methods.
|
|
|
|
|
|
|
| |
Expose the X-* pagination attributes returned by the Gitlab server when
requesting lists.
Closes #304
|
|
|
|
|
|
| |
In v3 we create objects from json dicts when it makes sense. Support for
this feature has not been kept in v4, and we didn't get requests for it
so let's drop the _constructor_types definitions.
|
|
|
|
| |
Fixes #306
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Some things are probably broken. Next step is writting unit and
functional tests.
And fix.
|
|
|
|
| |
Convert User* to the new REST* API.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add new RESTObject and RESTManager base class, linked to a bunch of
Mixin class to implement the actual CRUD methods.
Object are generated by the managers, and special cases are handled in
the derivated classes.
Both ways (old and new) can be used together, migrate only a few v4
objects to the new method as a POC.
TODO: handle managers on generated objects (have to deal with attributes
in the URLs).
|
| |
|
|
|