Skip to content

Commit

Permalink
Use pyproject.toml to install appletree (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
dachengx committed Sep 4, 2024
1 parent 63367ae commit a70de8d
Show file tree
Hide file tree
Showing 10 changed files with 94 additions and 118 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.5.1
files = setup.py appletree/__init__.py
files = appletree/__init__.py
commit = True
tag = True
3 changes: 1 addition & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
branches: [ master ]

jobs:
build:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -44,7 +44,6 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install pytest coverage coveralls
pip install -r requirements.txt
- name: Install Appletree
run: |
Expand Down
3 changes: 3 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ repos:
rev: v1.7.5
hooks:
- id: docformatter
additional_dependencies: [tomli]
args: [--config, pyproject.toml]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.1
Expand All @@ -34,6 +36,7 @@ repos:
hooks:
- id: doc8
files: ^docs/.*\.(rst|md)$
args: [--ignore, D001]

- repo: https://github.com/pycqa/flake8
rev: 7.1.1
Expand Down
4 changes: 0 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@ build:

python:
install:
- requirements: requirements.txt
- requirements: docs/requirements-docs.txt
- method: pip
path: .
extra_requirements:
- docs
- method: setuptools
path: .

formats:
- htmlzip
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ A high-Performance Program simuLatEs and fiTs REsponse of xEnon.
With cpu support:

```
pip install appletree[cpu]
pip install appletree jax[cpu]
```

With CUDA Toolkit 11.2 support:

```
pip install appletree[cuda112] -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
pip install appletree jax[cuda]==0.3.15 -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
```

With CUDA Toolkit 12.1 support:

```
pip install appletree[cuda121] -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
pip install appletree jax[cuda12_pip] -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
```

### Developer setup:
Expand All @@ -41,14 +41,14 @@ git clone https://github.com/XENONnT/appletree
cd appletree
```

To install the package and requirements in your environment, replace `pip install appletree[*]` to `python3 -m pip install .[*] --user` in the above `pip` commands.
To install the package and requirements in your environment, add `--user` in the above commands.

To install appletree in editable mode, insert `--editable` argument after `install` in the above `pip install` or `python3 -m pip install` commands.
To install appletree in editable mode, insert `--editable` argument after `install` in the above `pip install` commands.

For example, to install in your environment and in editable mode with CUDA Toolkit 12.1 support:

```
python3 -m pip install --editable .[cuda121] --user -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
pip install --editable . jax[cuda]==0.3.15 -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html --user
```

Then you are now good to go!
Expand Down
11 changes: 0 additions & 11 deletions docs/requirements-docs.txt

This file was deleted.

83 changes: 83 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
[tool]
[tool.poetry]
name = "appletree"
version = "0.5.1"
description = "A high-Performance Program simuLatEs and fiTs REsponse of xEnon."
readme = "README.md"
authors = [
"Appletree contributors, the XENON collaboration",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering :: Physics",
]
repository = "https://github.com/XENONnT/appletree"

[tool.poetry.scripts]
rechunker = "bin.rechunker:main"

[tool.poetry.dependencies]
python = ">=3.8,<3.13"
jax = "*"
corner = "*"
emcee = "*"
GOFevaluation = "*"
h5py = "*"
immutabledict = "*"
matplotlib = "*"
multihist = "*"
numpy = "<2.0.0"
numpyro = "*"
pandas = "*"
scikit-learn = "*"
scipy = "*"
strax = "*"
straxen = "*"
graphviz = "*"
commonmark = { version = "0.9.1", optional = true }
m2r = { version = "0.2.1", optional = true }
mistune = { version = "0.8.4", optional = true }
nbsphinx = { version = "0.8.9", optional = true }
recommonmark = { version = "0.7.1", optional = true }
sphinx = { version = "5.2.3", optional = true }
sphinx_rtd_theme = { version = "1.0.0", optional = true }
Jinja2 = { version = "3.0.3", optional = true }
lxml_html_clean = { version = "*", optional = true }

[tool.poetry.extras]
docs = [
"commonmark",
"m2r",
"mistune",
"nbsphinx",
"recommonmark",
"sphinx",
"sphinx_rtd_theme",
"Jinja2",
"lxml_html_clean",
]

[build-system]
requires = ["poetry-core>=1.0.8", "setuptools>=61.0"]
build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 100
preview = true

[tool.docformatter]
recursive = true
in-place = true
style = "google"
wrap-summaries = 100
wrap-descriptions = 100
blank = true

[tool.doc8]
max-line-length = 100
16 changes: 0 additions & 16 deletions requirements.txt

This file was deleted.

10 changes: 0 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,3 @@ ignore = E203, W503

per-file-ignores =
appletree/*__init__.py: E402, F401, F403

[docformatter]
in-place = true
blank = true
style = google
wrap-summaries = 100
wrap-descriptions = 100

[doc8]
ignore = D001
68 changes: 0 additions & 68 deletions setup.py

This file was deleted.

0 comments on commit a70de8d

Please sign in to comment.