Skip to content

Commit

Permalink
Make dev dependencies optional
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Jan 4, 2025
1 parent fc28d93 commit 57e041e
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Install artistools
run: |
python3 -m pip install uv
python3 -m uv pip install --compile-bytecode --editable .
python3 -m uv pip install --compile-bytecode --editable .[dev]
- name: Cache test data
uses: actions/cache@v4
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploypypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,3 @@ jobs:
with:
skip-existing: true
verbose: false
#repository-url: https://test.pypi.org/legacy/
40 changes: 19 additions & 21 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,18 @@ jobs:
- name: Install artistools
run: |
python3 -m pip install uv
python3 -m uv pip install --system --upgrade pylint mypy
python3 -m uv pip install --compile-bytecode --editable .
python3 -m uv pip install --compile-bytecode --editable .[dev]
- name: Run Ruff
if: always()
uses: astral-sh/ruff-action@v3
with:
version: 0.8.4
args: "check --exit-non-zero-on-fix --no-fix"
args: "check --exit-non-zero-on-fix --no-fix"

- name: Run Ruff Format
if: always()
uses: astral-sh/ruff-action@v3
with:
version: 0.8.4
args: "format --check"

- name: Run pyright
Expand Down Expand Up @@ -88,7 +85,7 @@ jobs:
- name: Install artistools
run: |
python3 -m pip install uv
python3 -m uv pip install --compile-bytecode --editable .
python3 -m uv pip install --compile-bytecode --editable .[dev]
- uses: pre-commit/[email protected]

Expand Down Expand Up @@ -166,10 +163,22 @@ jobs:
pytest-rust-target-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-
pytest-rust-target-${{ runner.os }}-
- name: Install artistools
- name: Install artistools (no optional deps)
run: |
python3 -m pip install uv
python3 -m uv pip install --compile-bytecode --editable .
python3 -m uv pip install .
- name: Check artistools command line tool
run: |
artistools --help
artistools completions
- name: Download/extract test data
working-directory: tests/data/
run: source ./setuptestdata.sh

- name: Install artistools[dev]
run: python3 -m uv pip install --compile-bytecode --editable .[dev]

- name: Cache test data
uses: actions/cache@v4
Expand All @@ -178,22 +187,11 @@ jobs:
path: tests/data/*.tar.xz
key: testdata20231114

- name: Download/extract test data
working-directory: tests/data/
run: source ./setuptestdata.sh

- name: Check artistools command line tool
run: |
artistools --help
artistools completions
- name: Test with pytest
run: |
pytest --cov=./ --cov-report=xml
run: python3 -m pytest --cov=./ --cov-report=xml

- name: Report coverage
run: |
coverage report
run: python3 -m coverage report

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ artistools can be installed from PyPI using `pip install artistools'. For develo
```sh
git clone https://github.com/artis-mcrt/artistools.git
cd artistools
python3 -m pip install -e .
python3 -m pip install --editable .[dev]
pre-commit install
```

Expand Down
46 changes: 42 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,51 @@ classifiers = [
"Framework :: Matplotlib",
"Intended Audience :: Science/Research",
]
dynamic = ["version", "dependencies"]
dynamic = ["version"]
requires-python = ">=3.10"
license = { text = "MIT" }
readme = { file = "README.md", content-type = 'text/markdown' }
dependencies = [
"argcomplete>=3.5.1",
"astropy>=6.1.4",
"extinction>=0.4.7",
"george>=0.4.3",
"imageio>=2.36.0",
"matplotlib>=3.9.2",
"numexpr>=2.10.1",
"numpy>=2.2.0",
"pandas>=2.2.3",
"plotly>=5.24.1",
"polars>=1.18.0",
"pyarrow>=18.1.0",
"pynonthermal>=2024.7.4",
"pypdf>=5.1.0",
"PyYAML>=6.0.2",
"rich>=13.9.4",
"scipy>=1.14.1",
"tabulate>=0.9",
"tqdm>=4.67.1",
"wheel>=0.44.0",
"zstandard>=0.23.0",
]

[project.optional-dependencies]
dev = [
"mypy[faster-cache]>=1.14.1",
"pandas-stubs>=2.2.3.241126",
"pre-commit>=4.0.1",
"pylint>=3.3.3",
"pyright>=1.1.387",
"pytest>=8.3.3",
"pytest-codspeed>=3.0.0",
"pytest-cov>=6.0.0",
"pytest-xdist[psutil]>=3.6.1",
"types-PyYAML>=6.0.12.20240917",
"types-tabulate>=0.9.0.20240106",
"typeguard>=4.4.1",
"ruff>=0.8.6",
]
pyvista = ["pyvista>=0.44.1"]

[project.urls]
Repository = "https://www.github.com/artis-mcrt/artistools"
Expand Down Expand Up @@ -346,9 +387,6 @@ exclude = [
"**/target",
]

[tool.setuptools.dynamic]
dependencies = { file = ["requirements.txt"] }

[tool.setuptools_scm]
version_file = "_version.py"
local_scheme = "no-local-version"
Expand Down
36 changes: 0 additions & 36 deletions requirements.txt

This file was deleted.

0 comments on commit 57e041e

Please sign in to comment.