Skip to content

Commit ee0adad

Browse files
nlebovitsgadomski
andauthored
docs: consistently use uv, ruff (#822)
* docs: update docs to consistently use uv, remove outdated references to black - updates docs/contributing.rst to reference uv consistently, remove references to black - updates scripts/format to refer to the ruff format hook instead of black * add changes to changelog --------- Co-authored-by: Pete Gadomski <[email protected]>
1 parent 658473e commit ee0adad

File tree

4 files changed

+2111
-2110
lines changed

4 files changed

+2111
-2110
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1313

1414
### Documentation
1515

16+
- Update contributing guide to consistently use `uv` workflow ([#822](https://github.com/stac-utils/pystac-client/pull/822))
17+
- Fix format script to use `ruff-format` instead of deprecated `black` hook ([#822](https://github.com/stac-utils/pystac-client/pull/822))
1618
- Add "How to..." section to usage documentation with latest datetime search across multiple collections example ([#823](https://github.com/stac-utils/pystac-client/pull/823))
1719

1820
## [v0.9.0] - 2025-07-17

docs/contributing.rst

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ way is to coordinate with the core developers via an issue or pull request conve
88
Development installation
99
^^^^^^^^^^^^^^^^^^^^^^^^
1010
Fork PySTAC Client into your GitHub account. Clone the repo, install `uv
11-
<https://docs.astral.sh/uv/getting-started/installation/>`_ then sync and
12-
activate the created virtual environment:
11+
<https://docs.astral.sh/uv/getting-started/installation/>`_ then install the package in editable mode with development dependencies:
1312

1413
.. code-block:: bash
1514
1615
$ git clone [email protected]:your_user_name/pystac-client.git
1716
$ cd pystac-client
18-
$ uv sync
19-
$ source .venv/bin/activate
17+
$ uv pip install -e . --group dev
18+
$ uv run pre-commit install
2019
2120
Testing
2221
^^^^^^^
@@ -29,7 +28,7 @@ To run the tests and generate the coverage report:
2928

3029
.. code-block:: bash
3130
32-
$ pytest -v -s --block-network --cov pystac_client --cov-report term-missing
31+
$ uv run pytest -v -s --block-network --cov pystac_client --cov-report term-missing
3332
3433
The PySTAC Client tests use `vcrpy <https://vcrpy.readthedocs.io/en/latest/>`_ to mock API calls
3534
with "pre-recorded" API responses. When adding new tests use the ``@pytest.mark.vcr`` decorator
@@ -38,7 +37,7 @@ repository.
3837

3938
.. code-block:: bash
4039
41-
$ pytest -v -s --record-mode new_episodes
40+
$ uv run pytest -v -s --record-mode new_episodes
4241
$ git add <new files here>
4342
$ git commit -a -m 'new test episodes'
4443
@@ -48,7 +47,7 @@ should be "re-recorded":
4847

4948
.. code-block:: bash
5049
51-
$ pytest -v -s --record-mode rewrite --block-network
50+
$ uv run pytest -v -s --record-mode rewrite --block-network
5251
$ git commit -a -m 'updated test episodes'
5352
5453
@@ -60,20 +59,19 @@ linting is run before every commit. These hooks should be installed with:
6059

6160
.. code-block:: bash
6261
63-
$ pre-commit install
62+
$ uv run pre-commit install
6463
6564
These can then be run independent of a commit with:
6665

6766
.. code-block:: bash
6867
69-
$ pre-commit run --all-files
68+
$ uv run pre-commit run --all-files
7069
7170
PySTAC Client uses
7271

73-
- `black <https://github.com/psf/black>`_ for Python code formatting
72+
- `ruff <https://docs.astral.sh/ruff/>`_ for Python code formatting and style checks
7473
- `codespell <https://github.com/codespell-project/codespell/>`_ to check code for common misspellings
7574
- `doc8 <https://github.com/pycqa/doc8>`_ for style checking on RST files in the docs
76-
- `ruff <https://beta.ruff.rs/docs/>`_ for Python style checks
7775
- `mypy <http://www.mypy-lang.org/>`_ for Python type annotation checks
7876

7977
Once installed you can bypass pre-commit by adding the ``--no-verify`` (or ``-n``)
@@ -87,24 +85,24 @@ the entire suit of checks and tests that will be run the GitHub Action Pipeline,
8785

8886
.. code-block:: bash
8987
90-
$ scripts/test
88+
$ uv run scripts/test
9189
9290
If automatic formatting is desired (incorrect formatting will cause the GitHub Action to fail),
93-
use the format script and commit the resulting files:
91+
use the format script (which uses ruff) and commit the resulting files:
9492

9593
.. code-block:: bash
9694
97-
$ scripts/format
95+
$ uv run scripts/format
9896
$ git commit -a -m 'formatting updates'
9997
10098
10199
To build the documentation, `install Pandoc <https://pandoc.org/installing.html>`_, install the
102-
Python documentation requirements via pip, then use the ``build-docs`` script:
100+
Python documentation requirements via uv, then use the ``build-docs`` script:
103101

104102
.. code-block:: bash
105103
106-
$ pip install -e '.[docs]'
107-
$ scripts/build-docs
104+
$ uv pip install -e . --group docs
105+
$ uv run scripts/build-docs
108106
109107
CHANGELOG
110108
^^^^^^^^^
@@ -134,7 +132,7 @@ To run the benchmarks, use the ``--benchmark-only`` flag:
134132

135133
.. code-block:: bash
136134
137-
$ pytest --benchmark-only
135+
$ uv run pytest --benchmark-only
138136
============================= test session starts ==============================
139137
platform darwin -- Python 3.9.13, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
140138
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)

scripts/format

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ fi
99
function usage() {
1010
echo -n \
1111
"Usage: $(basename "$0")
12-
Format code with black
12+
Format code with ruff
1313
"
1414
}
1515

1616
if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
1717
if [ "${1:-}" = "--help" ]; then
1818
usage
1919
else
20-
pre-commit run black --all-files
20+
pre-commit run ruff-format --all-files
2121
fi
2222
fi

0 commit comments

Comments
 (0)