Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PEP518] Improve testsuite packaging #4463

Merged
merged 8 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Enhancements
`n_initial_contacts` attribute, with documentation. (Issue #2604, PR #4415)

Changes
* Testsuite packaging now uses a pyproject.toml file (PR #4463)
* Improvement of setuptools packaging, including deduplication of
dependency lists (PR #4424)
* As per NEP29, the minimum version of numpy has been raised to 1.23.
Expand Down
1,206 changes: 1,206 additions & 0 deletions testsuite/LICENSE

Large diffs are not rendered by default.

Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
169 changes: 169 additions & 0 deletions testsuite/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
[build-system]
requires = [
"setuptools >= 40.9.0",
IAlibay marked this conversation as resolved.
Show resolved Hide resolved
]
build-backend = "setuptools.build_meta"

[project]
name = "MDAnalysisTests"
description = "MDAnalysis testsuite"
license = {file = "LICENSE" }
authors = [
{name = "MDAnalysis", email = "[email protected]"},
]
maintainers = [
{name = "MDAnalysis", email = "[email protected]"},
]
classifiers = [
"Development Status :: 6 - Mature",
"Environment :: Console",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Operating System :: POSIX",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows ",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: C",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Chemistry",
"Topic :: Software Development :: Libraries :: Python Modules",
]
readme = {file = "README", content-type = "text/x-rst"}
requires-python = ">=3.9"
dynamic = ["version", "dependencies"]

[project.urls]
Homepage = "https://www.mdanalysis.org"
Download = "https://github.com/MDAnalysis/mdanalysis/releases"
Documentation = "https://docs.mdanalysis.org/"
"User Guide" = "https://userguide.mdanalysis.org/"
"Issue Tracker" = "https://github.com/mdanalysis/mdanalysis/issues"
"Github Discussions" = "https://github.com/MDAnalysis/mdanalysis/discussions"
Discord = "https://discord.com/channels/807348386012987462/"
Blog = "https://www.mdanalysis.org/blog/"
Source = "https://github.com/mdanalysis/mdanalysis"

[tool.setuptools]
zip-safe = false
include-package-data = true

[tool.setuptools.packages.find]
namespaces = false
include=[
"MDAnalysisTests",
"MDAnalysisTests.data",
"MDAnalysisTests.data.Amber",
"MDAnalysisTests.data.capping",
"MDAnalysisTests.data.coordinates",
"MDAnalysisTests.data.gms",
"MDAnalysisTests.data.gromos11",
"MDAnalysisTests.data.merge",
"MDAnalysisTests.data.tprs",
"MDAnalysisTests.data.tprs.all_bonded",
"MDAnalysisTests.data.tprs.virtual_sites",
"MDAnalysisTests.data.analysis",
"MDAnalysisTests.data.contacts",
"MDAnalysisTests.data.dlpoly",
"MDAnalysisTests.data.gromacs",
"MDAnalysisTests.data.lammps",
"MDAnalysisTests.data.mol2",
"MDAnalysisTests.data.windows",
]

[tool.setuptools.package-data]
MDAnalysisTests = [
"data/*.psf",
"data/*.dcd",
"data/*.pdb",
"data/tprs/*.tpr",
"data/tprs/all_bonded/*.gro",
"data/tprs/all_bonded/*.top",
"data/tprs/all_bonded/*.mdp",
"data/*.tpr",
"data/tprs/*/*.tpr",
"data/*.gro",
"data/*.xtc",
"data/*.trr",
"data/*npy",
"data/*.crd",
"data/*.xyz",
"data/Amber/*.bz2",
"data/Amber/*.prmtop",
"data/Amber/*.top",
"data/Amber/*.parm7",
"data/Amber/*.rst7",
"data/Amber/*.trj",
"data/Amber/*.mdcrd",
"data/Amber/*.ncdf",
"data/Amber/*.nc",
"data/Amber/*.inpcrd",
"data/gromos11/*.gz",
"data/gromos11/*.trc",
"data/*.pqr",
"data/*.pdbqt",
"data/*.bz2",
"data/*.gz",
"data/*.ent",
"data/*.fasta",
"data/*.dat",
"data/*.dms",
"data/merge/2zmm/*.pdb",
"data/*.trz",
"data/mol2/*.mol2",
"data/contacts/*.gro.bz2",
"data/contacts/*.dat",
"data/capping/*.gro",
"data/capping/*.pdb",
"data/lammps/*",
"data/gms/*.xyz",
"data/gms/*.gms",
"data/gms/*.gms.gz",
"data/*.inpcrd",
"data/dlpoly/CONFIG*",
"data/dlpoly/HISTORY*",
"data/*.xml",
"data/coordinates/*",
"data/*xvg",
"data/*.mmtf",
"data/*.mmtf.gz",
"data/analysis/*",
"data/*.gsd",
"data/windows/*",
"data/*.itp",
"data/gromacs/gromos54a7_edited.ff/*",
"data/*.coor",
"data/*.h5md",
"data/*.in",
"data/*.top",
"data/*.sdf",
"data/*.edr",
"data/*.tng",
"data/*.pdbx",
"data/*.txt",
]

[tool.pytest.ini_options]
filterwarnings = [
"always",
"error:`np.*` is a deprecated alias for the builtin:DeprecationWarning",
# don't enforce for third party packages though:
"ignore:`np.*` is a deprecated alias for the builtin:DeprecationWarning:networkx.*:",
"error:Creating an ndarray from ragged nested sequences",
"error:invalid escape sequence \\\\:DeprecationWarning",
# Ignore frequent errors popping up in our tests
# Elements
"ignore:Element information:UserWarning",
# Mass
"ignore:Failed to guess the mass:UserWarning",
# Coordinates
"ignore:No coordinate reader found:UserWarning",
"ignore:Reader has no dt information, set to 1.0 ps",
# NamedStream warnings
"ignore:Constructed NamedStream:RuntimeWarning",
]
26 changes: 0 additions & 26 deletions testsuite/setup.cfg

This file was deleted.

141 changes: 15 additions & 126 deletions testsuite/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,27 @@
#
"""Setuptools-based setup script for tests of MDAnalysis.

A working installation of NumPy <http://numpy.scipy.org> is required.
A working installation of MDAnalysis of the same version is required.

For a basic installation just type the command::

python setup.py install
pip install .

For more in-depth instructions, see the installation section at the
MDAnalysis Wiki:
For more in-depth instructions, see the installation section in the
MDAnalysis User Guide:

https://github.com/MDAnalysis/mdanalysis/wiki/INSTALL
https://userguide.mdanalysis.org/stable/installation.html

Also free to ask on GitHub Discussions for help:

https://github.com/MDAnalysis/mdanalysis/discussions

(Note that the group really is called `mdnalysis-discussion' because
Google groups forbids any name that contains the string `anal'.)
"""
from setuptools import setup, find_packages
from setuptools import setup
from setuptools.command import sdist

import os
import shutil
import codecs
import sys
import warnings


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


# Make sure I have the right Python version.
if sys.version_info[:2] < (3, 9):
print("MDAnalysis requires Python 3.9 or better. "
"Python {0:d}.{1:d} detected".format(*sys.version_info[:2]))
print("Please upgrade your version of Python.")
sys.exit(-1)


if __name__ == '__main__':
# this must be in-sync with MDAnalysis
RELEASE = "2.8.0-dev0"
with open("README") as summary:
LONG_DESCRIPTION = summary.read()

CLASSIFIERS = [
'Development Status :: 6 - Mature',
'Environment :: Console',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Operating System :: POSIX',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows ',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: C',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Scientific/Engineering :: Chemistry',
'Topic :: Software Development :: Libraries :: Python Modules',
]

setup(name='MDAnalysisTests',
version=RELEASE,
description='MDAnalysis testsuite',
long_description=LONG_DESCRIPTION,
long_description_content_type='text/x-rst',
author='MDAnalysis Development Team',
author_email='[email protected]',
maintainer='MDAnalysis Core Developers',
maintainer_email='[email protected]',
url='https://www.mdanalysis.org',
download_url='https://github.com/MDAnalysis/mdanalysis/releases',
project_urls={'Documentation': 'https://userguide.mdanalysis.org/stable/testing.html',
'CI Coverage': 'https://codecov.io/gh/MDAnalysis/mdanalysis',
'Developer Group': 'https://groups.google.com/g/mdnalysis-devel',
'Issue Tracker': 'https://github.com/mdanalysis/mdanalysis/issues',
'Source': 'https://github.com/mdanalysis/mdanalysis',
},
license='GPL-3.0-or-later',
classifiers=CLASSIFIERS,
packages=find_packages(),
package_dir={'MDAnalysisTests': 'MDAnalysisTests',
'MDAnalysisTests.plugins': 'MDAnalysisTests/plugins'},
package_data={'MDAnalysisTests':
['data/*.psf', 'data/*.dcd', 'data/*.pdb',
'data/tprs/*.tpr',
'data/tprs/all_bonded/*.gro',
'data/tprs/all_bonded/*.top',
'data/tprs/all_bonded/*.mdp', 'data/*.tpr',
'data/tprs/*/*.tpr',
'data/*.gro', 'data/*.xtc', 'data/*.trr', 'data/*npy',
'data/*.crd', 'data/*.xyz',
'data/Amber/*.bz2',
'data/Amber/*.prmtop', 'data/Amber/*.top',
'data/Amber/*.parm7',
'data/Amber/*.rst7',
'data/Amber/*.trj', 'data/Amber/*.mdcrd',
'data/Amber/*.ncdf', 'data/Amber/*.nc',
'data/Amber/*.inpcrd',
'data/gromos11/*.gz', 'data/gromos11/*.trc',
'data/*.pqr', 'data/*.pdbqt', 'data/*.bz2', 'data/*.gz',
'data/*.ent',
'data/*.fasta',
'data/*.dat',
'data/*.dms',
'data/merge/2zmm/*.pdb',
'data/*.trz',
'data/mol2/*.mol2',
'data/contacts/*.gro.bz2', 'data/contacts/*.dat',
'data/capping/*.gro', 'data/capping/*.pdb',
'data/lammps/*',
'data/gms/*.xyz', 'data/gms/*.gms',
'data/gms/*.gms.gz',
'data/*.inpcrd',
'data/dlpoly/CONFIG*',
'data/dlpoly/HISTORY*',
'data/*.xml',
'data/coordinates/*',
'data/*xvg',
'data/*.mmtf', 'data/*.mmtf.gz',
'data/analysis/*',
'data/*.gsd',
'data/windows/*',
'data/*.itp', "data/gromacs/gromos54a7_edited.ff/*",
'data/*.coor',
'data/*.h5md',
'data/*.in',
'data/*.top',
'data/*.sdf',
'data/*.edr',
'data/*.tng',
'data/*.pdbx',
'data/*.txt',
],
},
python_requires='>=3.9',
install_requires=[
'MDAnalysis=={0!s}'.format(RELEASE), # same as this release!
'pytest>=3.3.0', # Raised to 3.3.0 due to Issue 2329
'hypothesis',
],
# had 'KeyError' as zipped egg (2MB savings are not worth the
# trouble)
zip_safe=False,
cmdclass={'sdist': MDA_SDist},
)
setup(
version=RELEASE,
install_requires=[
'MDAnalysis=={0!s}'.format(RELEASE), # same as this release!
'pytest>=3.3.0', # Raised to 3.3.0 due to Issue 2329
'hypothesis',
],
IAlibay marked this conversation as resolved.
Show resolved Hide resolved
cmdclass={'sdist': MDA_SDist},
)
Loading