Skip to content

Commit 5f7b8cf

Browse files
committed
- Fixed nox run
- Changed postfix of templates to .jinja2
1 parent 489bc79 commit 5f7b8cf

12 files changed

Lines changed: 17 additions & 34 deletions

File tree

.github/workflows/build_docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
name: build_docs
1+
name: build_docs
22
on:
33
push:
44
branches:
5-
- master
5+
- master
66
- main
77
jobs:
88
deploy:
@@ -12,5 +12,5 @@ jobs:
1212
- uses: actions/setup-python@v2
1313
with:
1414
python-version: 3.x
15-
- run: pip install mkdocs-material
15+
- run: pip install mkdocs-material
1616
- run: mkdocs gh-deploy --force

noxfile.py

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"tests",
3131
"typeguard",
3232
"xdoctest",
33-
"docs-build",
3433
)
3534

3635

@@ -147,7 +146,7 @@ def safety(session: Session) -> None:
147146
@session(python=python_versions)
148147
def mypy(session: Session) -> None:
149148
"""Type-check using mypy."""
150-
args = session.posargs or ["src", "tests", "docs/conf.py"]
149+
args = session.posargs or ["src", "tests"]
151150
session.install(".")
152151
session.install("mypy", "pytest", "respx", "fastapi", "uvicorn")
153152
session.run("mypy", *args)
@@ -175,7 +174,7 @@ def coverage(session: Session) -> None:
175174
session.install("coverage[toml]")
176175

177176
if not session.posargs and any(Path().glob(".coverage.*")):
178-
session.run("coverage", "combine", "-i")
177+
session.run("coverage", "combine")
179178

180179
session.run("coverage", *args)
181180

@@ -203,32 +202,15 @@ def xdoctest(session: Session) -> None:
203202
session.run("python", "-m", "xdoctest", *args)
204203

205204

206-
@session(name="docs-build", python=python_versions[0])
207-
def docs_build(session: Session) -> None:
208-
"""Build the documentation."""
209-
args = session.posargs or ["docs", "docs/_build"]
210-
if not session.posargs and "FORCE_COLOR" in os.environ:
211-
args.insert(0, "--color")
212-
213-
session.install(".")
214-
session.install("sphinx", "sphinx-click", "furo", "myst-parser")
215-
216-
build_dir = Path("docs", "_build")
217-
if build_dir.exists():
218-
shutil.rmtree(build_dir)
219-
220-
session.run("sphinx-build", *args)
221-
222-
223205
@session(python=python_versions[0])
224206
def docs(session: Session) -> None:
225207
"""Build and serve the documentation with live reloading on file changes."""
226-
args = session.posargs or ["--open-browser", "docs", "docs/_build"]
208+
args = session.posargs or ["serve"]
227209
session.install(".")
228-
session.install("sphinx", "sphinx-autobuild", "sphinx-click", "furo", "myst-parser")
210+
session.install("mkdocs", "mkdocs-material")
229211

230212
build_dir = Path("docs", "_build")
231213
if build_dir.exists():
232214
shutil.rmtree(build_dir)
233215

234-
session.run("sphinx-autobuild", *args)
216+
session.run("mkdocs", *args)

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ documentation = "https://openapi-python-generator.readthedocs.io"
1111
classifiers = [
1212
"Development Status :: 2 - Pre-Alpha",
1313
]
14+
keywords = ["OpenAPI", "Generator", "Python", "async"]
1415

1516
[tool.poetry.urls]
1617
Changelog = "https://github.com/MarcoMuellner/openapi-python-generator/releases"

src/openapi_python_generator/common.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@ class AutoFormat(str, Enum):
2828
HTTPLibrary.httpx: LibraryConfig(
2929
name="httpx",
3030
library_name="httpx",
31-
template_name="httpx.template",
31+
template_name="httpx.jinja2",
3232
include_async=True,
3333
include_sync=True,
3434
),
3535
HTTPLibrary.requests: LibraryConfig(
3636
name="requests",
3737
library_name="requests",
38-
template_name="requests.template",
38+
template_name="requests.jinja2",
3939
include_async=False,
4040
include_sync=True,
4141
),
4242
HTTPLibrary.aiohttp: LibraryConfig(
4343
name="aiohttp",
4444
library_name="aiohttp",
45-
template_name="aiohttp.template",
45+
template_name="aiohttp.jinja2",
4646
include_async=True,
4747
include_sync=False,
4848
),

src/openapi_python_generator/language_converters/python/jinja_config.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
from jinja2 import Environment, FileSystemLoader
44

5-
ENUM_TEMPLATE = "enum.template"
6-
MODELS_TEMPLATE = "models.template"
7-
SERVICE_TEMPLATE = "service.template"
8-
HTTPX_TEMPLATE = "httpx.template"
9-
API_CONFIG_TEMPLATE = "apiconfig.template"
5+
ENUM_TEMPLATE = "enum.jinja2"
6+
MODELS_TEMPLATE = "models.jinja2"
7+
SERVICE_TEMPLATE = "service.jinja2"
8+
HTTPX_TEMPLATE = "httpx.jinja2"
9+
API_CONFIG_TEMPLATE = "apiconfig.jinja2"
1010
TEMPLATE_PATH = Path(__file__).parent / "templates"
1111

1212
JINJA_ENV = Environment(

src/openapi_python_generator/language_converters/python/templates/apiconfig.template renamed to src/openapi_python_generator/language_converters/python/templates/apiconfig.jinja2

File renamed without changes.

src/openapi_python_generator/language_converters/python/templates/enum.template renamed to src/openapi_python_generator/language_converters/python/templates/enum.jinja2

File renamed without changes.

src/openapi_python_generator/language_converters/python/templates/enums.template renamed to src/openapi_python_generator/language_converters/python/templates/enums.jinja2

File renamed without changes.

src/openapi_python_generator/language_converters/python/templates/httpx.template renamed to src/openapi_python_generator/language_converters/python/templates/httpx.jinja2

File renamed without changes.

src/openapi_python_generator/language_converters/python/templates/models.template renamed to src/openapi_python_generator/language_converters/python/templates/models.jinja2

File renamed without changes.

0 commit comments

Comments
 (0)