From 6241cdb27be0ed81a517f1601feac1b7e327170c Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Mon, 7 Nov 2022 15:00:22 -0800 Subject: encode development requirements in pyproject.toml (#32616) Add a `project` block to the toml config along with development and CI dependencies and a minimal `build-system` block, doing basically nothing, so that spack can be bootstrapped to a full development environment with: ```shell $ hatch -e dev shell ``` or for a minimal environment without hatch: ```shell $ python3 -m venv venv $ source venv/bin/activate $ python3 -m pip install --upgrade pip $ python3 -m pip install -e '.[dev]' ``` This means we can re-use the requirements list throughout the workflow yaml files and otherwise maintain this list in *one place* rather than several disparate ones. We may be stuck with a couple more temporarily to continue supporting python2.7, but aside from that it's less places to get out of sync and a couple new bootstrap options. Co-authored-by: Adam J. Stewart --- pyproject.toml | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) (limited to 'pyproject.toml') diff --git a/pyproject.toml b/pyproject.toml index f5fed2df4b..30b621dec4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,74 @@ +[project] +name="spack" +description="The spack package manager" +dependencies=[ + "clingo", + "setuptools", + "six", + "types-six", +] +dynamic = ["version"] + +[project.scripts] +spack = "lib.spack.spack_installable.main:main" + +[tool.hatch.version] +path = "lib/spack/spack/__init__.py" + +[project.optional-dependencies] +dev = [ + "pip>=21.3", + "pytest", + "pytest-xdist", + "setuptools", + "click==8.0.2", + 'black==21.12b0', + "mypy", + "isort", + "flake8", + "vermin", +] +ci = [ + "pytest-cov", + "codecov[toml]", +] + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.build.targets.wheel] +include = [ + "/bin", + "/etc", + "/lib", + "/share", + "/var", + "CITATION.cff", + "COPYRIGHT", + "LICENSE-APACHE", + "LICENSE-MIT", + "NOTICE", + "README.md", + "SECURITY.md", +] + +[tool.hatch.envs.default] +features = [ + "dev", +] + +[tool.hatch.envs.default.scripts] +spack = "./bin/spack" +style = "./bin/spack style" +test = "./bin/spack unit-test" + +[tool.hatch.envs.ci] +features = [ + "dev", + "ci", +] + [tool.black] line-length = 99 target-version = ['py27', 'py35', 'py36', 'py37', 'py38', 'py39', 'py310'] -- cgit v1.2.3-70-g09d2