diff options
author | Tom Scogland <scogland1@llnl.gov> | 2022-11-07 15:00:22 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-07 15:00:22 -0800 |
commit | 6241cdb27be0ed81a517f1601feac1b7e327170c (patch) | |
tree | 68caab8eb5992a218f0e276619ae3b70c153e086 /pyproject.toml | |
parent | 28d669cb39b155e73fea532ea4d8100a921041b0 (diff) | |
download | spack-6241cdb27be0ed81a517f1601feac1b7e327170c.tar.gz spack-6241cdb27be0ed81a517f1601feac1b7e327170c.tar.bz2 spack-6241cdb27be0ed81a517f1601feac1b7e327170c.tar.xz spack-6241cdb27be0ed81a517f1601feac1b7e327170c.zip |
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 <ajstewart426@gmail.com>
Diffstat (limited to 'pyproject.toml')
-rw-r--r-- | pyproject.toml | 71 |
1 files changed, 71 insertions, 0 deletions
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'] |