Skip to content

Commit 7acfce1

Browse files
Clean up of setup.py, Moving more to pyproject.toml (westpa#519)
* moved most things over to pyproject.toml * move a little back * healthy medium * move requires-python down above dependencies * lint changes to black
1 parent 4e78ddc commit 7acfce1

File tree

6 files changed

+57
-54
lines changed

6 files changed

+57
-54
lines changed

pyproject.toml

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,59 @@ requires = [
88
"Cython >=0.29.16", # Note: sync with setup.py
99
"numpy >=2.0.0, <3", # Force numpy>=2 during build time so it works on both 1.XX and 2.XX
1010
"scipy >=0.19.1",
11-
"versioneer-518"
11+
"versioneer-518",
1212
]
1313
# Uncommenting this requires adding the top level of the repo to sys.path in the setup.py
1414
# so that it can find the vendorized copy of versioneer. I see that other projects don't
1515
# always include this (pandas, numpy, etc), so leaving this off for now
1616
# build-backend = "setuptools.build_meta"
1717

18+
19+
[project]
20+
name = "westpa"
21+
dynamic = ["version", "scripts"]
22+
license = "MIT"
23+
license-files = ["LICEN[CS]E.*"]
24+
readme = {file = "README.rst", content-type = "text/x-rst"}
25+
keywords = []
26+
description = 'WESTPA is a package for constructing and running stochastic simulations using the "weighted ensemble" approach of Huber and Kim (1996).'
27+
classifiers = [
28+
"Development Status :: 5 - Production/Stable",
29+
"Intended Audience :: Developers",
30+
"Intended Audience :: Science/Research",
31+
"Operating System :: POSIX",
32+
"Programming Language :: Python",
33+
"Programming Language :: Python :: 3",
34+
"Programming Language :: Cython",
35+
]
36+
requires-python = ">=3.10"
37+
dependencies = [
38+
"numpy >= 1.25.0,<3",
39+
"scipy >= 0.19.1",
40+
"h5py >= 2.10",
41+
"mdtraj >= 1.9.5",
42+
"pyyaml",
43+
"pyzmq",
44+
"matplotlib",
45+
"blessings",
46+
"ipykernel",
47+
"tqdm",
48+
"pandas",
49+
"tables",
50+
]
51+
52+
[project.optional-dependencies]
53+
tests = ["pytest", "pytest-cov", "pytest-rerunfailures", "pytest-timeout"]
54+
mpi = ["mpi4py"]
55+
dev = ["westpa[tests]", "pre-commit"]
56+
57+
[project.urls]
58+
Homepage = "https://westpa.github.io"
59+
Repository = "https://github.com/westpa/westpa"
60+
Documentation = "https://github.readthedocs.io"
61+
Issues = "https://github.com/westpa/westpa/issues"
62+
63+
1864
[tool.black]
1965
line-length = 132
2066
skip-string-normalization = true
@@ -44,6 +90,9 @@ exclude = '''
4490
)
4591
'''
4692

93+
[tool.setuptools.packages.find]
94+
where = ["src"]
95+
4796
# See the docstring in versioneer.py for instructions. Note that you must
4897
# re-run 'versioneer.py setup' after changing this section, and commit the
4998
# resulting files.

setup.py

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sys
22

3-
from setuptools import setup, Extension, find_packages
3+
from setuptools import setup, Extension
44

55
import versioneer
66

@@ -98,58 +98,12 @@ def extensions():
9898

9999
console_scripts = console_scripts_core + console_scripts_tools
100100

101-
CLASSIFIERS = [
102-
"Development Status :: 5 - Production/Stable",
103-
"Intended Audience :: Developers",
104-
"Intended Audience :: Science/Research",
105-
"License :: OSI Approved :: MIT License",
106-
"Operating System :: POSIX",
107-
"Programming Language :: Python",
108-
"Programming Language :: Python :: 3",
109-
"Programming Language :: Cython",
110-
]
111-
112-
INSTALL_REQUIRES = [
113-
"numpy >= 1.25.0, <3",
114-
"scipy >= 0.19.1",
115-
"h5py >= 2.10",
116-
"mdtraj >= 1.9.5",
117-
"pyyaml",
118-
"pyzmq",
119-
"matplotlib",
120-
"blessings",
121-
"ipykernel",
122-
"tqdm",
123-
"pandas",
124-
"tables",
125-
]
126-
127-
EXTRAS_REQUIRE = {
128-
"tests": ["pytest", "pytest-cov", "pytest-rerunfailures", "pytest-timeout"],
129-
"mpi": ["mpi4py"],
130-
}
131-
132-
EXTRAS_REQUIRE["dev"] = EXTRAS_REQUIRE["tests"] + ["pre-commit"]
133-
134101

135102
metadata = dict(
136-
name='westpa',
137-
url='http://github.com/westpa/westpa',
138-
license='MIT',
139-
long_description=open('README.rst', encoding='utf8').read(),
140103
version=versioneer.get_version(),
141-
keywords='',
142104
cmdclass=versioneer.get_cmdclass(),
143-
python_requires=">=3.10",
144105
zip_safe=False,
145-
classifiers=CLASSIFIERS,
146106
entry_points={'console_scripts': console_scripts},
147-
install_requires=INSTALL_REQUIRES,
148-
extras_require=EXTRAS_REQUIRE,
149-
package_data={},
150-
packages=find_packages(where='src'),
151-
package_dir={"": "src"},
152-
description='WESTPA is a package for constructing and running stochastic simulations using the "weighted ensemble" approach of Huber and Kim (1996).',
153107
)
154108

155109

src/westpa/cli/tools/w_reweight.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def _pop_eval_block(
9292
do_correl,
9393
mcbs_enable,
9494
estimator_kwargs,
95-
**kwargs
95+
**kwargs,
9696
):
9797
# As our reweighting estimator is a weird function, we can't use the general mclib block.
9898
# A little hack to make our estimator play nice, as jstate must be there.
@@ -680,7 +680,7 @@ def w_postanalysis_stateprobs(self):
680680
name='Bin Population Evolution',
681681
mcbs_enable=self.mcbs_enable,
682682
data_input={},
683-
**submit_kwargs
683+
**submit_kwargs,
684684
)
685685
# print(future_kwargs)
686686
futures.append(generate_future(self.work_manager, 'Bin Pop Evolution', _pop_eval_block, future_kwargs))

