diff --git a/.github/workflows/openapi.yml b/.github/workflows/openapi.yml new file mode 100644 index 0000000..5ba4e09 --- /dev/null +++ b/.github/workflows/openapi.yml @@ -0,0 +1,35 @@ +name: Validate OpenAPI with Spectral + +on: + - push + - pull_request + +jobs: + build: + name: Run Spectral + runs-on: ubuntu-latest + steps: + # Check out the repository + - name: Check out the repository + uses: actions/checkout@v4.1.1 + + - name: Set up Python 3.10 + uses: actions/setup-python@v5.0.0 + with: + python-version: "3.10" + + - name: Upgrade pip + run: | + pip install --constraint=.github/workflows/constraints.txt pip + pip --version + + - name: Install Poetry + run: | + pipx install --pip-args=--constraint=.github/workflows/constraints.txt poetry + poetry --version + + # Run Spectral + - name: Run Spectral + uses: stoplightio/spectral-action@latest + with: + file_glob: 'pygeoapi-openapi.json' diff --git a/.spectral.yaml b/.spectral.yaml new file mode 100644 index 0000000..d47c47d --- /dev/null +++ b/.spectral.yaml @@ -0,0 +1 @@ +extends: ["spectral:oas"] diff --git a/mkdocs.yml b/mkdocs.yml index 2a67a19..bf323a8 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,3 +1,73 @@ site_name: fastgeoapi docs_dir: docs site_dir: docs_build/site +theme: + name: material + features: + - navigation.tabs + - navigation.sections + - toc.integrate + - navigation.top + - search.suggest + - search.highlight + - content.tabs.link + - content.code.annotation + - content.code.copy + language: en + palette: + - scheme: default + toggle: + icon: material/toggle-switch-off-outline + name: Switch to Dark Mode + primary: green + accent: red + - scheme: slate + toggle: + icon: material/toggle-switch + name: Switch to Light Mode + primary: green + accent: blue grey + icon: + admonition: + note: octicons/tag-16 + abstract: octicons/checklist-16 + info: octicons/info-16 + tip: octicons/squirrel-16 + success: octicons/check-16 + question: octicons/question-16 + warning: octicons/alert-16 + failure: octicons/x-circle-16 + danger: octicons/zap-16 + bug: octicons/bug-16 + example: octicons/beaker-16 + quote: octicons/quote-16 +plugins: + - termynal: + prompt_literal_start: + - "$" +extra: + social: + - icon: fontawesome/brands/github-alt + link: https://github.com/geobeyond + - icon: fontawesome/brands/twitter + link: https://twitter.com/geobeyond + - icon: fontawesome/brands/linkedin + link: https://www.linkedin.com/company/geobeyond + + markdown_extensions: + - pymdownx.highlight: + anchor_linenums: true + - pymdownx.inlinehilite + - pymdownx.snippets + - admonition + - pymdownx.arithmatex: + generic: true + - footnotes + - pymdownx.details + - pymdownx.superfences + - pymdownx.mark + - attr_list + - pymdownx.emoji + +copyright: | + © Copyright 2024 Geobeyond team. diff --git a/poetry.lock b/poetry.lock index 22f6730..35de06a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -73,34 +73,6 @@ files = [ [package.extras] test = ["coverage", "mypy", "pexpect", "ruff", "wheel"] -[[package]] -name = "argcomplete" -version = "3.1.6" -description = "Bash tab completion for argparse" -optional = false -python-versions = ">=3.8" -files = [ - {file = "argcomplete-3.1.6-py3-none-any.whl", hash = "sha256:71f4683bc9e6b0be85f2b2c1224c47680f210903e23512cfebfe5a41edfd883a"}, - {file = "argcomplete-3.1.6.tar.gz", hash = "sha256:3b1f07d133332547a53c79437527c00be48cca3807b1d4ca5cab1b26313386a6"}, -] - -[package.extras] -test = ["coverage", "mypy", "pexpect", "ruff", "wheel"] - -[[package]] -name = "argcomplete" -version = "3.1.6" -description = "Bash tab completion for argparse" -optional = false -python-versions = ">=3.8" -files = [ - {file = "argcomplete-3.1.6-py3-none-any.whl", hash = "sha256:71f4683bc9e6b0be85f2b2c1224c47680f210903e23512cfebfe5a41edfd883a"}, - {file = "argcomplete-3.1.6.tar.gz", hash = "sha256:3b1f07d133332547a53c79437527c00be48cca3807b1d4ca5cab1b26313386a6"}, -] - -[package.extras] -test = ["coverage", "mypy", "pexpect", "ruff", "wheel"] - [[package]] name = "asttokens" version = "2.4.1" @@ -1910,6 +1882,21 @@ files = [ [package.dependencies] pydantic = ">=1.8" +[[package]] +name = "openapi-resolver" +version = "0.0.6" +description = "Resolve and bundle openapi v3 specs." +optional = false +python-versions = "*" +files = [ + {file = "openapi_resolver-0.0.6.tar.gz", hash = "sha256:2cb47e606967dfa7686f269f34037f548acf39c64f3f8592eaafe5f01dae6dca"}, +] + +[package.dependencies] +pathlib = "*" +pyyaml = "*" +six = "*" + [[package]] name = "orjson" version = "3.9.13" @@ -2005,6 +1992,17 @@ files = [ qa = ["flake8 (==3.8.3)", "mypy (==0.782)"] testing = ["docopt", "pytest (<6.0.0)"] +[[package]] +name = "pathlib" +version = "1.0.1" +description = "Object-oriented filesystem paths" +optional = false +python-versions = "*" +files = [ + {file = "pathlib-1.0.1-py3-none-any.whl", hash = "sha256:f35f95ab8b0f59e6d354090350b44a80a80635d22efdedfa84c7ad1cf0a74147"}, + {file = "pathlib-1.0.1.tar.gz", hash = "sha256:6940718dfc3eff4258203ad5021090933e5c04707d5ca8cc9e73c94a7894ea9f"}, +] + [[package]] name = "pathspec" version = "0.12.1" @@ -3460,6 +3458,23 @@ files = [ [package.extras] tests = ["pytest", "pytest-cov"] +[[package]] +name = "termynal" +version = "0.12.0" +description = "A lightweight and modern animated terminal window" +optional = false +python-versions = ">=3.8.1,<4.0.0" +files = [ + {file = "termynal-0.12.0-py3-none-any.whl", hash = "sha256:057ff23e2845abdfc36a55f71e2935d4663829cb7ce62661be881d9e10b74ec4"}, + {file = "termynal-0.12.0.tar.gz", hash = "sha256:ef410c20bb4eef975e3d1a0bf02c9d63304a488b502c2151f15fd38be0d6d32a"}, +] + +[package.dependencies] +markdown = "*" + +[package.extras] +mkdocs = ["mkdocs (>=1.4,<2.0)"] + [[package]] name = "tinydb" version = "4.8.0" @@ -4080,4 +4095,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = ">=3.9,<4.0" -content-hash = "870540acf3fb43f5a77a050b8288895b0b0c5578c7f8e778a803bf8da5b886eb" +content-hash = "a6431bbfe948bce6776495c4ed6c449cebe416b05abf1d019efc5f2609d1994c" diff --git a/pyproject.toml b/pyproject.toml index 290f0f6..3c4a15c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,8 @@ pydantic-settings = "^2.1.0" authlib = "^1.3.0" cachetools = "^5.3.2" json-ref-dict = "^0.7.2" +mkdocs-material = "^9.5.9" +termynal = "^0.12.0" [tool.poetry.scripts] fastgeoapi = "cli:app" @@ -71,6 +73,7 @@ mypy = "^1.5.0" commitizen = "^3.6.0" fencer = "^0.3.6" # jsonref = "^1.1.0" +openapi-resolver = "^0.0.6" [tool.coverage.paths] source = [".", "*/site-packages"]