Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't run create_detector doc test because it is not repeatable #110

Merged
merged 2 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 20 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"

Expand All @@ -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
Expand All @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion docs/docs/building-applications/working-with-detectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<!-- Don't test because we don't allow reusing the same name across multiple detectors -->

```python notest
from groundlight import Groundlight

gl = Groundlight()
Expand Down
Loading