Skip to content

Commit 6ab31bd

Browse files
authored
Make matplotlib dependency optional. (#594)
* Make matplotlib dependency optional. * Require new mocpy. * Add requirement to RTD build. Use similar importorskip logic for sphgeom tests. * Give more general install instructions. * Autoformat. * Add full dependency in setup and smoke tests.
1 parent e91b9a3 commit 6ab31bd

File tree

12 files changed

+631
-496
lines changed

12 files changed

+631
-496
lines changed

.github/workflows/smoke-test.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,22 @@ jobs:
3434
run: |
3535
sudo apt-get update
3636
uv pip install --system -e .[dev]
37-
uv pip install --system -e .[full]
3837
if [ -f requirements.txt ]; then uv pip install --system -r requirements.txt; fi
3938
- name: List dependencies
4039
run: |
4140
pip list
4241
- name: Run unit tests with pytest
4342
run: |
4443
python -m pytest
44+
- name: Install FULL dependencies
45+
run: |
46+
uv pip install --system -e .[full]
47+
- name: List FULL dependencies
48+
run: |
49+
pip list
50+
- name: Run FULL unit tests with pytest
51+
run: |
52+
python -m pytest
4553
- name: Send status to Slack app
4654
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
4755
id: slack

.github/workflows/testing-and-coverage.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,14 @@ jobs:
3030
run: |
3131
sudo apt-get update
3232
uv pip install --system -e .[dev]
33-
uv pip install --system -e .[full]
3433
if [ -f requirements.txt ]; then uv pip install --system -r requirements.txt; fi
3534
- name: Run unit tests with pytest
35+
run: |
36+
python -m pytest
37+
- name: Install FULL dependencies
38+
run: |
39+
uv pip install --system -e .[full]
40+
- name: Run FULL unit tests with pytest
3641
run: |
3742
python -m pytest --cov=hats --cov-report=xml
3843
- name: Upload coverage report to codecov

.setup_dev.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ python -m pip install -e . > /dev/null
4141

4242
echo "Installing developer dependencies in local environment"
4343
python -m pip install -e .'[dev]' > /dev/null
44+
python -m pip install -e .'[full]' > /dev/null
45+
if [ -f requirements.txt ]; then python -m pip install -r requirements.txt > /dev/null; fi
4446
if [ -f docs/requirements.txt ]; then python -m pip install -r docs/requirements.txt > /dev/null; fi
4547

4648
echo "Installing pre-commit"

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ipykernel
22
ipython
33
jupytext
4+
matplotlib
45
myst_parser
56
nbconvert
67
nbsphinx

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ dependencies = [
2323
"cdshealpix>=0.7.0",
2424
"fsspec>=2023.10.0", # Used for abstract filesystems
2525
"jproperties>=2.0.0",
26-
"matplotlib>=3.10.1",
27-
"mocpy>=0.17.1",
26+
"mocpy>=0.19.0",
2827
"nested-pandas>=0.4.1",
2928
"numba>=0.58",
3029
"numpy>=2,<3",
@@ -55,9 +54,13 @@ dev = [
5554
"pytest-mock", # Used to mock objects in tests
5655
"pytest-timeout", # Used to test for code efficiency
5756
]
57+
plotting = [
58+
"matplotlib>=3.10.1",
59+
]
5860
full = [
5961
"fsspec[full]", # complete file system specs.
6062
"lsst-sphgeom ; sys_platform == 'darwin' or sys_platform == 'linux'", # To handle spherical sky polygons, not available on Windows
63+
"matplotlib>=3.10.1",
6164
]
6265

6366
[build-system]

0 commit comments

Comments
 (0)