-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add type hints * Fix ci * Install pyOpenSSL for docs for intersphinx * Clarify * Zap stray setting * Fix ServiceID protocol Co-authored-by: Tin Tvrtković <[email protected]> * Clarify * Add typing example * Only check API types across versions * Clarify --------- Co-authored-by: Tin Tvrtković <[email protected]>
- Loading branch information
Showing
14 changed files
with
225 additions
and
103 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,14 +6,13 @@ build-backend = "hatchling.build" | |
name = "service-identity" | ||
authors = [{ name = "Hynek Schlawack", email = "[email protected]" }] | ||
license = "MIT" | ||
requires-python = ">=3.7" | ||
requires-python = ">=3.8" | ||
description = "Service identity verification for pyOpenSSL & cryptography." | ||
keywords = ["cryptography", "openssl", "pyopenssl"] | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
|
@@ -23,22 +22,23 @@ classifiers = [ | |
"Programming Language :: Python :: Implementation :: PyPy", | ||
"Topic :: Security :: Cryptography", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Typing :: Typed", | ||
] | ||
dependencies = [ | ||
# Keep in-sync with tests/constraints/*. | ||
"attrs>=19.1.0", | ||
"pyasn1-modules", | ||
"pyasn1", | ||
"cryptography", | ||
"importlib_metadata;python_version<'3.8'", | ||
] | ||
dynamic = ["version", "readme"] | ||
|
||
[project.optional-dependencies] | ||
idna = ["idna"] | ||
tests = ["coverage[toml]>=5.0.2", "pytest"] | ||
docs = ["sphinx", "furo", "myst-parser", "sphinx-notfound-page"] | ||
dev = ["service-identity[tests,docs,idna]", "pyOpenSSL"] | ||
docs = ["sphinx", "furo", "myst-parser", "sphinx-notfound-page", "pyOpenSSL"] | ||
mypy = ["mypy", "types-pyOpenSSL", "idna"] | ||
dev = ["service-identity[tests,mypy,docs,idna]", "pyOpenSSL"] | ||
|
||
[project.urls] | ||
Documentation = "https://service-identity.readthedocs.io/" | ||
|
@@ -105,6 +105,22 @@ source = ["src", ".tox/py*/**/site-packages"] | |
[tool.coverage.report] | ||
show_missing = true | ||
skip_covered = true | ||
exclude_lines = [ | ||
# a more strict default pragma | ||
"\\# pragma: no cover\\b", | ||
|
||
# allow defensive code | ||
"^\\s*raise AssertionError\\b", | ||
"^\\s*raise NotImplementedError\\b", | ||
"^\\s*return NotImplemented\\b", | ||
"^\\s*raise$", | ||
|
||
# typing-related code | ||
"^if (False|TYPE_CHECKING):", | ||
": \\.\\.\\.(\\s*#.*)?$", | ||
"^ +\\.\\.\\.$", | ||
"-> ['\"]?NoReturn['\"]?:", | ||
] | ||
|
||
|
||
[tool.black] | ||
|
@@ -152,3 +168,23 @@ ignore = [ | |
[tool.ruff.isort] | ||
lines-between-types = 1 | ||
lines-after-imports = 2 | ||
|
||
|
||
[tool.mypy] | ||
strict = true | ||
|
||
show_error_codes = true | ||
enable_error_code = ["ignore-without-code"] | ||
ignore_missing_imports = true | ||
|
||
[[tool.mypy.overrides]] | ||
module = "tests.*" | ||
ignore_errors = true | ||
|
||
[[tool.mypy.overrides]] | ||
module = "tests.typing.*" | ||
ignore_errors = false | ||
|
||
[[tool.mypy.overrides]] | ||
module = "cryptography.*" | ||
follow_imports = "skip" |
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.