From d350f6fb11f4269666c90d9d7847a7cd97ba3527 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Sun, 14 Jan 2024 23:12:13 +0000 Subject: [PATCH 1/9] WIP cleaning up packaging - how bad can this be? --- package/setup.py | 86 +----------------------------------------------- 1 file changed, 1 insertion(+), 85 deletions(-) diff --git a/package/setup.py b/package/setup.py index 2c9027be443..34a0e11a3ca 100755 --- a/package/setup.py +++ b/package/setup.py @@ -28,7 +28,7 @@ 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: @@ -567,67 +567,14 @@ def long_description(readme): # (LONG_DESCRIPTION is not really needed) LONG_DESCRIPTION = "MDAnalysis -- https://www.mdanalysis.org/" - 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', - ] config = Config() exts, cythonfiles = extensions(config) - install_requires = [ - 'numpy>=1.23.2', - 'GridDataFormats>=0.4.0', - 'mmtf-python>=1.0.0', - 'joblib>=0.12', - 'scipy>=1.5.0', - 'matplotlib>=1.5.1', - 'tqdm>=4.43.0', - 'threadpoolctl', - 'packaging', - 'fasteners', - 'mda-xdrlib', - 'waterdynamics', - 'pathsimanalysis', - ] - setup(name='MDAnalysis', version=RELEASE, - description='An object-oriented toolkit to analyze molecular dynamics trajectories.', long_description=LONG_DESCRIPTION, long_description_content_type='text/x-rst', - author='MDAnalysis Development Team', - author_email='mdanalysis@numfocus.org', - maintainer='MDAnalysis Core Developers', - maintainer_email='mdanalysis@numfocus.org', - url='https://www.mdanalysis.org', - download_url='https://github.com/MDAnalysis/mdanalysis/releases', - project_urls={'Documentation': 'https://docs.mdanalysis.org/', - 'User Guide': 'https://userguide.mdanalysis.org/', - 'Issue Tracker': 'https://github.com/mdanalysis/mdanalysis/issues', - 'User Group': 'https://groups.google.com/g/mdnalysis-discussion/', - 'Discord': 'https://discord.com/channels/807348386012987462/', - 'Blog': 'https://www.mdanalysis.org/blog/', - 'Twitter': 'https://twitter.com/mdanalysis', - 'Source': 'https://github.com/mdanalysis/mdanalysis', - }, license='GPL-3.0-or-later', - classifiers=CLASSIFIERS, provides=['MDAnalysis'], packages=find_packages(), package_data={'MDAnalysis': @@ -636,37 +583,6 @@ def long_description(readme): }, ext_modules=exts, python_requires='>=3.9', - # all standard requirements are available through PyPi and - # typically can be installed without difficulties through setuptools - setup_requires=[ - 'numpy>=1.23.2', - 'packaging', - ], - install_requires=install_requires, - # extras can be difficult to install through setuptools and/or - # you might prefer to use the version available through your - # packaging system - extras_require={ - 'extra_formats': [ # additional file formats - 'netCDF4>=1.0', # for fast AMBER writing, also needs HDF5 - 'h5py>=2.10', # H5MD - 'pytng>=0.2.3', # TNG - 'chemfiles>=0.10', # multiple formats supported by chemfiles - 'pyedr>=0.7.0', # EDR files for the EDR AuxReader - 'gsd>3.0.0', # GSD - 'rdkit>=2020.03.1', # RDKit converter - 'parmed', # ParmEd converter - ], - 'analysis': [ - 'biopython>=1.80', # sequence generation & alignment - 'seaborn', # for annotated heat map and nearest neighbor - # plotting in PSA - 'scikit-learn', # For clustering and dimensionality - # reduction functionality in encore - 'tidynamics>=1.0.0', # For MSD analysis method - 'networkx>=2.0', # For LeafletFinder - ], - }, test_suite="MDAnalysisTests", tests_require=[ 'MDAnalysisTests=={0!s}'.format(RELEASE), # same as this release! From 6fbdaeb3d01d5b7d22a6e3b15d1c9e1c480be8c0 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Thu, 22 Feb 2024 15:58:43 +0000 Subject: [PATCH 2/9] removing redundant python version checks --- package/setup.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/package/setup.py b/package/setup.py index 34a0e11a3ca..25cdad58ff7 100755 --- a/package/setup.py +++ b/package/setup.py @@ -31,9 +31,9 @@ pip install . For more in-depth instructions, see the installation section at the -MDAnalysis Wiki: +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: @@ -54,13 +54,6 @@ import warnings import platform -# Make sure I have the right Python version. -if sys.version_info[:2] < (3, 9): - print('MDAnalysis requires Python 3.9+. Python {0:d}.{1:d} detected'.format(* - sys.version_info[:2])) - print('Please upgrade your version of Python.') - sys.exit(-1) - import configparser from subprocess import getoutput @@ -582,7 +575,6 @@ def long_description(readme): ], }, ext_modules=exts, - python_requires='>=3.9', test_suite="MDAnalysisTests", tests_require=[ 'MDAnalysisTests=={0!s}'.format(RELEASE), # same as this release! From 2581dd5472f431bc69810d250f2d4f3e5cd895dc Mon Sep 17 00:00:00 2001 From: IAlibay Date: Thu, 22 Feb 2024 16:04:51 +0000 Subject: [PATCH 3/9] update links to match PR #4463 --- package/pyproject.toml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/package/pyproject.toml b/package/pyproject.toml index 5b81bc4e007..a9a55be3faa 100644 --- a/package/pyproject.toml +++ b/package/pyproject.toml @@ -97,11 +97,13 @@ doc = [ [project.urls] -Documentation = 'https://docs.mdanalysis.org/' -"User Guide" = 'https://userguide.mdanalysis.org/' -"Issue Tracker" = 'https://github.com/mdanalysis/mdanalysis/issues' -"User Group" = 'https://groups.google.com/g/mdnalysis-discussion/' -Discord = 'https://discord.com/channels/807348386012987462/' -Blog = 'https://www.mdanalysis.org/blog/' +"Project URL" = "https://www.mdanalysis.org" +"Download URL" = "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/" Twitter = 'https://twitter.com/mdanalysis' Source = 'https://github.com/mdanalysis/mdanalysis' From 4b373de6870419f84d8f7f1d0c6247815a89bd5d Mon Sep 17 00:00:00 2001 From: IAlibay Date: Thu, 22 Feb 2024 16:09:34 +0000 Subject: [PATCH 4/9] move zip-safe, albeit obsolete --- package/pyproject.toml | 6 +++++- package/setup.py | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package/pyproject.toml b/package/pyproject.toml index a9a55be3faa..665d1bd9d4a 100644 --- a/package/pyproject.toml +++ b/package/pyproject.toml @@ -95,7 +95,6 @@ doc = [ "pybtex-docutils", ] - [project.urls] "Project URL" = "https://www.mdanalysis.org" "Download URL" = "https://github.com/MDAnalysis/mdanalysis/releases" @@ -107,3 +106,8 @@ Discord = "https://discord.com/channels/807348386012987462/" Blog = "https://www.mdanalysis.org/blog/" Twitter = 'https://twitter.com/mdanalysis' Source = 'https://github.com/mdanalysis/mdanalysis' + +[tool.setuptools] +# as a zipped egg the *.so files are not found (at +# least in Ubuntu/Linux) +zip-safe = false diff --git a/package/setup.py b/package/setup.py index 25cdad58ff7..2aa82b8965d 100755 --- a/package/setup.py +++ b/package/setup.py @@ -579,8 +579,6 @@ def long_description(readme): tests_require=[ 'MDAnalysisTests=={0!s}'.format(RELEASE), # same as this release! ], - zip_safe=False, # as a zipped egg the *.so files are not found (at - # least in Ubuntu/Linux) ) # Releases keep their cythonized stuff for shipping. From d3ece5d1b250b4e2af5b569f19236d3638a95e68 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Thu, 22 Feb 2024 16:19:59 +0000 Subject: [PATCH 5/9] transfer over find and package-data --- package/pyproject.toml | 8 ++++++++ package/setup.py | 5 ----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package/pyproject.toml b/package/pyproject.toml index 665d1bd9d4a..e9370579234 100644 --- a/package/pyproject.toml +++ b/package/pyproject.toml @@ -111,3 +111,11 @@ Source = 'https://github.com/mdanalysis/mdanalysis' # as a zipped egg the *.so files are not found (at # least in Ubuntu/Linux) zip-safe = false + +[tool.setuptools.packages] +find = {} + +[tool.setuptools.package-data] +MDAnalysis = [ + 'analysis/data/*.npy', +] diff --git a/package/setup.py b/package/setup.py index 2aa82b8965d..6fde1d940d1 100755 --- a/package/setup.py +++ b/package/setup.py @@ -569,11 +569,6 @@ def long_description(readme): long_description_content_type='text/x-rst', license='GPL-3.0-or-later', provides=['MDAnalysis'], - packages=find_packages(), - package_data={'MDAnalysis': - ['analysis/data/*.npy', - ], - }, ext_modules=exts, test_suite="MDAnalysisTests", tests_require=[ From 7886933b811e99886585dbd00c3f47645050080d Mon Sep 17 00:00:00 2001 From: IAlibay Date: Thu, 22 Feb 2024 16:31:11 +0000 Subject: [PATCH 6/9] remove duplicate license entry --- package/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/setup.py b/package/setup.py index 6fde1d940d1..bd4aee30cc0 100755 --- a/package/setup.py +++ b/package/setup.py @@ -567,7 +567,7 @@ def long_description(readme): version=RELEASE, long_description=LONG_DESCRIPTION, long_description_content_type='text/x-rst', - license='GPL-3.0-or-later', + # currently unused & may become obsolte see setuptools #1569 provides=['MDAnalysis'], ext_modules=exts, test_suite="MDAnalysisTests", From 38d913b126a08449b48b65d45a7fe246c7bea335 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Thu, 22 Feb 2024 17:07:11 +0000 Subject: [PATCH 7/9] Add missing init files to avoid namespace packages --- package/MDAnalysis/lib/formats/include/__init__.py | 0 package/MDAnalysis/lib/formats/src/__init__.py | 0 package/MDAnalysis/lib/include/__init__.py | 0 package/MDAnalysis/lib/libmdanalysis/__init__.py | 0 package/MDAnalysis/lib/src/transformations/__init__.py | 0 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 package/MDAnalysis/lib/formats/include/__init__.py create mode 100644 package/MDAnalysis/lib/formats/src/__init__.py create mode 100644 package/MDAnalysis/lib/include/__init__.py create mode 100644 package/MDAnalysis/lib/libmdanalysis/__init__.py create mode 100644 package/MDAnalysis/lib/src/transformations/__init__.py diff --git a/package/MDAnalysis/lib/formats/include/__init__.py b/package/MDAnalysis/lib/formats/include/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/package/MDAnalysis/lib/formats/src/__init__.py b/package/MDAnalysis/lib/formats/src/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/package/MDAnalysis/lib/include/__init__.py b/package/MDAnalysis/lib/include/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/package/MDAnalysis/lib/libmdanalysis/__init__.py b/package/MDAnalysis/lib/libmdanalysis/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/package/MDAnalysis/lib/src/transformations/__init__.py b/package/MDAnalysis/lib/src/transformations/__init__.py new file mode 100644 index 00000000000..e69de29bb2d From 8c015fc8e02e5c0c957259ddd18c3c1f4279a91f Mon Sep 17 00:00:00 2001 From: IAlibay Date: Thu, 22 Feb 2024 17:09:53 +0000 Subject: [PATCH 8/9] update changelog --- package/CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/CHANGELOG b/package/CHANGELOG index c825d7094df..ca3df78f13c 100644 --- a/package/CHANGELOG +++ b/package/CHANGELOG @@ -34,6 +34,8 @@ Enhancements `n_initial_contacts` attribute, with documentation. (Issue #2604, PR #4415) Changes + * 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. We have opted to pin to 1.23.2 to ensure the same minimum numpy version is used from python 3.9 to 3.11 (Issue #4401, PR #4402) From 74a870aa2779cae52c3e7fea695993d479da2010 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Fri, 23 Feb 2024 01:58:11 +0000 Subject: [PATCH 9/9] update setuptools pin & links --- package/pyproject.toml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/package/pyproject.toml b/package/pyproject.toml index e9370579234..0a3c22ad87e 100644 --- a/package/pyproject.toml +++ b/package/pyproject.toml @@ -12,9 +12,11 @@ requires = [ # For unreleased versions of Python there is currently no known supported # NumPy version. In that case we just let it be a bare NumPy install "numpy<2.0; python_version>='3.13'", - "setuptools", + # Set to minimum version of setuptools that allows pyproject.toml + "setuptools >= 40.9.0", "wheel", ] +build-backend = "setuptools.build_meta" [project] name = "MDAnalysis" @@ -96,15 +98,14 @@ doc = [ ] [project.urls] -"Project URL" = "https://www.mdanalysis.org" -"Download URL" = "https://github.com/MDAnalysis/mdanalysis/releases" +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/" -Twitter = 'https://twitter.com/mdanalysis' Source = 'https://github.com/mdanalysis/mdanalysis' [tool.setuptools]