From 2589d913d2be510eef1d5bb4dce65176ef667baf Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Mon, 7 Oct 2024 12:48:02 +0800 Subject: [PATCH 01/11] add python 3.12 --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 7cc859eb..34cfd063 100644 --- a/setup.py +++ b/setup.py @@ -69,6 +69,7 @@ def local_version(version): "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "Intended Audience :: System Administrators", From 822a59dbfc9027b963a7d90e326b5269f3ff9a4c Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Mon, 7 Oct 2024 13:04:09 +0800 Subject: [PATCH 02/11] migrate project section and scm plugin --- pyproject.toml | 22 +++++++++++++++++++--- setup.py | 19 ------------------- 2 files changed, 19 insertions(+), 22 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index adbe3e6b..26d87806 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,25 @@ [build-system] -requires = [ - "setuptools>=43.0.0", -] +requires = ["setuptools>=64", "setuptools-scm>=8"] build-backend = "setuptools.build_meta" +[project] +name = "matminer" +description = "matminer is a library that contains tools for data mining in Materials Science" +readme = "README.md" +license = {text = "modified BSD"} +keywords = ["data mining", "materials science", "scientific tools"] +authors = [ + { name = "Anubhav Jain", email = "anubhavster@gmail.com" } +] +requires-python = ">=3.9" +dynamic = ["version"] + +[project.urls] +"Homepage" = "https://github.com/hackingmaterials/matminer" + +[tool.setuptools_scm] +version_scheme = "guess-next-dev" +local_scheme = "no-local-version" [tool.black] line-length = 120 diff --git a/setup.py b/setup.py index 34cfd063..f4059adb 100644 --- a/setup.py +++ b/setup.py @@ -4,12 +4,6 @@ from setuptools import find_packages, setup - -def local_version(version): - # https://github.com/pypa/setuptools_scm/issues/342 - return "" - - module_dir = os.path.dirname(os.path.abspath(__file__)) extras_require = { @@ -36,20 +30,8 @@ def local_version(version): if __name__ == "__main__": setup( - name="matminer", - use_scm_version={ - "root": ".", - "relative_to": __file__, - "local_scheme": local_version, - }, - setup_requires=["setuptools_scm"], - description="matminer is a library that contains tools for data mining in Materials Science", long_description=open(os.path.join(module_dir, "README.md")).read(), - url="https://github.com/hackingmaterials/matminer", long_description_content_type="text/markdown", - author="Anubhav Jain", - author_email="anubhavster@gmail.com", - license="modified BSD", packages=find_packages(), include_package_data=True, zip_safe=False, @@ -78,7 +60,6 @@ def local_version(version): "Topic :: Other/Nonlisted Topic", "Topic :: Scientific/Engineering", ], - python_requires=">=3.9", test_suite="matminer", tests_require=tests_require, scripts=[], From 6f739a136ed00a1ceb09a97c40134b96b389ed98 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Mon, 7 Oct 2024 13:08:15 +0800 Subject: [PATCH 03/11] migrate classifiers --- pyproject.toml | 13 +++++++++++++ setup.py | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 26d87806..f721c228 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,19 @@ authors = [ ] requires-python = ">=3.9" dynamic = ["version"] +classifiers = [ + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Development Status :: 4 - Beta", + "Intended Audience :: Science/Research", + "Intended Audience :: System Administrators", + "Intended Audience :: Information Technology", + "Operating System :: OS Independent", + "Topic :: Other/Nonlisted Topic", + "Topic :: Scientific/Engineering", +] [project.urls] "Homepage" = "https://github.com/hackingmaterials/matminer" diff --git a/setup.py b/setup.py index f4059adb..c30311cb 100644 --- a/setup.py +++ b/setup.py @@ -47,19 +47,6 @@ "pymatgen >= 2023", ], extras_require=extras_require, - classifiers=[ - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Development Status :: 4 - Beta", - "Intended Audience :: Science/Research", - "Intended Audience :: System Administrators", - "Intended Audience :: Information Technology", - "Operating System :: OS Independent", - "Topic :: Other/Nonlisted Topic", - "Topic :: Scientific/Engineering", - ], test_suite="matminer", tests_require=tests_require, scripts=[], From 0c4ab4b035c962543bee20435bf3239965b05743 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Mon, 7 Oct 2024 13:14:01 +0800 Subject: [PATCH 04/11] migrate dependencies --- pyproject.toml | 33 +++++++++++++++++++++++++++++++++ setup.py | 34 ---------------------------------- 2 files changed, 33 insertions(+), 34 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f721c228..7c23d689 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,10 +26,43 @@ classifiers = [ "Topic :: Other/Nonlisted Topic", "Topic :: Scientific/Engineering", ] +dependencies = [ + "numpy>=1.23", + "requests~=2.31", + "pandas>=1.5, <3", + "tqdm~=4.66", + "pymongo~=4.5", + "scikit-learn~=1.3", + "sympy~=1.11", + "monty>=2023", + "pymatgen>=2023", +] [project.urls] "Homepage" = "https://github.com/hackingmaterials/matminer" + +[project.optional-dependencies] +mpds = ["ujson", "jmespath", "httplib2", "ase", "jsonschema"] +dscribe = ["dscribe~=2.1"] +mdfforge = ["mdf-forge"] +aflow = ["aflow"] +citrine = ["citrination-client"] +dev = [ + "pytest", + "pytest-cov", + "pytest-timeout", + "coverage", + "coveralls", + "flake8", + "black", + "pylint", + "sphinx" +] +tests = ["ujson", "jmespath", "httplib2", "ase", "jsonschema", + "dscribe~=2.1", "mdf-forge", "aflow", "citrination-client" +] + [tool.setuptools_scm] version_scheme = "guess-next-dev" local_scheme = "no-local-version" diff --git a/setup.py b/setup.py index c30311cb..c8d8a299 100644 --- a/setup.py +++ b/setup.py @@ -6,27 +6,6 @@ module_dir = os.path.dirname(os.path.abspath(__file__)) -extras_require = { - "mpds": ["ujson", "jmespath", "httplib2", "ase", "jsonschema"], - "dscribe": ["dscribe~=2.1"], - "mdfforge": ["mdf-forge"], - "aflow": ["aflow"], - "citrine": ["citrination-client"], - "dev": [ - "pytest", - "pytest-cov", - "pytest-timeout", - "coverage", - "coveralls", - "flake8", - "black", - "pylint", - "sphinx", - ], -} -tests_require = [r for v in extras_require.values() for r in v] - -extras_require["tests"] = tests_require if __name__ == "__main__": setup( @@ -35,19 +14,6 @@ packages=find_packages(), include_package_data=True, zip_safe=False, - install_requires=[ - "numpy >= 1.23", - "requests ~= 2.31", - "pandas >= 1.5, < 3", - "tqdm ~= 4.66", - "pymongo ~= 4.5", - "scikit_learn ~= 1.3", - "sympy ~= 1.11", - "monty >= 2023", - "pymatgen >= 2023", - ], - extras_require=extras_require, test_suite="matminer", - tests_require=tests_require, scripts=[], ) From 475339e125a8a90ac83000a210408e5a5ca02cb6 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Mon, 7 Oct 2024 13:15:07 +0800 Subject: [PATCH 05/11] test path --- pyproject.toml | 3 +++ setup.py | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7c23d689..8547eeea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,6 +67,9 @@ tests = ["ujson", "jmespath", "httplib2", "ase", "jsonschema", version_scheme = "guess-next-dev" local_scheme = "no-local-version" +[tool.pytest.ini_options] +testpaths = ["matminer"] + [tool.black] line-length = 120 target-version = ['py39'] diff --git a/setup.py b/setup.py index c8d8a299..2b38e5a3 100644 --- a/setup.py +++ b/setup.py @@ -14,6 +14,5 @@ packages=find_packages(), include_package_data=True, zip_safe=False, - test_suite="matminer", scripts=[], ) From 50f55dae1b8adebe53ac4b524f8559f8a5e310f4 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Mon, 7 Oct 2024 13:21:49 +0800 Subject: [PATCH 06/11] migrate package and packaga-data (default True) --- pyproject.toml | 3 +++ setup.py | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8547eeea..d2419705 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -67,6 +67,9 @@ tests = ["ujson", "jmespath", "httplib2", "ase", "jsonschema", version_scheme = "guess-next-dev" local_scheme = "no-local-version" +[tool.setuptools.packages.find] +where = ["matminer"] + [tool.pytest.ini_options] testpaths = ["matminer"] diff --git a/setup.py b/setup.py index 2b38e5a3..b77a3990 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ import os -from setuptools import find_packages, setup +from setuptools import setup module_dir = os.path.dirname(os.path.abspath(__file__)) @@ -11,8 +11,6 @@ setup( long_description=open(os.path.join(module_dir, "README.md")).read(), long_description_content_type="text/markdown", - packages=find_packages(), - include_package_data=True, zip_safe=False, scripts=[], ) From a7a53c7f23f53ba1f5458b6d290c20621ed1f489 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Mon, 7 Oct 2024 13:24:19 +0800 Subject: [PATCH 07/11] clear long description as readme --- setup.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/setup.py b/setup.py index b77a3990..557b4e11 100644 --- a/setup.py +++ b/setup.py @@ -1,16 +1,9 @@ #!/usr/bin/env python -import os from setuptools import setup -module_dir = os.path.dirname(os.path.abspath(__file__)) - - if __name__ == "__main__": setup( - long_description=open(os.path.join(module_dir, "README.md")).read(), - long_description_content_type="text/markdown", zip_safe=False, - scripts=[], ) From 7bf3b74902e6391cf6a658ced1e28a10995b2ebf Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Mon, 7 Oct 2024 13:28:07 +0800 Subject: [PATCH 08/11] remove obsolete zip_safe https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html --- setup.py | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 setup.py diff --git a/setup.py b/setup.py deleted file mode 100644 index 557b4e11..00000000 --- a/setup.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env python - - -from setuptools import setup - -if __name__ == "__main__": - setup( - zip_safe=False, - ) From 89e908930fc60a0c39f91a1e47bc1a10a2190cf5 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Mon, 7 Oct 2024 13:33:29 +0800 Subject: [PATCH 09/11] simplify test workflow as build time dep install is not needed --- .github/workflows/test.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d960bd4b..ac383f12 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,5 @@ -# This workflow runs only on Ubuntu and aims to be more complete than the Mac and Windows workflows. -# In particular, Openbabel and many of the external command line dependencies are included for testing.defaults: +# This workflow runs only on Ubuntu and aims to be more complete than the MacOS and Windows workflows. +# In particular, Open Babel and many of the external command line dependencies are included for testing.defaults: # The ext package is also only tested in this workflow. Coverage is also computed based on this platform. name: Testing @@ -61,14 +61,14 @@ jobs: - name: Install Python dependencies run: | - python${{ matrix.python-version }} -m pip install --upgrade pip pip-tools setuptools setuptools_scm + python${{ matrix.python-version }} -m pip install --upgrade pip pip-tools python${{ matrix.python-version }} -m piptools sync --user requirements/ubuntu-latest_py${{ matrix.python-version }}.txt # Using non-editable install for testing building of MANIFEST files python${{ matrix.python-version }} -m pip install --no-deps . - python${{ matrix.python-version }} -m pip install pre-commit - name: linting run: | + python${{ matrix.python-version }} -m pip install pre-commit pre-commit run --all-files - name: Run tests @@ -78,7 +78,6 @@ jobs: - name: Build package if: matrix.python-version == 3.9 run: | - python${{ matrix.python-version }} -m pip install --upgrade pip build setuptools setuptools_scm wheel python${{ matrix.python-version }} -m build auto-gen-release: From 4c5a2c5db872ad3b078fde62422af2b1ce6c26be Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel)" Date: Mon, 7 Oct 2024 21:29:32 +0800 Subject: [PATCH 10/11] NEED CONFIRM: remove "Intended Audience :: System Administrators" --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d2419705..ba50e5cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,6 @@ classifiers = [ "Programming Language :: Python :: 3.12", "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", - "Intended Audience :: System Administrators", "Intended Audience :: Information Technology", "Operating System :: OS Independent", "Topic :: Other/Nonlisted Topic", From 508c71e1c708e353d6f30c584bbb7bf059e7f0b9 Mon Sep 17 00:00:00 2001 From: "Haoyu (Daniel) YANG" Date: Wed, 9 Oct 2024 10:29:18 +0800 Subject: [PATCH 11/11] cleaner declare of extra tests Co-authored-by: Matthew Evans <7916000+ml-evs@users.noreply.github.com> --- pyproject.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ba50e5cf..ed30097d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,9 +58,7 @@ dev = [ "pylint", "sphinx" ] -tests = ["ujson", "jmespath", "httplib2", "ase", "jsonschema", - "dscribe~=2.1", "mdf-forge", "aflow", "citrination-client" -] +tests = ["matminer[mpds,describe,mdfforge,aflow,citrine,dev]"] [tool.setuptools_scm] version_scheme = "guess-next-dev"