Skip to content

Conversation

@JohnVillalovos
Copy link
Member

By adding the file: py.typed
it indicates that python-gitlab is a typed package and contains
type-hints.

https://www.python.org/dev/peps/pep-0561/

By adding the file: py.typed
it indicates that python-gitlab is a typed package and contains
type-hints.

https://www.python.org/dev/peps/pep-0561/
@codecov-commenter
Copy link

Codecov Report

Merging #1421 (e4421ca) into master (a6b6cd4) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1421   +/-   ##
=======================================
  Coverage   80.24%   80.24%           
=======================================
  Files          73       73           
  Lines        4064     4064           
=======================================
  Hits         3261     3261           
  Misses        803      803           
Flag Coverage Δ
unit 80.24% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a6b6cd4...e4421ca. Read the comment docs.

Copy link
Member

@nejch nejch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: does this mean we should probably do in .mypy.ini:

[mypy]
files = gitlab/**/*.py

So that we check this recursively with mypy as py.typed applies recursively, just in case.

Currently, this fails because of unit tests, but I've long thought we should unit and functional tests together, outside the source dir. (e.g. tools/functional -> tests/functional, gitlab/tests -> tests/unit)

@JohnVillalovos
Copy link
Member Author

JohnVillalovos commented Apr 28, 2021

question: does this mean we should probably do in .mypy.ini:

[mypy]
files = gitlab/**/*.py

So that we check this recursively with mypy as py.typed applies recursively, just in case.

Currently, this fails because of unit tests, but I've long thought we should unit and functional tests together, outside the source dir. (e.g. tools/functional -> tests/functional, gitlab/tests -> tests/unit)

I would like to wait on saying we mypy check everything. As I don't think we are ready.

This PR in my mind is just saying we do have type-hints so someone can use them. Also mypy will see that file and then not complain that there aren't type-hints. For example for a user of the library:

import gitlab      # With the PR mypy won't complain about no type-hints

Do we have type-hints for everything? No, but progress is being made and the type-hints we have are useful already and can be used by users of this library to help type-hint their code.

@nejch
Copy link
Member

nejch commented Apr 28, 2021

Ok makes sense :) Thanks!

@nejch nejch merged commit 98891eb into python-gitlab:master Apr 28, 2021
@JohnVillalovos JohnVillalovos deleted the jlvillal/typed_gitlab branch April 28, 2021 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants