Skip to content

Commit

Permalink
[#596] Update some dependencies including cryptography
Browse files Browse the repository at this point in the history
Keep version of sphinx that is compatible with 3.7

Refine versions

simplify reqs
  • Loading branch information
nabla-c0d3 committed Mar 9, 2023
1 parent 4ec80a3 commit fb75591
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 27 deletions.
8 changes: 4 additions & 4 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()}},
Expand Down
27 changes: 6 additions & 21 deletions tasks.py
Original file line number Diff line number Diff line change
@@ -1,45 +1,32 @@
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__

root_path = Path(__file__).parent.absolute()


@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")
Expand All @@ -65,17 +52,15 @@ 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
ctx.run("python setup.py build_exe")


@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)
Expand Down

0 comments on commit fb75591

Please sign in to comment.