Skip to content

Commit

Permalink
Try using NumPy 2.0 for build and shift over to pyproject.toml instal…
Browse files Browse the repository at this point in the history
…lation with setuptools_sm for versioning
  • Loading branch information
mattpitkin committed May 14, 2024
1 parent efbc34b commit b5ebd71
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 64 deletions.
1 change: 1 addition & 0 deletions lintegrate/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
lintegrate.c
_version.py
5 changes: 4 additions & 1 deletion lintegrate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

from .lintegrate import *

__version__ = "0.1.16"
try:
from ._version import version as __version__
except ModuleNotFoundError:
__version__ = ""


def get_include():
Expand Down
57 changes: 55 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,57 @@
[build-system]
# Minimum requirements for the build system to execute.
requires = ["setuptools >= 40.6.0", "cython", "wheel", "oldest-supported-numpy"]
requires = [
"setuptools>=61",
"setuptools_scm[toml]>=6.2",
"cython>=3",
"wheel",
"numpy>=2.0.0rc1",
]
build-backend = "setuptools.build_meta"

[project]
name = "lintegrate"
authors = [{name = "Matthew Pitkin", email = "m@ttpitk.in"}]
urls = {Homepage = "https://github.com/mattpitkin/lintegrate", Documentation = "https://lintegrate.readthedocs.io/"}
description = "Python functions implementing numerical integration of functions in log-space."
license = {text = "GPLv3"}
readme = "README.md"
classifiers = [
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Programming Language :: C",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]

dynamic = [
"version",
]

requires-python = ">=3.9, <4"
dependencies = [
"numpy",
]

[project.optional-dependencies]
docs = [
"autodoc",
"pydata-sphinx-theme",
"sphinx >= 2.0",
"sphinx-panels",
"sphinxcontrib-napoleon",
"sphinxext-remoteliteralinclude",
]

[tools.setuptools.packages.find]
where = ["."]

[tools.setuptools.package-data]
lintegrate = ["*.pyx"]

[tools.setuptools_scm]
write_to = "lintegrate/_version.py"

46 changes: 0 additions & 46 deletions setup.cfg

This file was deleted.

16 changes: 1 addition & 15 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,6 @@ def gsl_config(*args, **kwargs):
return subprocess.check_output(cmd, **kwargs).decode("utf-8").strip()


def find_version():
"""Get version string for pyx file
see e.g. https://packaging.python.org/single_source_version/
"""
fp = open("lintegrate/__init__.py", "r")
version_file = fp.read()
fp.close()
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.")


# define ext_modules
extra_compile_args = [
"-Wall",
Expand Down Expand Up @@ -106,6 +92,6 @@ def find_version():


setup(
version=find_version(),
ext_modules=ext_modules,
)

0 comments on commit b5ebd71

Please sign in to comment.