Skip to content

Commit

Permalink
setup.cfg->pyproject.toml, setuptools_scm (#50)
Browse files Browse the repository at this point in the history
* Move most package configuration to pyproject.toml
* Use setuptools_scm for automated generation of version numbers based on git tags
* replace version.py by dynamic version
* Remove unnecessary setup.py
  • Loading branch information
dweindl authored Oct 15, 2024
1 parent bc6bd24 commit 75f6a44
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 66 deletions.
9 changes: 8 additions & 1 deletion fiddy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# from .gradient_check import gradient_check
from importlib.metadata import PackageNotFoundError, version

from .constants import *
from .derivative import Derivative, get_derivative
from .directional_derivative import methods
Expand All @@ -9,4 +12,8 @@
# from . import quotient
from .step import step

# from .gradient_check import gradient_check
try:
__version__ = version("fiddy")
except PackageNotFoundError:
# package is not installed
pass
1 change: 0 additions & 1 deletion fiddy/version.py

This file was deleted.

42 changes: 38 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,44 @@
[build-system]
requires = [
"setuptools>=42",
"wheel"
]
requires = ["setuptools>=64", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "fiddy"
description = "Finite difference methods"
readme = "README.md"
dynamic = ["version"]
license = { file = "LICENSE" }
authors = [
{ name = "The fiddy developers", email = "[email protected]" }
]
keywords = ["finite difference", "gradient check", "difference quotient"]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.10",
]
dependencies = [
"joblib",
"numpy",
"pandas"
]
requires-python = ">=3.10"

[project.urls]
Homepage = "https://github.com/icb-dcm/fiddy"
Documentation = "https://fiddy.readthedocs.io"
Repository = "https://github.com/icb-dcm/fiddy"
"Bug Tracker" = "https://github.com/icb-dcm/fiddy/issues"

[tool.setuptools.packages.find]
include = ["fiddy*"]

[tool.setuptools_scm]

[tool.ruff]
line-length = 79
target-version = "py310"
Expand Down
55 changes: 0 additions & 55 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,54 +1,3 @@
[metadata]
name = fiddy
version = attr: fiddy.version.__version__
description = Finite difference methods
long_description = file: README.md
long_description_content_type = text/markdown

# URLs
url = https://github.com/icb-dcm/fiddy
download_url = https://github.com/icb-dcm/fiddy/releases
project_urls =
Bug Tracker = https://github.com/icb-dcm/fiddy/issues
Documentation = https://fiddy.readthedocs.io
Changelog = https://fiddy.readthedocs.io/en/latest/changelog.html

# Author information
author = The fiddy developers
author_email = [email protected]

# License information
license = BSD-3-Clause
license_files = LICENSE

# Search tags
classifiers =
Development Status :: 4 - Beta
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.10
keywords =
finite difference
gradient check

[options]
install_requires =
joblib
numpy
pandas

python_requires = >=3.10
include_package_data = True

# Where is my code
packages = find:

[options.packages.find]
include = fiddy*

[options.extras_require]
all =
%(amici)s
Expand All @@ -72,7 +21,3 @@ tests =
scipy
sympy
more-itertools

[bdist_wheel]
# Requires Python 3
universal = False
5 changes: 0 additions & 5 deletions setup.py

This file was deleted.

2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ description =
Check the package friendliness

[testenv:doc]
allowlist_externals =
sphinx-build
extras =
doc
commands =
Expand Down

0 comments on commit 75f6a44

Please sign in to comment.