Skip to content

Commit

Permalink
ci: Remove all unused hatch config
Browse files Browse the repository at this point in the history
All previous functionality is possible without this now.
Did some tidying up of what is left using (https://github.com/vega/vega-datasets/blob/369b462f7505e4ef3454668793e001e3620861ff/taplo.toml)

## Remaining sections
- `build`, `metadata`, `version` tables are used by `hatchling`
  - (https://hatch.pypa.io/latest/why/#build-backend)
- The `doc` environment is retained **only** due to how `_HatchRunner` is implemented
  - Otherwise we can remove that
  - (6e792a1)
- The test matrix functionality isn't something I've tried to reproduce, so left that in
  - Unsure how often others use it, but we could swap that out for `nox`
    - https://github.com/narwhals-dev/narwhals/blob/024d5d2294d1dcdd2e2f043d59eb03a3238c9e87/noxfile.py#L13
  • Loading branch information
dangotbanned committed Dec 31, 2024
1 parent 6e792a1 commit e8d57cd
Showing 1 changed file with 8 additions and 90 deletions.
98 changes: 8 additions & 90 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,102 +99,20 @@ doc = [
"scipy",
]

[tool.hatch.version]
path = "altair/__init__.py"
[tool.hatch]
build = { include = ["/altair"], artifacts = ["altair/jupyter/js/index.js"] }
metadata = { allow-direct-references = true }
version = { path = "altair/__init__.py" }

[tool.hatch.metadata]
allow-direct-references = true

[tool.hatch.build]
include = ["/altair"]
artifacts = ["altair/jupyter/js/index.js"]

[tool.hatch.envs.default]
features = ["all", "dev"]
[tool.hatch.envs]
# https://hatch.pypa.io/latest/how-to/environment/select-installer/#enabling-uv
installer = "uv"

[tool.hatch.envs.default.scripts]
generate-schema-wrapper = [
"mypy tools",
"python tools/generate_schema_wrapper.py",
"test"
]
test = [
"ruff check .",
"ruff format --diff --check .",
"mypy altair tests",
"python -m pytest --pyargs --numprocesses=logical --doctest-modules tests altair tools",
]
test-coverage = "python -m pytest --pyargs --doctest-modules --cov=altair --cov-report term altair"
test-coverage-html = "python -m pytest --pyargs --doctest-modules --cov=altair --cov-report html altair"
update-init-file = [
"python tools/update_init_file.py",
"ruff check .",
"ruff format .",
]
test-fast = [
"ruff check .", "ruff format .",
"pytest -p no:randomly -n logical --numprocesses=logical --doctest-modules tests altair tools -m \"not slow\" {args}"
]
test-slow = [
"ruff check .", "ruff format .",
"pytest -p no:randomly -n logical --numprocesses=logical --doctest-modules tests altair tools -m \"slow\" {args}"
]
default = { features = ["all", "dev"], installer = "uv" }
doc = { features = ["all", "dev", "doc"] }

[tool.hatch.envs.hatch-test]
# https://hatch.pypa.io/latest/tutorials/testing/overview/
features = ["all", "dev", "doc"]
# https://pytest-xdist.readthedocs.io/en/latest/distribution.html#running-tests-across-multiple-cpus
default-args = ["--numprocesses=logical","--doctest-modules", "tests", "altair", "tools"]
parallel = true
[[tool.hatch.envs.hatch-test.matrix]]
python = ["3.9", "3.10", "3.11", "3.12", "3.13"]
[tool.hatch.envs.hatch-test.scripts]
run = [
"ruff check .",
"ruff format --diff --check .",
"mypy altair tests",
"pytest{env:HATCH_TEST_ARGS:} {args}"
]
run-cov = "coverage run -m pytest{env:HATCH_TEST_ARGS:} {args}"
cov-combine = "coverage combine"
cov-report = "coverage report"

[tool.hatch.envs.doc]
features = ["all", "dev", "doc"]

[tool.hatch.envs.doc.scripts]
clean = "rm -rf doc/_build"
clean-generated = ["rm -rf doc/user_guide/generated", "rm -rf doc/gallery"]
clean-all = ["clean", "clean-generated", "rm -rf doc/_images"]
clean-win = "if exist doc\\_build rd /s /q doc\\_build"
clean-generated-win = [
"if exist doc\\user_guide\\generated rd /s /q doc\\user_guide\\generated",
"if exist doc\\gallery rd /s /q doc\\gallery",
]
clean-all-win = [
"clean-win",
"clean-generated-win",
"if exist doc\\_images rd /s /q doc\\_images",
]
build-html = [
"mkdir doc/_images",
"sphinx-build -b html -d doc/_build/doctrees doc doc/_build/html",
]
build-html-win = [
"if not exist doc\\_images md doc\\_images",
"sphinx-build -b html -d doc\\_build\\doctrees doc doc\\_build\\html",
]
doctest = "sphinx-build -b doctest -d doc/_build/doctrees doc doc/_build/doctest"
coverage = "sphinx-build -b coverage -d doc/_build/doctrees doc doc/_build/coverage"
serve = "(cd doc/_build/html && python -m http.server)"
publish = "python doc/sync_website.py --no-commit"
publish-clean-build = [
"clean-all",
"build-html",
"publish"
]
matrix = [{ python = ["3.9", "3.10", "3.11", "3.12", "3.13"] }]

[tool.ruff]
target-version = "py39"
Expand Down

0 comments on commit e8d57cd

Please sign in to comment.