Skip to content

Commit eefd92f

Browse files
Restructure package build (#94)
* Test up to Python 3.12 * move packaging content to pyproject.toml * get version with importlib.metadata * add tool configs for black, isotr, mypy * update build command * add build to req-dev * add robotools key to package-dir * run pre-commit --------- Co-authored-by: Michael Osthege <[email protected]>
1 parent 2acc9ce commit eefd92f

File tree

6 files changed

+46
-84
lines changed

6 files changed

+46
-84
lines changed

.github/workflows/pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
python-version: ["3.9", "3.10", "3.11"]
13+
python-version: ["3.10", "3.11", "3.12"]
1414
steps:
1515
- uses: actions/checkout@v4
1616
- name: Set up Python ${{ matrix.python-version }}
@@ -36,7 +36,7 @@ jobs:
3636
file: ./coverage.xml
3737
- name: Test Wheel install and import
3838
run: |
39-
python setup.py bdist_wheel
39+
python -m build
4040
cd dist
4141
pip install robotools*.whl
4242
python -c "import robotools; print(robotools.__version__)"

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
pytest --cov=./robotools --cov-report xml --cov-report term-missing robotools
2727
- name: Build package
2828
run: |
29-
python setup.py sdist bdist_wheel
29+
python -m build
3030
- name: Check version number match
3131
run: |
3232
echo "GITHUB_REF: ${GITHUB_REF}"

pyproject.toml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "robotools"
7+
version = "1.11.3"
8+
description = "Pythonic in-silico liquid handling and creation of Tecan FreedomEVO worklists."
9+
readme = "README.md"
10+
requires-python = ">=3.10"
11+
license = {text = "GNU Affero General Public License v3"}
12+
authors = [
13+
{name = "Michael Osthege", email = "[email protected]"},
14+
]
15+
classifiers = [
16+
"Programming Language :: Python",
17+
"Operating System :: OS Independent",
18+
"Programming Language :: Python :: 3.8",
19+
"Programming Language :: Python :: 3.9",
20+
"Programming Language :: Python :: 3.10",
21+
"Programming Language :: Python :: 3.11",
22+
"Programming Language :: Python :: 3.12",
23+
"License :: OSI Approved :: GNU Affero General Public License v3",
24+
"Intended Audience :: Science/Research",
25+
"Topic :: Scientific/Engineering",
26+
]
27+
dependencies = [
28+
"numpy",
29+
"pandas",
30+
]
31+
32+
[project.urls]
33+
Homepage = "https://github.com/jubiotech/robotools"
34+
Documentation = "https://robotools.readthedocs.io/en/latest/"
35+
Download = "https://pypi.org/project/robotools/"
36+
37+
[tool.setuptools]
38+
package-dir = {"robotools" = "robotools"}
39+
140
[tool.black]
241
line-length = 110
342

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ pytest
44
pytest-cov
55
twine
66
wheel
7+
build

robotools/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import importlib.metadata
2+
13
from . import evotools, liquidhandling
24
from .evotools import EvoWorklist, InvalidOperationError, Labwares, Tip, Worklist
35
from .evotools import commands as evo_cmd
@@ -20,7 +22,7 @@
2022
from .utils import DilutionPlan, get_trough_wells
2123
from .worklists import BaseWorklist, CompatibilityError
2224

23-
__version__ = "1.11.2"
25+
__version__ = importlib.metadata.version(__package__ or __name__)
2426
__all__ = (
2527
"BaseWorklist",
2628
"CompatibilityError",

setup.py

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

0 commit comments

Comments
 (0)