| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Enable the `mypy` `strict_equality` check.
|
| |
|
|
|
|
|
|
| |
As requested in #1604.
Co-authored-by: John Villalovos <john@sodarock.com>
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Commit f0152dc3cc9a42aa4dc3c0014b4c29381e9b39d6 removed situation
where `get()` in a `GetWithoutIdMixin` based class could return `None`
Update the type-hints to no longer return `Optional` AKA `None`
|
|
|
|
|
|
|
|
|
|
|
| |
`list()`
`as_list=False` is confusing as it doesn't explain what is being
returned. Replace it with `iterator=True` which more clearly explains
to the user that an iterator/generator will be returned.
This maintains backward compatibility with `as_list` but does issue a
DeprecationWarning if `as_list` is set.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Create a new ArrayAttribute class. This is to indicate types which are
sent to the GitLab server as arrays
https://docs.gitlab.com/ee/api/#array
At this stage it is identical to the CommaSeparatedListAttribute class
but will be used later to support the array types sent to GitLab.
This is the second step in a series of steps of our goal to add full
support for the GitLab API data types[1]:
* array
* hash
* array of hashes
Step one was: commit 5127b1594c00c7364e9af15e42d2e2f2d909449b
[1] https://docs.gitlab.com/ee/api/#encoding-api-parameters-of-array-and-hash-types
Related: #1698
|
|
|
|
|
|
|
|
|
|
|
| |
This name more accurately describes what the type is. Also this is the
first step in a series of steps of our goal to add full support for
the GitLab API data types[1]:
* array
* hash
* array of hashes
[1] https://docs.gitlab.com/ee/api/#encoding-api-parameters-of-array-and-hash-types
|
|
|
|
|
|
|
|
| |
Updated a few remaining usages of `self.id` to use `self.encoded_id`
as for the most part we shouldn't be using `self.id`
There are now only a few (4 lines of code) remaining uses of
`self.id`, most of which seem that they should stay that way.
|
|
|
|
|
|
|
| |
There is an optional `squash_option` parameter which can be used when
creating Projects and UserProjects.
Closes #1744
|
|
|
|
|
|
|
| |
Add the get() methods for the GetWithoutIdMixin based classes.
Update the tests/meta/test_ensure_type_hints.py tests to check to
ensure that the get methods are defined with the correct return type.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Fix classes which don't have correct 'get()' methods for classes
derived from GetMixin.
Add a unit test which verifies that classes have the correct return
type in their 'get()' method.
|
| |
|
| |
|
| |
|
|\
| |
| | |
chore: add type-hints to gitlab/v4/objects/users.py
|
| |
| |
| |
| | |
Adding type-hints to gitlab/v4/objects/users.py
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 the import ordering using isort.
https://pycqa.github.io/isort/
|
| |
|
|
|
|
|
|
| |
F401: Module imported but unused
https://www.flake8rules.com/rules/F401.html
|
|
|
|
|
|
| |
Convert _create_attrs and _update_attrs to use a NamedTuple
(RequiredOptional) to help with code readability. Update all code to
use the NamedTuple.
|
|\
| |
| | |
feat(users): add follow/unfollow API
|
| | |
|
| |
| |
| |
| |
| | |
The classes UserStatus and UserStatusManager were each declared twice.
Remove the duplicate declarations.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|