Skip to content

Commit 7fa4b03

Browse files
committed
Move tooling to uv like main altair repo
1 parent 777d56e commit 7fa4b03

File tree

4 files changed

+22
-22
lines changed

4 files changed

+22
-22
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ jobs:
1515
uses: actions/setup-python@v5
1616
with:
1717
python-version: ${{ matrix.python-version }}
18-
- name: Install dependencies
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v6
20+
- name: Sync dependencies
1921
run: |
20-
python -m pip install --upgrade pip
21-
pip install .[dev]
22+
uv sync --extra dev
2223
- name: Test with pytest
2324
run: |
24-
pytest --pyargs --numprocesses=logical tests
25+
uv run pytest --pyargs --numprocesses=logical tests

.github/workflows/lint.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,19 @@ jobs:
1212
uses: actions/setup-python@v5
1313
with:
1414
python-version: "3.12"
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v6
1517
# Installing all dependencies and not just the linters as mypy needs them for type checking
16-
- name: Install dependencies
18+
- name: Sync dependencies
1719
run: |
18-
python -m pip install --upgrade pip
19-
pip install hatch
20+
uv sync --extra dev
2021
- name: Lint with ruff
2122
run: |
22-
hatch run ruff check .
23+
uv run hatch run ruff check .
2324
- name: Check formatting with ruff
2425
run: |
25-
hatch run ruff format --diff .
26-
hatch run ruff format --check .
26+
uv run hatch run ruff format --diff .
27+
uv run hatch run ruff format --check .
2728
- name: Lint with mypy
2829
run: |
29-
hatch run mypy sphinxext_altair tests
30+
uv run hatch run mypy sphinxext_altair tests

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,26 @@ pip install sphinxext-altair
3838
```
3939

4040
# Contributing
41-
It's recommended to use a virtual environment for development:
41+
It's recommended to use `uv` for development:
4242

4343
```bash
44-
python -m venv .venv
45-
# Install the project in editable mode including development dependencies
46-
pip install -e '.[dev]'
44+
uv sync --extra dev
4745
```
4846

4947
`sphinxext-altair` uses [ruff](https://github.com/astral-sh/ruff) for code formatting and linting rules, [mypy](https://github.com/python/mypy) for static type checking, and [pytest](https://github.com/pytest-dev/pytest) for testing.
5048
All of these tools can be executed by running:
5149

5250
```bash
53-
hatch test
51+
uv run hatch test
5452
```
5553

5654
As part of those tests, a Sphinx documentation is built at `tests/roots/test-altairplot`. You can manually build this documentation and view it which is very useful during development of a new feature.
5755

5856
For example, if you want to add a new option to the `altair-plot` directive, you can add another example in the file `tests/roots/test-altairplot/index.rst` and then build and view the documentation by running:
5957

6058
```bash
61-
hatch run doc:clean-build-html
62-
hatch run doc:serve
59+
uv run hatch run doc:clean-build-html
60+
uv run hatch run doc:serve
6361
```
6462

6563
The test documentation can now be viewed at [http://localhost:8000](http://localhost:8000).

RELEASING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
4. Run test suite again after commit above to make sure everything passes:
1515

16-
hatch run test
16+
uv run hatch test
1717

1818
5. Tag the release:
1919

@@ -22,12 +22,12 @@
2222

2323
6. Build source & wheel distributions:
2424

25-
hatch clean # clean old builds & distributions
26-
hatch build # create a source distribution and universal wheel
25+
uv run hatch clean # clean old builds & distributions
26+
uv run hatch build # create a source distribution and universal wheel
2727

2828
7. publish to PyPI (Requires correct PyPI owner permissions):
2929

30-
hatch publish
30+
uv run hatch publish
3131

3232
8. update version to e.g. 0.3.0dev in `sphinxext_altair/__init__.py`
3333

0 commit comments

Comments
 (0)