Skip to content

Commit

Permalink
migrate from setup.py to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
mueslo committed Apr 27, 2023
1 parent daa12ea commit 0e1ff1c
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 62 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
#- Windows
#- MacOs
py_version:
- "3.11"
- "3.10"
- "3.9"
- "3.8"
Expand Down
64 changes: 64 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[build-system]
requires = [
"setuptools>=61.2",
"cython~=0.29",
"numpy~=1.21",
]
build-backend = "setuptools.build_meta"

[tool.setuptools.dynamic]
version = {attr = "fplore.__version__"}

[project]
name = "fplore"
description = "FPLO run evaluation"
requires-python = ">=3.8, <4"
keywords = ["dft", "fplo", "physics", "chemistry"]
license = {text = "GPLv3"}
urls = {Homepage = "https://github.com/mueslo/fplore"}
classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Chemistry",
]
dependencies = [
"numpy~=1.21",
"scipy~=1.7",
"pymatgen~=2022.5.19",
"orderedattrdict~=1.5",
"logbook~=1.5",
"pyparsing~=2.4",
"progressbar2~=3.38",
"matplotlib~=3.4",
"Pint~=0.17",
]
dynamic = ["version"]

[project.readme]
file = "README.md"
content-type = "text/markdown"

[project.optional-dependencies]
tests = [
"tox",
]
docs = [
"sphinx~=4.5",
"sphinx-gallery~=0.10",
"Pillow",
]

[tool.setuptools]
include-package-data = false

[tool.setuptools.packages.find]
exclude = ["contrib", "docs", "tests"]
namespaces = false
65 changes: 3 additions & 62 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,68 +1,9 @@
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages, Extension
import codecs
import re
from os import path

here = path.abspath(path.dirname(__file__))


def read(*parts):
with codecs.open(path.join(here, *parts), 'r') as fp:
return fp.read()


def find_version(*file_paths):
version_file = read(*file_paths)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
from setuptools import setup, Extension


setup(
name='fplore',
version=find_version("fplore", "__init__.py"),
description="FPLO run evaluation",
long_description=open('README.md', 'r').read(),
long_description_content_type='text/markdown',
license='GPLv3',
url='https://github.com/mueslo/fplore',
ext_modules=[Extension('fplore.fast_util', sources=['fplore/fast_util.pyx']),],
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
install_requires=[
"numpy~=1.21",
"scipy~=1.7",
"pymatgen~=2022.5.19",
"orderedattrdict~=1.5",
"logbook~=1.5",
"pyparsing~=2.4",
"progressbar2~=3.38",
"matplotlib~=3.4",
"Pint~=0.17",
],
python_requires=">=3.8, <4", # see also docs, test, ci config
extras_require={
'tests': ['tox'],
'docs': [
'sphinx~=4.5',
'sphinx-gallery~=0.10',
'Pillow',
],
},
setup_requires=['cython'],
classifiers=[
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Chemistry",
ext_modules=[
Extension('fplore.fast_util', sources=['fplore/fast_util.pyx']),
],
)

0 comments on commit 0e1ff1c

Please sign in to comment.