Skip to content

Commit 3a5339c

Browse files
authored
[PEP518] Improve testsuite packaging (#4463)
* Adds pyproject.toml to testsuite * Clears up ambigous packaging * Keeps setup.py for dynamic things only * Update license file * Update links info * Update some setup.py docstring text * Adds various missing init files
1 parent 2192fbb commit 3a5339c

File tree

24 files changed

+1391
-152
lines changed

24 files changed

+1391
-152
lines changed

package/CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Enhancements
3434
`n_initial_contacts` attribute, with documentation. (Issue #2604, PR #4415)
3535

3636
Changes
37+
* Testsuite packaging now uses a pyproject.toml file (PR #4463)
3738
* Improvement of setuptools packaging, including deduplication of
3839
dependency lists (PR #4424)
3940
* As per NEP29, the minimum version of numpy has been raised to 1.23.

testsuite/LICENSE

Lines changed: 1206 additions & 0 deletions
Large diffs are not rendered by default.

testsuite/MDAnalysisTests/data/Amber/__init__.py

Whitespace-only changes.

testsuite/MDAnalysisTests/data/analysis/__init__.py

Whitespace-only changes.

testsuite/MDAnalysisTests/data/capping/__init__.py

Whitespace-only changes.

testsuite/MDAnalysisTests/data/contacts/__init__.py

Whitespace-only changes.

testsuite/MDAnalysisTests/data/coordinates/__init__.py

Whitespace-only changes.

testsuite/MDAnalysisTests/data/dlpoly/__init__.py

Whitespace-only changes.

testsuite/MDAnalysisTests/data/gms/__init__.py

Whitespace-only changes.

testsuite/MDAnalysisTests/data/gromacs/__init__.py

Whitespace-only changes.

testsuite/MDAnalysisTests/data/gromacs/gromos54a7_edited.ff/__init__.py

Whitespace-only changes.

testsuite/MDAnalysisTests/data/gromos11/__init__.py

Whitespace-only changes.

testsuite/MDAnalysisTests/data/lammps/__init__.py

Whitespace-only changes.

testsuite/MDAnalysisTests/data/merge/2zmm/__init__.py

Whitespace-only changes.

testsuite/MDAnalysisTests/data/merge/__init__.py

Whitespace-only changes.

testsuite/MDAnalysisTests/data/mol2/__init__.py

Whitespace-only changes.

testsuite/MDAnalysisTests/data/tprs/__init__.py

Whitespace-only changes.

testsuite/MDAnalysisTests/data/tprs/all_bonded/__init__.py

Whitespace-only changes.

testsuite/MDAnalysisTests/data/tprs/virtual_sites/__init__.py

Whitespace-only changes.

testsuite/MDAnalysisTests/data/windows/__init__.py

Whitespace-only changes.

testsuite/MDAnalysisTests/parallelism/__init__.py

Whitespace-only changes.

testsuite/pyproject.toml

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
[build-system]
2+
requires = [
3+
"setuptools >= 40.9.0",
4+
]
5+
build-backend = "setuptools.build_meta"
6+
7+
[project]
8+
name = "MDAnalysisTests"
9+
description = "MDAnalysis testsuite"
10+
license = {file = "LICENSE" }
11+
authors = [
12+
{name = "MDAnalysis", email = "[email protected]"},
13+
]
14+
maintainers = [
15+
{name = "MDAnalysis", email = "[email protected]"},
16+
]
17+
classifiers = [
18+
"Development Status :: 6 - Mature",
19+
"Environment :: Console",
20+
"Intended Audience :: Science/Research",
21+
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
22+
"Operating System :: POSIX",
23+
"Operating System :: MacOS :: MacOS X",
24+
"Operating System :: Microsoft :: Windows ",
25+
"Programming Language :: Python",
26+
"Programming Language :: Python :: 3",
27+
"Programming Language :: Python :: 3.9",
28+
"Programming Language :: Python :: 3.10",
29+
"Programming Language :: Python :: 3.11",
30+
"Programming Language :: Python :: 3.12",
31+
"Programming Language :: C",
32+
"Topic :: Scientific/Engineering",
33+
"Topic :: Scientific/Engineering :: Bio-Informatics",
34+
"Topic :: Scientific/Engineering :: Chemistry",
35+
"Topic :: Software Development :: Libraries :: Python Modules",
36+
]
37+
readme = {file = "README", content-type = "text/x-rst"}
38+
requires-python = ">=3.9"
39+
dynamic = ["version", "dependencies"]
40+
41+
[project.urls]
42+
Homepage = "https://www.mdanalysis.org"
43+
Download = "https://github.com/MDAnalysis/mdanalysis/releases"
44+
Documentation = "https://docs.mdanalysis.org/"
45+
"User Guide" = "https://userguide.mdanalysis.org/"
46+
"Issue Tracker" = "https://github.com/mdanalysis/mdanalysis/issues"
47+
"Github Discussions" = "https://github.com/MDAnalysis/mdanalysis/discussions"
48+
Discord = "https://discord.com/channels/807348386012987462/"
49+
Blog = "https://www.mdanalysis.org/blog/"
50+
Source = "https://github.com/mdanalysis/mdanalysis"
51+
52+
[tool.setuptools]
53+
zip-safe = false
54+
include-package-data = true
55+
56+
[tool.setuptools.packages.find]
57+
namespaces = false
58+
include=[
59+
"MDAnalysisTests",
60+
"MDAnalysisTests.data",
61+
"MDAnalysisTests.data.Amber",
62+
"MDAnalysisTests.data.capping",
63+
"MDAnalysisTests.data.coordinates",
64+
"MDAnalysisTests.data.gms",
65+
"MDAnalysisTests.data.gromos11",
66+
"MDAnalysisTests.data.merge",
67+
"MDAnalysisTests.data.tprs",
68+
"MDAnalysisTests.data.tprs.all_bonded",
69+
"MDAnalysisTests.data.tprs.virtual_sites",
70+
"MDAnalysisTests.data.analysis",
71+
"MDAnalysisTests.data.contacts",
72+
"MDAnalysisTests.data.dlpoly",
73+
"MDAnalysisTests.data.gromacs",
74+
"MDAnalysisTests.data.lammps",
75+
"MDAnalysisTests.data.mol2",
76+
"MDAnalysisTests.data.windows",
77+
]
78+
79+
[tool.setuptools.package-data]
80+
MDAnalysisTests = [
81+
"data/*.psf",
82+
"data/*.dcd",
83+
"data/*.pdb",
84+
"data/tprs/*.tpr",
85+
"data/tprs/all_bonded/*.gro",
86+
"data/tprs/all_bonded/*.top",
87+
"data/tprs/all_bonded/*.mdp",
88+
"data/*.tpr",
89+
"data/tprs/*/*.tpr",
90+
"data/*.gro",
91+
"data/*.xtc",
92+
"data/*.trr",
93+
"data/*npy",
94+
"data/*.crd",
95+
"data/*.xyz",
96+
"data/Amber/*.bz2",
97+
"data/Amber/*.prmtop",
98+
"data/Amber/*.top",
99+
"data/Amber/*.parm7",
100+
"data/Amber/*.rst7",
101+
"data/Amber/*.trj",
102+
"data/Amber/*.mdcrd",
103+
"data/Amber/*.ncdf",
104+
"data/Amber/*.nc",
105+
"data/Amber/*.inpcrd",
106+
"data/gromos11/*.gz",
107+
"data/gromos11/*.trc",
108+
"data/*.pqr",
109+
"data/*.pdbqt",
110+
"data/*.bz2",
111+
"data/*.gz",
112+
"data/*.ent",
113+
"data/*.fasta",
114+
"data/*.dat",
115+
"data/*.dms",
116+
"data/merge/2zmm/*.pdb",
117+
"data/*.trz",
118+
"data/mol2/*.mol2",
119+
"data/contacts/*.gro.bz2",
120+
"data/contacts/*.dat",
121+
"data/capping/*.gro",
122+
"data/capping/*.pdb",
123+
"data/lammps/*",
124+
"data/gms/*.xyz",
125+
"data/gms/*.gms",
126+
"data/gms/*.gms.gz",
127+
"data/*.inpcrd",
128+
"data/dlpoly/CONFIG*",
129+
"data/dlpoly/HISTORY*",
130+
"data/*.xml",
131+
"data/coordinates/*",
132+
"data/*xvg",
133+
"data/*.mmtf",
134+
"data/*.mmtf.gz",
135+
"data/analysis/*",
136+
"data/*.gsd",
137+
"data/windows/*",
138+
"data/*.itp",
139+
"data/gromacs/gromos54a7_edited.ff/*",
140+
"data/*.coor",
141+
"data/*.h5md",
142+
"data/*.in",
143+
"data/*.top",
144+
"data/*.sdf",
145+
"data/*.edr",
146+
"data/*.tng",
147+
"data/*.pdbx",
148+
"data/*.txt",
149+
]
150+
151+
[tool.pytest.ini_options]
152+
filterwarnings = [
153+
"always",
154+
"error:`np.*` is a deprecated alias for the builtin:DeprecationWarning",
155+
# don't enforce for third party packages though:
156+
"ignore:`np.*` is a deprecated alias for the builtin:DeprecationWarning:networkx.*:",
157+
"error:Creating an ndarray from ragged nested sequences",
158+
"error:invalid escape sequence \\\\:DeprecationWarning",
159+
# Ignore frequent errors popping up in our tests
160+
# Elements
161+
"ignore:Element information:UserWarning",
162+
# Mass
163+
"ignore:Failed to guess the mass:UserWarning",
164+
# Coordinates
165+
"ignore:No coordinate reader found:UserWarning",
166+
"ignore:Reader has no dt information, set to 1.0 ps",
167+
# NamedStream warnings
168+
"ignore:Constructed NamedStream:RuntimeWarning",
169+
]

testsuite/setup.cfg

Lines changed: 0 additions & 26 deletions
This file was deleted.

testsuite/setup.py

Lines changed: 15 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,27 @@
2323
#
2424
"""Setuptools-based setup script for tests of MDAnalysis.
2525
26-
A working installation of NumPy <http://numpy.scipy.org> is required.
26+
A working installation of MDAnalysis of the same version is required.
2727
2828
For a basic installation just type the command::
2929
30-
python setup.py install
30+
pip install .
3131
32-
For more in-depth instructions, see the installation section at the
33-
MDAnalysis Wiki:
32+
For more in-depth instructions, see the installation section in the
33+
MDAnalysis User Guide:
3434
35-
https://github.com/MDAnalysis/mdanalysis/wiki/INSTALL
35+
https://userguide.mdanalysis.org/stable/installation.html
3636
3737
Also free to ask on GitHub Discussions for help:
3838
3939
https://github.com/MDAnalysis/mdanalysis/discussions
4040
41-
(Note that the group really is called `mdnalysis-discussion' because
42-
Google groups forbids any name that contains the string `anal'.)
4341
"""
44-
from setuptools import setup, find_packages
42+
from setuptools import setup
4543
from setuptools.command import sdist
4644

4745
import os
4846
import shutil
49-
import codecs
50-
import sys
51-
import warnings
5247

5348

5449
class MDA_SDist(sdist.sdist):
@@ -77,122 +72,16 @@ def run(self):
7772
os.remove(os.path.join(here, 'AUTHORS'))
7873

7974

80-
# Make sure I have the right Python version.
81-
if sys.version_info[:2] < (3, 9):
82-
print("MDAnalysis requires Python 3.9 or better. "
83-
"Python {0:d}.{1:d} detected".format(*sys.version_info[:2]))
84-
print("Please upgrade your version of Python.")
85-
sys.exit(-1)
86-
87-
8875
if __name__ == '__main__':
8976
# this must be in-sync with MDAnalysis
9077
RELEASE = "2.8.0-dev0"
91-
with open("README") as summary:
92-
LONG_DESCRIPTION = summary.read()
93-
94-
CLASSIFIERS = [
95-
'Development Status :: 6 - Mature',
96-
'Environment :: Console',
97-
'Intended Audience :: Science/Research',
98-
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
99-
'Operating System :: POSIX',
100-
'Operating System :: MacOS :: MacOS X',
101-
'Operating System :: Microsoft :: Windows ',
102-
'Programming Language :: Python',
103-
'Programming Language :: Python :: 3',
104-
'Programming Language :: Python :: 3.9',
105-
'Programming Language :: Python :: 3.10',
106-
'Programming Language :: Python :: 3.11',
107-
'Programming Language :: C',
108-
'Topic :: Scientific/Engineering',
109-
'Topic :: Scientific/Engineering :: Bio-Informatics',
110-
'Topic :: Scientific/Engineering :: Chemistry',
111-
'Topic :: Software Development :: Libraries :: Python Modules',
112-
]
11378

114-
setup(name='MDAnalysisTests',
115-
version=RELEASE,
116-
description='MDAnalysis testsuite',
117-
long_description=LONG_DESCRIPTION,
118-
long_description_content_type='text/x-rst',
119-
author='MDAnalysis Development Team',
120-
author_email='[email protected]',
121-
maintainer='MDAnalysis Core Developers',
122-
maintainer_email='[email protected]',
123-
url='https://www.mdanalysis.org',
124-
download_url='https://github.com/MDAnalysis/mdanalysis/releases',
125-
project_urls={'Documentation': 'https://userguide.mdanalysis.org/stable/testing.html',
126-
'CI Coverage': 'https://codecov.io/gh/MDAnalysis/mdanalysis',
127-
'Developer Group': 'https://groups.google.com/g/mdnalysis-devel',
128-
'Issue Tracker': 'https://github.com/mdanalysis/mdanalysis/issues',
129-
'Source': 'https://github.com/mdanalysis/mdanalysis',
130-
},
131-
license='GPL-3.0-or-later',
132-
classifiers=CLASSIFIERS,
133-
packages=find_packages(),
134-
package_dir={'MDAnalysisTests': 'MDAnalysisTests',
135-
'MDAnalysisTests.plugins': 'MDAnalysisTests/plugins'},
136-
package_data={'MDAnalysisTests':
137-
['data/*.psf', 'data/*.dcd', 'data/*.pdb',
138-
'data/tprs/*.tpr',
139-
'data/tprs/all_bonded/*.gro',
140-
'data/tprs/all_bonded/*.top',
141-
'data/tprs/all_bonded/*.mdp', 'data/*.tpr',
142-
'data/tprs/*/*.tpr',
143-
'data/*.gro', 'data/*.xtc', 'data/*.trr', 'data/*npy',
144-
'data/*.crd', 'data/*.xyz',
145-
'data/Amber/*.bz2',
146-
'data/Amber/*.prmtop', 'data/Amber/*.top',
147-
'data/Amber/*.parm7',
148-
'data/Amber/*.rst7',
149-
'data/Amber/*.trj', 'data/Amber/*.mdcrd',
150-
'data/Amber/*.ncdf', 'data/Amber/*.nc',
151-
'data/Amber/*.inpcrd',
152-
'data/gromos11/*.gz', 'data/gromos11/*.trc',
153-
'data/*.pqr', 'data/*.pdbqt', 'data/*.bz2', 'data/*.gz',
154-
'data/*.ent',
155-
'data/*.fasta',
156-
'data/*.dat',
157-
'data/*.dms',
158-
'data/merge/2zmm/*.pdb',
159-
'data/*.trz',
160-
'data/mol2/*.mol2',
161-
'data/contacts/*.gro.bz2', 'data/contacts/*.dat',
162-
'data/capping/*.gro', 'data/capping/*.pdb',
163-
'data/lammps/*',
164-
'data/gms/*.xyz', 'data/gms/*.gms',
165-
'data/gms/*.gms.gz',
166-
'data/*.inpcrd',
167-
'data/dlpoly/CONFIG*',
168-
'data/dlpoly/HISTORY*',
169-
'data/*.xml',
170-
'data/coordinates/*',
171-
'data/*xvg',
172-
'data/*.mmtf', 'data/*.mmtf.gz',
173-
'data/analysis/*',
174-
'data/*.gsd',
175-
'data/windows/*',
176-
'data/*.itp', "data/gromacs/gromos54a7_edited.ff/*",
177-
'data/*.coor',
178-
'data/*.h5md',
179-
'data/*.in',
180-
'data/*.top',
181-
'data/*.sdf',
182-
'data/*.edr',
183-
'data/*.tng',
184-
'data/*.pdbx',
185-
'data/*.txt',
186-
],
187-
},
188-
python_requires='>=3.9',
189-
install_requires=[
190-
'MDAnalysis=={0!s}'.format(RELEASE), # same as this release!
191-
'pytest>=3.3.0', # Raised to 3.3.0 due to Issue 2329
192-
'hypothesis',
193-
],
194-
# had 'KeyError' as zipped egg (2MB savings are not worth the
195-
# trouble)
196-
zip_safe=False,
197-
cmdclass={'sdist': MDA_SDist},
198-
)
79+
setup(
80+
version=RELEASE,
81+
install_requires=[
82+
'MDAnalysis=={0!s}'.format(RELEASE), # same as this release!
83+
'pytest>=3.3.0', # Raised to 3.3.0 due to Issue 2329
84+
'hypothesis',
85+
],
86+
cmdclass={'sdist': MDA_SDist},
87+
)

0 commit comments

Comments
 (0)