Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Annotate the package. - Annotate the tests. - Run mypy in CI (in both Python 2 and Python 3 modes). - Publish the types with `py.typed` files.
- Loading branch information
Showing
13 changed files
with
215 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ omit= | |
precision = 1 | ||
exclude_lines = | ||
pragma: no cover | ||
if TYPE_CHECKING: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- "dependabot/**" | ||
pull_request: | ||
|
||
jobs: | ||
Lint: | ||
name: 'Lint' | ||
timeout-minutes: 10 | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.9' | ||
- name: Run lint | ||
run: ./lint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Typing | ||
mypy[python2]==0.910 | ||
# TODO: Switch to cryptography>=35.0.0 once it's released. | ||
types-cryptography>=3.3.3 | ||
types-pyopenssl>=20.0.4 | ||
py>=1.9.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# | ||
# This file is autogenerated by pip-compile with python 3.9 | ||
# To update, run: | ||
# | ||
# pip-compile lint-requirements.in | ||
# | ||
mypy[python2]==0.910 | ||
# via -r lint-requirements.in | ||
mypy-extensions==0.4.3 | ||
# via mypy | ||
py==1.10.0 | ||
# via -r lint-requirements.in | ||
toml==0.10.2 | ||
# via mypy | ||
typed-ast==1.4.3 | ||
# via mypy | ||
types-cryptography==3.3.3 | ||
# via | ||
# -r lint-requirements.in | ||
# types-pyopenssl | ||
types-enum34==0.1.8 | ||
# via types-cryptography | ||
types-ipaddress==0.1.5 | ||
# via types-cryptography | ||
types-pyopenssl==20.0.4 | ||
# via -r lint-requirements.in | ||
typing-extensions==3.10.0.0 | ||
# via mypy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
set -exu -o pipefail | ||
|
||
python -c "import sys, struct, ssl; print('#' * 70); print('python:', sys.version); print('version_info:', sys.version_info); print('bits:', struct.calcsize('P') * 8); print('openssl:', ssl.OPENSSL_VERSION, ssl.OPENSSL_VERSION_INFO); print('#' * 70)" | ||
|
||
python -m pip install -U pip setuptools wheel | ||
python -m pip --version | ||
|
||
# Dependencies | ||
|
||
python -m pip install -Ur lint-requirements.txt | ||
|
||
# Linting | ||
|
||
mypy trustme tests | ||
mypy -2 trustme tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The package is now type annotated. If you use mypy on code which uses ``trustme``, you should be able to remove any exclusions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.