Skip to content

Commit 461242b

Browse files
gadomskijsignell
andauthored
Move test, bench, and doc requirements out of pyproject.toml (#1407)
* chore: whitespace and copyright year update * chore: cleanup github templates * chore: move test and docs deps out of pyproject.toml This makes them easier to: - Freeze (using `uv pip compile`) - Avoid building in the case where all optional dependencies are enabled * chore: update changelog * fix: ceil codespell * fix(ci): some leftover test extras * fix(ci): one more * Update docs/contributing.rst Co-authored-by: Julia Signell <[email protected]> --------- Co-authored-by: Julia Signell <[email protected]>
1 parent 87e1a24 commit 461242b

14 files changed

+647
-60
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Steps to reproduce the behavior:
66

77
> Ex.
88
>
9-
> 1. Install stactools
10-
> 2. Run `scripts/test`
9+
> 1. Install pystac w/ dev requirements: `pip install -e . -r requirements-dev.txt`
10+
> 2. Run `pytest`
1111
> 3. See error
1212
1313
Include OS, Python version, and PySTAC version.
@@ -18,7 +18,7 @@ A clear and concise description of what you expected to happen.
1818
**Screenshots and shell session dumps**
1919
If applicable, add session dumps and/or screenshots to help explain your problem.
2020

21-
> ex. `scripts/lint >> lint_errors.txt`
21+
> ex. `pre-commit run ruff > ruff.txt`
2222
2323
**Additional context**
2424
Add any other context about the problem here.

.github/pull_request_template.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
**PR Checklist:**
88

9-
- [ ] `pre-commit` hooks pass locally
10-
- [ ] Tests pass (run `scripts/test`)
9+
- [ ] Pre-commit hooks and tests pass (run `scripts/test`)
1110
- [ ] Documentation has been updated to reflect changes, if applicable
1211
- [ ] This PR maintains or improves overall codebase code coverage.
1312
- [ ] Changes are added to the [CHANGELOG](https://github.com/stac-utils/pystac/blob/main/CHANGELOG.md). See [the docs](https://pystac.readthedocs.io/en/latest/contributing.html#changelog) for information about adding to the changelog.

.github/workflows/continuous-integration.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
cache: "pip"
4545

4646
- name: Install dependencies
47-
run: pip install .[validation,test]
47+
run: pip install .[validation] -r requirements-dev.txt
4848

4949
- name: Execute test suite
5050
run: ./scripts/test
@@ -65,7 +65,7 @@ jobs:
6565
cache: "pip"
6666

6767
- name: Install with dependencies
68-
run: pip install .[validation,test]
68+
run: pip install .[validation] -r requirements-dev.txt
6969

7070
- name: Run coverage with orjson
7171
run: pytest tests --cov
@@ -115,7 +115,7 @@ jobs:
115115
cache: "pip"
116116

117117
- name: Install with test dependencies
118-
run: pip install .[test]
118+
run: pip install . -r requirements-dev.txt
119119

120120
- name: Execute linters & type checkers
121121
run: pre-commit run --all-files
@@ -130,7 +130,7 @@ jobs:
130130
python-version: "3.10"
131131

132132
- name: Install
133-
run: pip install .[validation,test]
133+
run: pip install .[validation] -r requirements-dev.txt
134134

135135
- name: Uninstall orjson
136136
run: pip uninstall -y orjson
@@ -149,7 +149,7 @@ jobs:
149149
cache: "pip"
150150

151151
- name: Install all dependencies
152-
run: pip install .[bench,docs,orjson,test,urllib3,validation]
152+
run: pip install .[orjson,urllib3,validation,jinja2]
153153

154154
check-benchmarks:
155155
# This checks to make sure any API changes haven't broken any of the
@@ -163,7 +163,7 @@ jobs:
163163
python-version: "3.10"
164164
cache: "pip"
165165
- name: Install pystac
166-
run: pip install .[bench]
166+
run: pip install . -r requirements-dev.txt
167167
- name: Set asv machine
168168
run: asv machine --yes
169169
- name: Check benchmarks
@@ -180,6 +180,6 @@ jobs:
180180
- name: Install pandoc
181181
run: sudo apt-get install pandoc
182182
- name: Install pystac
183-
run: pip install .[docs]
183+
run: pip install . -r docs/requirements.txt
184184
- name: Check docs
185185
run: make -C docs html SPHINXOPTS="-W --keep-going"

.readthedocs.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ formats:
1616

1717
python:
1818
install:
19+
- requirements: docs/requirements.txt
1920
- method: pip
2021
path: .
21-
extra_requirements:
22-
- docs
2322

2423
sphinx:
2524
fail_on_warning: false

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- Update docstring of `name` argument to `Classification.apply` and `Classification.create` to agree with extension specification ([#1356](https://github.com/stac-utils/pystac/pull/1356))
1515
- Add example of custom `StacIO` for Azure Blob Storage to docs ([#1372](https://github.com/stac-utils/pystac/pull/1372))
1616
- Noted that collection links can be used in non-item objects in STAC v1.1.0 ([#1393](https://github.com/stac-utils/pystac/pull/1393))
17+
- Move test, docs, and bench requirements out of pyproject.toml ([#1407](https://github.com/stac-utils/pystac/pull/1407))
1718

1819
### Fixed
1920

@@ -672,7 +673,7 @@
672673

673674
- Fixed issue that can cause infinite recursion during full resolve ([#204](https://github.com/stac-utils/pystac/pull/193))
674675
- Fixed issue that required label_classes in label items ([#201](https://github.com/stac-utils/pystac/pull/201))
675-
- Fixed issue that caused geometries and bboxes produced by Shapely to fail PySTAC's validaton ([#201](https://github.com/stac-utils/pystac/pull/201))
676+
- Fixed issue that caused geometries and bboxes produced by Shapely to fail PySTAC's validator ([#201](https://github.com/stac-utils/pystac/pull/201))
676677
- Allow for path prefixes like /vsitar/ ([#208](https://github.com/stac-utils/pystac/pull/208))
677678
- Fix Item set_self_href to ensure item asset locations do not break ([#226](https://github.com/stac-utils/pystac/pull/226))
678679
- Fixed an incorrect exception being thrown from Link.get_href() if there is no target_href ([#201](https://github.com/stac-utils/pystac/pull/201))

CODE_OF_CONDUCT.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# PySTAC Community Code of Conduct
22

33
## Our Pledge
4+
45
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
56

67
## Enforcement

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2019, 2020, 2021 the authors
1+
Copyright 2019-2024 the authors
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ network requests when reading with PySTAC, you'll need
4242
pip install 'pystac[urllib3]'
4343
```
4444

45-
If you are using jupyter notebooks and want to enable pretty display of pystac objects you'll need [`jinja2`](https://pypi.org/project/Jinja2/)
45+
If you are using jupyter notebooks and want to enable pretty display of pystac
46+
objects you'll need [`jinja2`](https://pypi.org/project/Jinja2/)
4647

4748
```shell
4849
pip install 'pystac[jinja2]'

docs/contributing.rst

+10-6
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,19 @@ pip as follows:
1414
1515
git clone [email protected]:your_user_name/pystac.git
1616
cd pystac
17-
pip install -e '.[test]'
17+
pip install -e . -r requirements-dev.txt
1818
1919
Testing
2020
^^^^^^^
21-
tl;dr: Run ``./scripts/test`` to run all tests as they run on CI.
2221

23-
PySTAC runs tests using `pytest <https://docs.pytest.org/en/latest/>`_. You can find unit tests in the ``tests/``
24-
directory.
22+
PySTAC runs tests using `pytest <https://docs.pytest.org/en/latest/>`_. You can
23+
find unit tests in the ``tests/`` directory.
24+
25+
To run the tests:
26+
27+
.. code-block:: bash
28+
29+
$ pytest
2530
2631
To run the tests and generate the coverage report:
2732

@@ -49,7 +54,7 @@ Code quality checks
4954
^^^^^^^^^^^^^^^^^^^
5055

5156
tl;dr: Run ``pre-commit install --overwrite`` to perform checks when committing, and
52-
``./scripts/test`` to run all checks and tests.
57+
``pytest`` to run all tests.
5358

5459
PySTAC uses
5560

@@ -94,7 +99,6 @@ and report any improvements or regressions.
9499

95100
.. code-block:: bash
96101
97-
pip install -e '.[bench]'
98102
scripts/bench
99103
100104
The benchmark suite takes a while to run, and will report any significant

docs/requirements.in

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Sphinx
2+
boto3
3+
ipython
4+
jinja2
5+
jupyter
6+
nbsphinx
7+
pydata-sphinx-theme
8+
rasterio
9+
shapely
10+
sphinx-autobuild
11+
sphinx-design
12+
sphinxcontrib-fulltoc

0 commit comments

Comments
 (0)