diff --git a/Makefile b/Makefile index 2076490f..ac6b3a71 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ install-lint: ## Only install the linter dependencies poetry install --only lint install-dev: ## Only install the dev dependencies - poetry install --only dev + poetry install --only dev install-pre-commit: install ## Install pre-commit hooks poetry run pre-commit install @@ -42,6 +42,9 @@ test-integ: install ## Run tests against the integ API server (needs GROUNDLIGH test-docs: install ## Run the example code and tests in our docs against the prod API (needs GROUNDLIGHT_API_TOKEN) poetry run pytest -v --markdown-docs ${TEST_ARGS} docs README.md +test-docs-integ: install ## Run the example code and tests in our docs against the integ API (needs GROUNDLIGHT_API_TOKEN) + GROUNDLIGHT_ENDPOINT="https://api.integ.groundlight.ai/" poetry run pytest -v --markdown-docs ${TEST_ARGS} docs README.md + # Adjust which paths we lint LINT_PATHS="src test bin samples" @@ -52,13 +55,13 @@ format: install-lint ## Run standard python formatting ./code-quality/format ${LINT_PATHS} -# Targets for sphinx documentation +# Targets for sphinx documentation install-sphinx-deps: ## Only install the sphinx dependencies poetry install --no-root --only sphinx-deps -# The following is auto-generated by sphinx-quickstart: -# To test out doc changes locally, run +# The following is auto-generated by sphinx-quickstart: +# To test out doc changes locally, run # poetry run make html && open build/html/index.html SPHINXOPTS ?= SPHINXBUILD ?= sphinx-build @@ -69,27 +72,27 @@ sphinx-help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -# The .PHONY directive tells make that `apidocs` and `html` are labels for -# commands. `apidocs: html` allows us to generate docs by running -# `make apidocs` instead. -.PHONY: docs-comprehensive apidocs html +# The .PHONY directive tells make that `apidocs` and `html` are labels for +# commands. `apidocs: html` allows us to generate docs by running +# `make apidocs` instead. +.PHONY: docs-comprehensive apidocs html # Start an interactive server to test docs locally -develop-docs-comprehensive: docs-comprehensive - cd docs && npm start +develop-docs-comprehensive: docs-comprehensive + cd docs && npm start -## Builds docs comprehensively (integrating API reference docs built -## with sphinx into the docusaurus docs). -docs-comprehensive: apidocs +## Builds docs comprehensively (integrating API reference docs built +## with sphinx into the docusaurus docs). +docs-comprehensive: apidocs rm -rf docs/static/api-reference-docs rm -rf docs/build/api-reference-docs mkdir docs/static/api-reference-docs mv build/html/* docs/static/api-reference-docs/ - cd docs && npm run build - -apidocs: - poetry run make html + cd docs && npm run build + +apidocs: + poetry run make html html: @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(0) diff --git a/docs/docs/building-applications/working-with-detectors.md b/docs/docs/building-applications/working-with-detectors.md index 74270d40..0da85c34 100644 --- a/docs/docs/building-applications/working-with-detectors.md +++ b/docs/docs/building-applications/working-with-detectors.md @@ -8,7 +8,9 @@ sidebar_position: 3 Typically you'll use the `get_or_create_detector(name: str, query: str)` method to find an existing detector you've already created with the same name, or create a new one if it doesn't exists. But if you'd like to force creating a new detector you can also use the `create_detector(name: str, query: str)` method -```python + + +```python notest from groundlight import Groundlight gl = Groundlight()