src/westpa/mclib/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def _1D_simple_eval_block(
204204
do_correl,
205205
mcbs_enable,
206206
subsample=np.mean,
207-
**extra
207+
**extra,
208208
):
209209
# This is actually appropriate for anything with a directly measured, 1D dataset, i.e.,
210210
# Fluxes, color populations, and state populations.
@@ -242,7 +242,7 @@ def _2D_simple_eval_block(
242242
do_correl,
243243
mcbs_enable,
244244
subsample=np.mean,
245-
**extra
245+
**extra,
246246
):
247247
# This is really just a simple 2D block for less complex datasets, but there it is.
248248
# It's probably limited in this use case to conditional_fluxes, but anything that's an i to j process that is directly measured

src/westpa/tools/kinetics_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def run_calculation(
302302
name=name,
303303
mcbs_enable=self.mcbs_enable,
304304
data_input={},
305-
**extra
305+
**extra,
306306
)
307307

308308
# Slice up the datasets for this iteration slice.

src/westpa/westext/stringmethod/string_method.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def __init__(
8787
fourier_P=2,
8888
fourier_maxiters=100,
8989
fourier_tol=1.0e-6,
90-
**kwargs
90+
**kwargs,
9191
):
9292
super().__init__(centers, **kwargs)
9393

0 commit comments

Comments
 (0)