Skip to content

Commit be28283

Browse files
Preliminary, but added minimalistic typing check to tox and CI, as well as a py.typed file.
- The py.typed file is very early, but it's necessary to verify type completeness via `pyright --verifytypes`. Seems like the right kind of typing check, but that's assuming pyright and not mypy is ultimately used. - Reference: https://microsoft.github.io/pyright/#/typed-libraries?id=verifying-type-completeness - Add typing testenv to tox.ini, which will run `pyright --verifytypes rfc3986`. - Add one more matrix slot to the GitHub workflow to run the above typing check in CI on the lowest supported version of python on Ubuntu. - I only added it for Ubuntu because this package and its dependencies are pure python, so the types shouldn't change between operating systems.
1 parent c28dc0a commit be28283

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

.github/workflows/main.yml

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ jobs:
1919
- os: windows-latest
2020
python: '3.12'
2121
toxenv: py
22+
# typing
23+
- os: ubuntu-latest
24+
python: '3.8'
25+
toxenv: typing
2226
# misc
2327
- os: ubuntu-latest
2428
python: '3.12'

src/rfc3986/py.typed

Whitespace-only changes.

tox.ini

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py{37,38,39,310,311,312},lint
2+
envlist = py{37,38,39,310,311,312},lint,typing
33

44
[testenv]
55
pip_pre = False
@@ -39,6 +39,11 @@ deps =
3939
flake8-import-order
4040
commands = flake8 {posargs} src/rfc3986
4141

42+
[testenv:typing]
43+
deps =
44+
pyright
45+
commands = pyright {posargs:--verifytypes rfc3986}
46+
4247
[testenv:venv]
4348
commands = {posargs}
4449

0 commit comments

Comments
 (0)