Skip to content

Commit aba82f9

Browse files
committed
Transition to pyproject.toml
1 parent bd60840 commit aba82f9

File tree

8 files changed

+97
-136
lines changed

8 files changed

+97
-136
lines changed

.github/workflows/ci.yml

+12-19
Original file line numberDiff line numberDiff line change
@@ -32,41 +32,34 @@ jobs:
3232
if: startsWith(runner.os, 'Linux')
3333
with:
3434
path: ~/.cache/pip
35-
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt') }}
35+
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
3636

3737
- uses: actions/cache@v2
3838
if: startsWith(runner.os, 'macOS')
3939
with:
4040
path: ~/Library/Caches/pip
41-
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt') }}
41+
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
4242

4343
- uses: actions/cache@v2
4444
if: startsWith(runner.os, 'Windows')
4545
with:
4646
path: ~\AppData\Local\pip\Cache
47-
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('**/*requirements.txt') }}
47+
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip-${{ hashFiles('pyproject.toml') }}
4848

4949
- name: Install dependencies
5050
run: |
5151
python -m pip install --upgrade pip
52-
pip install numpy wheel
53-
pip install -r requirements.txt
54-
pip install -r dev-requirements.txt
52+
pip install build
53+
pip install .[development]
5554
5655
# Note the use of the -Wa flag to show DeprecationWarnings
57-
- name: Unit tests
56+
- name: Unit tests and doctests
5857
run: |
59-
python setup.py install
60-
cd ~
61-
python -Wa -m pytest --pyargs iris
58+
python -Wa -m pytest
6259
6360
- name: Build documentation
64-
run: |
65-
python setup.py build_sphinx
66-
67-
- name: Doctests
68-
run: |
69-
python -m sphinx -b doctest docs build
61+
run:
62+
sphinx-build -M html docs build/docs
7063

7164

7265
release:
@@ -86,8 +79,8 @@ jobs:
8679

8780
- name: Install dependencies
8881
run: |
89-
pip install -r requirements.txt
90-
pip install -r dev-requirements.txt
82+
pip install build
83+
pip install .[development]
9184
9285
- name: Create release description
9386
run: |
@@ -96,7 +89,7 @@ jobs:
9689
9790
- name: Create source distribution
9891
run: |
99-
python setup.py sdist
92+
python -m build
10093
10194
- name: Create release
10295
uses: softprops/action-gh-release@v2

.readthedocs.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ build:
1414

1515
python:
1616
install:
17-
- requirements: requirements.txt
18-
- requirements: dev-requirements.txt
17+
- method: pip
18+
path: .
19+
extra_requirements:
20+
- development

MANIFEST.in

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
include README.md
22
include CHANGELOG.rst
33
include LICENSE.txt
4-
include requirements.txt
5-
include dev-requirements.txt
64
include iris_screen.png
75

86
recursive-exclude docs *

dev-requirements.txt

-12
This file was deleted.

pyproject.toml

+81
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,88 @@
1+
[build-system]
2+
requires = ["build", "setuptools>=61.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools]
6+
packages = ["iris"]
7+
8+
[tool.setuptools.dynamic]
9+
version = {attr = "iris.__version__"}
10+
11+
[project]
12+
name = "iris-ued"
13+
dynamic = ["version"]
14+
authors = [
15+
{ name="Laurent P. René de Cotret", email="laurent.decotret@outlook.com" },
16+
]
17+
maintainers = [
18+
{ name="Laurent P. René de Cotret", email="laurent.decotret@outlook.com" },
19+
]
20+
description = "Ultrafast electron diffraction data exploration"
21+
readme = "README.md"
22+
license = {file = "LICENSE"}
23+
requires-python = ">=3.7, <4"
24+
dependencies = [
25+
"numpy >= 1.22,< 3",
26+
"scipy >= 1.0.0",
27+
"h5py >= 2.10.0, < 4",
28+
"PyQt5 >=5.15, <6",
29+
"crystals >= 1.3.0, < 2",
30+
"scikit-ued >= 2.1.4, < 3",
31+
"qdarkstyle >= 2.8, < 3",
32+
"pyqtgraph >= 0.11",
33+
"npstreams >= 1.6.5, < 2",
34+
"packaging >= 20",
35+
]
36+
keywords=["crystallography", "material science", "structural biology"]
37+
classifiers = [
38+
"Development Status :: 5 - Production/Stable",
39+
"Intended Audience :: Science/Research",
40+
"Topic :: Scientific/Engineering",
41+
"Topic :: Scientific/Engineering :: Physics",
42+
"Topic :: Scientific/Engineering :: Chemistry",
43+
"Topic :: Scientific/Engineering :: Visualization",
44+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
45+
"Natural Language :: English",
46+
"Operating System :: OS Independent",
47+
"Programming Language :: Python",
48+
"Programming Language :: Python :: 3.8",
49+
"Programming Language :: Python :: 3.9",
50+
"Programming Language :: Python :: 3.10",
51+
"Programming Language :: Python :: 3.11",
52+
"Programming Language :: Python :: Implementation :: CPython",
53+
]
54+
55+
[project.optional-dependencies]
56+
development = [
57+
"Sphinx >= 3",
58+
"sphinx_rtd_theme >= 0.4",
59+
"pytest >= 6",
60+
"black",
61+
"isort",
62+
]
63+
64+
[project.urls]
65+
Documentation = "https://iris-ued.readthedocs.io/"
66+
Repository = "https://github.com/LaurentRDC/iris-ued"
67+
"Bug Tracker" = "https://github.com/LaurentRDC/iris-ued/issues"
68+
69+
[project.scripts]
70+
iris-cli = "iris.__main__:main"
71+
172
[tool.black]
273
line-length = 120
374
include = '\.pyi?$'
475

576
[tool.isort]
677
profile = "black"
778
src_paths = ["iris/**/*.py"]
79+
80+
[tool.pytest.ini_options]
81+
minversion = "6.0"
82+
log_cli_level = "INFO"
83+
# Very cool ability for pytest to also run doctests on package contents with `-doctest-modules`
84+
addopts = [
85+
"--doctest-modules",
86+
"--ignore=iris/tests/broken_plugin.py",
87+
]
88+
testpaths = ["iris/tests"]

requirements.txt

-10
This file was deleted.

setup.cfg

-9
This file was deleted.

setup.py

-82
This file was deleted.

0 commit comments

Comments
 (0)