Skip to content

Commit dbfc66b

Browse files
Replace setup.py by pyproject.toml config
1 parent 519b8db commit dbfc66b

File tree

7 files changed

+38
-53
lines changed

7 files changed

+38
-53
lines changed

.github/workflows/pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
python-version: ${{ matrix.python-version }}
2424
- name: Install dependencies
2525
run: |
26-
pip install -r requirements.txt
26+
pip install -e .
2727
pip install -r requirements-dev.txt --pre
2828
- name: Lint with flake8
2929
run: |
@@ -41,7 +41,7 @@ jobs:
4141
fail_ci_if_error: false
4242
- name: Test Wheel install and import
4343
run: |
44-
python setup.py bdist_wheel
44+
python -m build
4545
cd dist
4646
pip install mcbackend*.whl
4747
python -c "import mcbackend; print(mcbackend.__version__)"

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ jobs:
2626
python-version: 3.11
2727
- name: Install dependencies
2828
run: |
29-
pip install -r requirements.txt
29+
pip install -e .
3030
pip install -r requirements-dev.txt
3131
- name: Test with pytest
3232
run: |
3333
pytest --cov=./mcbackend --cov-report term-missing mcbackend/
3434
- name: Build package
3535
run: |
36-
python setup.py sdist bdist_wheel
36+
python -m build
3737
- name: Check version number match
3838
run: |
3939
export GITHUB_REF=refs/tags/${{ github.event.release.tag_name }}

mcbackend/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
A framework agnostic implementation for storage of MCMC draws.
33
"""
4+
import importlib.metadata
45

56
from .backends.null import NullBackend
67
from .backends.numpy import NumPyBackend
@@ -14,7 +15,7 @@
1415
except ModuleNotFoundError:
1516
pass
1617

17-
__version__ = "0.5.4"
18+
__version__ = importlib.metadata.version(__package__ or __name__)
1819
__all__ = [
1920
"NumPyBackend",
2021
"NullBackend",

pyproject.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "mcbackend"
7+
version = "0.5.4"
8+
description = "Framework agnostic backends for MCMC sample storage"
9+
readme = {file = "README.md", content-type = "text/markdown"}
10+
requires-python = ">=3.10"
11+
license = { text = "AGPLv3" }
12+
authors = [ { name = "Michael Osthege", email = "[email protected]" } ]
13+
urls = { "Homepage" = "https://github.com/michaelosthege/mcbackend" }
14+
classifiers = [
15+
"Programming Language :: Python",
16+
"Operating System :: OS Independent",
17+
"License :: OSI Approved :: GNU Affero General Public License v3",
18+
"Intended Audience :: Science/Research",
19+
]
20+
dependencies = [
21+
"betterproto==2.0.0b7",
22+
"hagelkorn",
23+
"numpy",
24+
"pandas",
25+
]
26+
27+
[tool.setuptools.packages.find]
28+
where = ["."]
29+
30+
[tool.setuptools.package-data]
31+
"mcbackend" = ["py.typed"]
132
[tool.pytest.ini_options]
233
xfail_strict=true
334

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ pytest
66
pytest-cov
77
twine
88
wheel
9+
build

requirements.txt

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

setup.py

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

0 commit comments

Comments
 (0)