Skip to content

Commit 87c369a

Browse files
authored
ci: Update and consolidate QC/CI tools (#581)
Closes #524
1 parent db8144e commit 87c369a

File tree

8 files changed

+106
-130
lines changed

8 files changed

+106
-130
lines changed

.flake8

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/workflows/checks.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ jobs:
4949
- name: Run isort
5050
run: poetry run isort . --check
5151

52-
- name: Run flake8
53-
run: poetry run flake8 openapi_python_client
54-
5552
- name: Run safety
5653
run: poetry export -f requirements.txt | poetry run safety check --bare --stdin
5754

mypy.ini

Lines changed: 0 additions & 13 deletions
This file was deleted.

openapi_python_client/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,12 +377,12 @@ def _load_yaml_or_json(data: bytes, content_type: Optional[str]) -> Union[Dict[s
377377
try:
378378
return json.loads(data.decode())
379379
except ValueError as err:
380-
return GeneratorError(header="Invalid JSON from provided source: {}".format(str(err)))
380+
return GeneratorError(header=f"Invalid JSON from provided source: {err}")
381381
else:
382382
try:
383383
return yaml.safe_load(data)
384384
except yaml.YAMLError as err:
385-
return GeneratorError(header="Invalid YAML from provided source: {}".format(str(err)))
385+
return GeneratorError(header=f"Invalid YAML from provided source: {err}")
386386

387387

388388
def _get_document(*, url: Optional[str], path: Optional[Path]) -> Union[Dict[str, Any], GeneratorError]:

openapi_python_client/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def generate(
135135
try:
136136
codecs.getencoder(file_encoding)
137137
except LookupError as err:
138-
typer.secho("Unknown encoding : {}".format(file_encoding), fg=typer.colors.RED)
138+
typer.secho(f"Unknown encoding : {file_encoding}", fg=typer.colors.RED)
139139
raise typer.Exit(code=1) from err
140140

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

184184
config = _process_config(config_path)

poetry.lock

Lines changed: 85 additions & 104 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ taskipy = "*"
4646
safety = "*"
4747
pytest-cov = "*"
4848
python-multipart = "*"
49-
flake8 = "*"
5049
types-PyYAML = "^6.0.3"
5150
types-certifi = "^2020.0.0"
5251
types-python-dateutil = "^2.0.0"
@@ -56,7 +55,6 @@ pylint = "^2.9.6"
5655
check = """
5756
isort .\
5857
&& black .\
59-
&& flake8 openapi_python_client\
6058
&& poetry export -f requirements.txt | poetry run safety check --bare --stdin\
6159
&& mypy openapi_python_client\
6260
&& pylint openapi_python_client\
@@ -124,6 +122,23 @@ disable = [
124122
"cyclic-import",
125123
]
126124

125+
[tool.mypy]
126+
plugins = ["pydantic.mypy"]
127+
disallow_any_generics = true
128+
disallow_untyped_defs = true
129+
warn_redundant_casts = true
130+
strict_equality = true
131+
132+
[[tool.mypy.overrides]]
133+
module = [
134+
"importlib_metadata",
135+
"typer",
136+
]
137+
ignore_missing_imports = true
138+
139+
[tool.pytest.ini_options]
140+
junit_family = "xunit2"
141+
127142
[build-system]
128143
requires = ["poetry-core>=1.0.0"]
129144
build-backend = "poetry.core.masonry.api"

pytest.ini

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)