-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update pyproject.toml and dependencies Add tox.ini Update tests to work with tox parallel testing
- Loading branch information
Showing
8 changed files
with
113 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,28 @@ | ||
[build-system] | ||
requires = ["setuptools >= 64.0", "setuptools-scm>=8.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
|
||
[project] | ||
name = "openapi-test-client" | ||
version = "1.0" | ||
description = "Generate/update API test clients from any OpenAPI 3.x specifications" | ||
readme = "README.md" | ||
license = {file="LICENSE"} | ||
authors = [ | ||
{ name = "Yugo Kato", email = "[email protected]" }, | ||
] | ||
requires-python = ">=3.11" | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: 3.13", | ||
"Topic :: Software Development :: Quality Assurance", | ||
"Topic :: Software Development :: Testing", | ||
] | ||
dependencies = [ | ||
"autoflake==2.3.1", | ||
"black==23.12.1", | ||
|
@@ -13,33 +34,29 @@ dependencies = [ | |
"pydantic[email]==2.9.2", | ||
"PyYAML==6.0.1", | ||
] | ||
readme = "README.md" | ||
dynamic = ["version"] | ||
|
||
|
||
[project.optional-dependencies] | ||
dev = ["pre-commit==3.7.1", "ruff==0.7.1"] | ||
dev = ["common-libs[dev]"] | ||
app = [ | ||
"common-libs[dev]", | ||
"Quart==0.19.4", | ||
"quart-auth==0.9.0", | ||
"quart-schema[pydantic]==0.19.1", | ||
|
||
] | ||
test = [ | ||
"common-libs[dev]", | ||
"common-libs[test]", | ||
"openapi-test-client[app]", | ||
"pytest==8.3.2", | ||
"pytest-lazy-fixtures==1.1.1", | ||
"pytest-mock==3.14.0", | ||
"pytest-subtests==0.11.0", | ||
] | ||
|
||
[build-system] | ||
requires = ["setuptools >= 61.0", "setuptools-scm>=8.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["src"] | ||
|
||
[tool.setuptools_scm] | ||
local_scheme = "no-local-version" | ||
|
||
[project.scripts] | ||
openapi-client = "openapi_test_client.scripts.generate_client:main" | ||
|
||
|
@@ -58,12 +75,9 @@ indent-width = 4 | |
|
||
[tool.ruff.lint] | ||
select = [ | ||
# pycodestyle | ||
"E", | ||
# Pyflakes | ||
"F", | ||
# pyupgrade | ||
"UP", | ||
"E", # pycodestyle | ||
"F", # Pyflakes | ||
"UP", # pyupgrade | ||
] | ||
ignore = ["E731", "E741", "F403"] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,16 @@ | ||
import argparse | ||
|
||
from demo_app import app | ||
|
||
DEFAULT_PORT = 5000 | ||
|
||
|
||
def parse_pargs(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("-p", "--port", dest="port", type=int, default=DEFAULT_PORT) | ||
return parser.parse_args() | ||
|
||
|
||
if __name__ == "__main__": | ||
app.run(debug=True) | ||
args = parse_pargs() | ||
app.run(debug=True, port=args.port) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[tox] | ||
env_list = py{311,312,313} | ||
|
||
[testenv] | ||
set_env = | ||
IS_TOX = true | ||
APP_PORT = 5000 | ||
parallel_show_output = true | ||
deps = .[test] | ||
commands = pytest tests -v -x | ||
|
||
# Use a different app port per env for parallel testing | ||
[testenv:py311] | ||
set_env = | ||
IS_TOX = true | ||
APP_PORT = 5001 | ||
|
||
[testenv:py312] | ||
set_env = | ||
IS_TOX = true | ||
APP_PORT = 5002 | ||
|
||
[testenv:py313] | ||
set_env = | ||
IS_TOX = true | ||
APP_PORT = 5003 |