Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate and test mypy-compliant code #131

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 5 additions & 1 deletion .github/workflows/build_and_test_library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ jobs:

- name: "Test with pytest"
working-directory: ansys-grantami-serverapi-openapi
run: poetry run -- pytest
run: poetry run pytest

- name: "Run mypy"
working-directory: ansys-grantami-serverapi-openapi
run: poetry run mypy

build-library:
name: "Build library"
Expand Down
81 changes: 75 additions & 6 deletions ansys-grantami-serverapi-openapi/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 20 additions & 3 deletions ansys-grantami-serverapi-openapi/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "ansys-grantami-serverapi-openapi"
description = "Autogenerated client library for the Granta MI Server API."
version = "3.0.0.dev183"
version = "3.0.0.dev186"
license = "MIT"
authors = ["ANSYS, Inc. <[email protected]>"]
maintainers = ["ANSYS, Inc. <[email protected]>"]
Expand All @@ -26,7 +26,8 @@ classifiers = [
"Topic :: Scientific/Engineering :: Information Analysis",
]
packages = [
{ include = "**/*.py", from = "src" }
{ include = "**/*.py", from = "src" },
{ include = "**/py.typed", from = "src" },
]

[tool.poetry.dependencies]
Expand All @@ -36,8 +37,9 @@ requests = "^2.26.0"
python-dateutil = "^2.8.2"

[tool.poetry.group.dev.dependencies]
pytest = "^7.0.0"
pytest = "^8.0.0"
requests-mock = "^1.0.0"
mypy = "^1.8.0"

[tool.tox]
legacy_tox_ini = """
Expand All @@ -59,3 +61,18 @@ changedir = {toxinidir}/tests
testpaths = [
"./tests",
]

[tool.mypy]
strict = true
warn_return_any = true
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
disallow_untyped_defs = true
no_implicit_optional = true
check_untyped_defs = true
show_error_codes = true
files = "src"
explicit_package_bases = true
mypy_path = "$MYPY_CONFIG_FILE_DIR/src"
namespace_packages = true
Loading