Skip to content

Commit

Permalink
Migrate setup.py to pyproject.toml (#950)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

---------

Co-authored-by: Matthew Evans <[email protected]>
  • Loading branch information
DanielYang59 and ml-evs authored Oct 9, 2024
1 parent bec28b6 commit ee5747d
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 92 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
71 changes: 68 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,74 @@
[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 = "[email protected]" }
]
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 :: Information Technology",
"Operating System :: OS Independent",
"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 = ["matminer[mpds,describe,mdfforge,aflow,citrine,dev]"]

[tool.setuptools_scm]
version_scheme = "guess-next-dev"
local_scheme = "no-local-version"

[tool.setuptools.packages.find]
where = ["matminer"]

[tool.pytest.ini_options]
testpaths = ["matminer"]

[tool.black]
line-length = 120
Expand Down
84 changes: 0 additions & 84 deletions setup.py

This file was deleted.

0 comments on commit ee5747d

Please sign in to comment.