Skip to content

Commit ee5747d

Browse files
DanielYang59ml-evs
andauthored
Migrate setup.py to pyproject.toml (#950)
* add python 3.12 * migrate project section and scm plugin * migrate classifiers * migrate dependencies * test path * migrate package and packaga-data (default True) * clear long description as readme * remove obsolete zip_safe https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html * simplify test workflow as build time dep install is not needed * NEED CONFIRM: remove "Intended Audience :: System Administrators" * cleaner declare of extra tests Co-authored-by: Matthew Evans <7916000+ml-evs@users.noreply.github.com> --------- Co-authored-by: Matthew Evans <7916000+ml-evs@users.noreply.github.com>
1 parent bec28b6 commit ee5747d

File tree

3 files changed

+72
-92
lines changed

3 files changed

+72
-92
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# This workflow runs only on Ubuntu and aims to be more complete than the Mac and Windows workflows.
2-
# In particular, Openbabel and many of the external command line dependencies are included for testing.defaults:
1+
# This workflow runs only on Ubuntu and aims to be more complete than the MacOS and Windows workflows.
2+
# In particular, Open Babel and many of the external command line dependencies are included for testing.defaults:
33
# The ext package is also only tested in this workflow. Coverage is also computed based on this platform.
44
name: Testing
55

@@ -61,14 +61,14 @@ jobs:
6161

6262
- name: Install Python dependencies
6363
run: |
64-
python${{ matrix.python-version }} -m pip install --upgrade pip pip-tools setuptools setuptools_scm
64+
python${{ matrix.python-version }} -m pip install --upgrade pip pip-tools
6565
python${{ matrix.python-version }} -m piptools sync --user requirements/ubuntu-latest_py${{ matrix.python-version }}.txt
6666
# Using non-editable install for testing building of MANIFEST files
6767
python${{ matrix.python-version }} -m pip install --no-deps .
68-
python${{ matrix.python-version }} -m pip install pre-commit
6968
7069
- name: linting
7170
run: |
71+
python${{ matrix.python-version }} -m pip install pre-commit
7272
pre-commit run --all-files
7373
7474
- name: Run tests
@@ -78,7 +78,6 @@ jobs:
7878
- name: Build package
7979
if: matrix.python-version == 3.9
8080
run: |
81-
python${{ matrix.python-version }} -m pip install --upgrade pip build setuptools setuptools_scm wheel
8281
python${{ matrix.python-version }} -m build
8382
8483
auto-gen-release:

pyproject.toml

Lines changed: 68 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,74 @@
11
[build-system]
2-
requires = [
3-
"setuptools>=43.0.0",
4-
]
2+
requires = ["setuptools>=64", "setuptools-scm>=8"]
53
build-backend = "setuptools.build_meta"
64

5+
[project]
6+
name = "matminer"
7+
description = "matminer is a library that contains tools for data mining in Materials Science"
8+
readme = "README.md"
9+
license = {text = "modified BSD"}
10+
keywords = ["data mining", "materials science", "scientific tools"]
11+
authors = [
12+
{ name = "Anubhav Jain", email = "anubhavster@gmail.com" }
13+
]
14+
requires-python = ">=3.9"
15+
dynamic = ["version"]
16+
classifiers = [
17+
"Programming Language :: Python :: 3.9",
18+
"Programming Language :: Python :: 3.10",
19+
"Programming Language :: Python :: 3.11",
20+
"Programming Language :: Python :: 3.12",
21+
"Development Status :: 4 - Beta",
22+
"Intended Audience :: Science/Research",
23+
"Intended Audience :: Information Technology",
24+
"Operating System :: OS Independent",
25+
"Topic :: Other/Nonlisted Topic",
26+
"Topic :: Scientific/Engineering",
27+
]
28+
dependencies = [
29+
"numpy>=1.23",
30+
"requests~=2.31",
31+
"pandas>=1.5, <3",
32+
"tqdm~=4.66",
33+
"pymongo~=4.5",
34+
"scikit-learn~=1.3",
35+
"sympy~=1.11",
36+
"monty>=2023",
37+
"pymatgen>=2023",
38+
]
39+
40+
[project.urls]
41+
"Homepage" = "https://github.com/hackingmaterials/matminer"
42+
43+
44+
[project.optional-dependencies]
45+
mpds = ["ujson", "jmespath", "httplib2", "ase", "jsonschema"]
46+
dscribe = ["dscribe~=2.1"]
47+
mdfforge = ["mdf-forge"]
48+
aflow = ["aflow"]
49+
citrine = ["citrination-client"]
50+
dev = [
51+
"pytest",
52+
"pytest-cov",
53+
"pytest-timeout",
54+
"coverage",
55+
"coveralls",
56+
"flake8",
57+
"black",
58+
"pylint",
59+
"sphinx"
60+
]
61+
tests = ["matminer[mpds,describe,mdfforge,aflow,citrine,dev]"]
62+
63+
[tool.setuptools_scm]
64+
version_scheme = "guess-next-dev"
65+
local_scheme = "no-local-version"
66+
67+
[tool.setuptools.packages.find]
68+
where = ["matminer"]
69+
70+
[tool.pytest.ini_options]
71+
testpaths = ["matminer"]
772

873
[tool.black]
974
line-length = 120

setup.py

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

0 commit comments

Comments
 (0)