Skip to content

ci: Update and consolidate QC/CI tools #581

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

Merged
merged 1 commit into from
Jan 29, 2022
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .flake8

This file was deleted.

3 changes: 0 additions & 3 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ jobs:
- name: Run isort
run: poetry run isort . --check

- name: Run flake8
run: poetry run flake8 openapi_python_client

- name: Run safety
run: poetry export -f requirements.txt | poetry run safety check --bare --stdin

Expand Down
13 changes: 0 additions & 13 deletions mypy.ini

This file was deleted.

4 changes: 2 additions & 2 deletions openapi_python_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,12 +377,12 @@ def _load_yaml_or_json(data: bytes, content_type: Optional[str]) -> Union[Dict[s
try:
return json.loads(data.decode())
except ValueError as err:
return GeneratorError(header="Invalid JSON from provided source: {}".format(str(err)))
return GeneratorError(header=f"Invalid JSON from provided source: {err}")
else:
try:
return yaml.safe_load(data)
except yaml.YAMLError as err:
return GeneratorError(header="Invalid YAML from provided source: {}".format(str(err)))
return GeneratorError(header=f"Invalid YAML from provided source: {err}")


def _get_document(*, url: Optional[str], path: Optional[Path]) -> Union[Dict[str, Any], GeneratorError]:
Expand Down
4 changes: 2 additions & 2 deletions openapi_python_client/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def generate(
try:
codecs.getencoder(file_encoding)
except LookupError as err:
typer.secho("Unknown encoding : {}".format(file_encoding), fg=typer.colors.RED)
typer.secho(f"Unknown encoding : {file_encoding}", fg=typer.colors.RED)
raise typer.Exit(code=1) from err

config = _process_config(config_path)
Expand Down Expand Up @@ -178,7 +178,7 @@ def update(
try:
codecs.getencoder(file_encoding)
except LookupError as err:
typer.secho("Unknown encoding : {}".format(file_encoding), fg=typer.colors.RED)
typer.secho(f"Unknown encoding : {file_encoding}", fg=typer.colors.RED)
raise typer.Exit(code=1) from err

config = _process_config(config_path)
Expand Down
189 changes: 85 additions & 104 deletions poetry.lock

Large diffs are not rendered by default.

19 changes: 17 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ taskipy = "*"
safety = "*"
pytest-cov = "*"
python-multipart = "*"
flake8 = "*"
types-PyYAML = "^6.0.3"
types-certifi = "^2020.0.0"
types-python-dateutil = "^2.0.0"
Expand All @@ -56,7 +55,6 @@ pylint = "^2.9.6"
check = """
isort .\
&& black .\
&& flake8 openapi_python_client\
&& poetry export -f requirements.txt | poetry run safety check --bare --stdin\
&& mypy openapi_python_client\
&& pylint openapi_python_client\
Expand Down Expand Up @@ -124,6 +122,23 @@ disable = [
"cyclic-import",
]

[tool.mypy]
plugins = ["pydantic.mypy"]
disallow_any_generics = true
disallow_untyped_defs = true
warn_redundant_casts = true
strict_equality = true

[[tool.mypy.overrides]]
module = [
"importlib_metadata",
"typer",
]
ignore_missing_imports = true

[tool.pytest.ini_options]
junit_family = "xunit2"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
2 changes: 0 additions & 2 deletions pytest.ini

This file was deleted.