Skip to content

Commit

Permalink
build: docs dependencies as group instead of extra
Browse files Browse the repository at this point in the history
  • Loading branch information
moldhouse committed Mar 6, 2025
1 parent 68f394b commit 1985e28
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 26 deletions.
24 changes: 12 additions & 12 deletions Contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

Tests use pytests with (optional) coverage plugin. Install the locally cloned repo in editable mode with:

```bash
pip install -e .[test]
```sh
uv sync
```

**Tests make api calls that reduce your quota!**
Expand All @@ -32,16 +32,16 @@ TEST_PASSWORD=your_password
- A coverage report can be created using the optional arguments --cov-report and --cov (see pytest documentation)
- A subset of tests can be selected by pointing to the module within tests

```bash
```sh
# run all tests, output coverage report of aleph_alpha_client module in terminal
pytest --cov-report term --cov=aleph_alpha_client tests
pytest tests -v # start verbose
uv run pytest --cov-report term --cov=aleph_alpha_client tests
uv run pytest tests -v # start verbose
```

If an html coverage report has been created a simple http server can be run to serve static files.

```bash
python -m http.server --directory htmlcov 8000
```sh
uv run python -m http.server --directory htmlcov 8000
```

## Releasing a new version
Expand All @@ -55,17 +55,17 @@ python -m http.server --directory htmlcov 8000
## Working on our documentation

We use [Sphinx](https://www.sphinx-doc.org/en/master/index.html) for our documentation and publish it on [Read the Docs](https://aleph-alpha-client.readthedocs.io/en/latest/).
To work on the documentation, you need to install the project editable and with the `docs` extra.
To work on the documentation, you need to install the project with the `docs` dependency group.

```bash
pip install -e .[docs]
```sh
uv sync --group docs
```

The documentation can be generated with:

```bash
```sh
cd docs
make html
uv run make html
```

Make sure that the documentation can be generated without Sphinx warnings or errors.
7 changes: 1 addition & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ dependencies = [
"packaging>=23.2",
]

[project.optional-dependencies]
docs = [
"sphinx>=6.1.3",
"sphinx-rtd-theme>=1.2.1",
]

[project.urls]
Homepage = "https://github.com/Aleph-Alpha/aleph-alpha-client"

Expand All @@ -45,6 +39,7 @@ dev = [
"nbconvert>=7.16.6,<8",
"ipykernel>=6.29.5,<7",
]
docs = ["sphinx>=6.1.3", "sphinx-rtd-theme>=1.2.1"]

[tool.hatch.build.targets.sdist]
include = ["aleph_alpha_client"]
Expand Down
16 changes: 8 additions & 8 deletions uv.lock

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

0 comments on commit 1985e28

Please sign in to comment.