From fb755910494f4598d22fb2721b6829700916d38d Mon Sep 17 00:00:00 2001 From: Alban Diquet Date: Thu, 9 Mar 2023 21:15:48 +0100 Subject: [PATCH] [#596] Update some dependencies including cryptography Keep version of sphinx that is compatible with 3.7 Refine versions simplify reqs --- dev-requirements.txt | 8 ++++---- setup.py | 4 ++-- tasks.py | 27 ++++++--------------------- 3 files changed, 12 insertions(+), 27 deletions(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 57996067..2517bdba 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,10 +1,10 @@ mypy==0.981 -flake8<5.0.0 -invoke<2.0.0 -pytest<8.0.0 +flake8 +invoke>=2,<3 +pytest==7.2.2 sphinx sphinx-rtd-theme -twine +twine>=4,<5 sphinx-autodoc-typehints black==22.10.0 pytest-cov diff --git a/setup.py b/setup.py index f71ac73f..c79dc668 100644 --- a/setup.py +++ b/setup.py @@ -99,10 +99,10 @@ def get_include_files() -> List[Tuple[str, str]]: # Dependencies install_requires=[ "nassl>=5,<6", - "cryptography>=2.6,<39", + "cryptography>=2.6,<40", "tls-parser>=2,<3", "pydantic>=1.7,<1.11", - "pyOpenSSL>=20,<23", + "pyOpenSSL>=20,<24", ], # cx_freeze info for Windows builds with Python embedded options={"build_exe": {"packages": ["cffi", "cryptography"], "include_files": get_include_files()}}, diff --git a/tasks.py b/tasks.py index f63ed464..97adb4aa 100644 --- a/tasks.py +++ b/tasks.py @@ -1,14 +1,5 @@ from pathlib import Path from sys import platform - -# Monkeypatch for Python 3.11 -# TODO: Remove after this is fixed: https://github.com/pyinvoke/invoke/issues/833 -import inspect - -if not hasattr(inspect, "getargspec"): - inspect.getargspec = inspect.getfullargspec # type: ignore - - from invoke import task, Context from sslyze import __version__ @@ -16,30 +7,26 @@ @task -def test(ctx): - # type: (Context) -> None +def test(ctx: Context) -> None: ctx.run("pytest --cov=sslyze --cov-fail-under 80 --durations 5") @task -def lint(ctx): - # type: (Context) -> None +def lint(ctx: Context) -> None: ctx.run("flake8 .") ctx.run("mypy .") ctx.run("black -l 120 sslyze tests api_sample.py tasks.py --check") @task -def gen_doc(ctx): - # type: (Context) -> None +def gen_doc(ctx: Context) -> None: docs_folder_path = root_path / "docs" dst_path = docs_folder_path / "documentation" ctx.run(f"python -m sphinx -v -b html {docs_folder_path} {dst_path}") @task -def release(ctx): - # type: (Context) -> None +def release(ctx: Context) -> None: response = input(f'Release version "{__version__}" ? y/n') if response.lower() != "y": print("Cancelled") @@ -65,8 +52,7 @@ def release(ctx): @task -def build_exe(ctx): - # type: (Context) -> None +def build_exe(ctx: Context) -> None: if platform != "win32": raise EnvironmentError("Can only be used on Windows") # WARNING(AD): This does not work well within a pipenv and the system's Python should be used @@ -74,8 +60,7 @@ def build_exe(ctx): @task -def gen_json_schema(ctx): - # type: (Context) -> None +def gen_json_schema(ctx: Context) -> None: from sslyze.json.json_output import SslyzeOutputAsJson json_schema = SslyzeOutputAsJson.schema_json(indent=2)