Skip to content

Commit

Permalink
Merge pull request #24 from valpackett/master
Browse files Browse the repository at this point in the history
Add docs matcher
  • Loading branch information
ddsky authored Jun 28, 2024
2 parents 779b482 + 5309ad4 commit 09854d2
Show file tree
Hide file tree
Showing 6 changed files with 401 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/compare.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Compare spec to docs
on:
workflow_dispatch:
jobs:
compare:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install deps
working-directory: ./_docmatch
run: pip install .
- name: Fetch docs
working-directory: ./_docmatch
run: curl -L https://spoonacular.com/food-api/docs > docs.html
- name: Compare
working-directory: ./_docmatch
run: python src/docmatch.py
70 changes: 70 additions & 0 deletions _docmatch/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
docs.html

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm-project.org/#use-with-ide
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/
14 changes: 14 additions & 0 deletions _docmatch/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# docmatch

This is a script that compares the spec with the HTML docs.

Using [pdm](https://pdm-project.org/) for dependencies:

```shell
curl -L https://spoonacular.com/food-api/docs > docs.html
pdm install
pdm run src/docmatch.py
```

(just pip can be used for deps too, `pip install .`,
with a manually managed virtualenv or in an otherwise isolated environment like a container)
64 changes: 64 additions & 0 deletions _docmatch/pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions _docmatch/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[project]
name = "docmatch"
version = "0.1.0"
description = "Matches the spoonacular API docs to the OpenAPI spec"
authors = [
{name = "Val Packett", email = "[email protected]"},
]
dependencies = [
"beautifulsoup4>=4.12.3",
"genson>=1.2.2",
"json-repair>=0.17.1",
"jsonref>=1.1.0",
]
requires-python = ">=3.10.0"
readme = "README.md"
license = {text = "MIT"}

[tool.pdm]
distribution = false
Loading

0 comments on commit 09854d2

Please sign in to comment.