Skip to content

Commit c06e9a0

Browse files
authored
update to support Python 3.10 to 3.14 (#24)
* support python 3.10 - 3.14 - updated tests to work with recent pytest - updated github workflows with modern actions and test 3.10 - 3.14 - increase minimum versions for dependencies * adjust dependency floors * updated codecov action and use CODECOV_TOKEN (added secret token to repo)
1 parent 3fbf9fb commit c06e9a0

10 files changed

Lines changed: 129 additions & 32 deletions

File tree

.github/workflows/tests.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,30 @@ on:
44
push:
55
branches: [ master, develop ]
66
pull_request:
7-
branches: [ master, develop ]
7+
branches: [ master, develop ]
88
schedule:
99
- cron: '0 0 * * *'
1010

1111
jobs:
1212
build:
1313

1414
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
1519

1620
steps:
17-
- uses: actions/checkout@v2
18-
- name: Set up Python 3.10
19-
uses: actions/setup-python@v2
21+
- uses: actions/checkout@v4
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v5
2024
with:
21-
python-version: "3.10"
25+
python-version: ${{ matrix.python-version }}
2226

2327
- name: Install poetry
2428
run: |
2529
python -m pip install --upgrade pip
26-
pip install poetry
30+
pip install "poetry>=2,<3"
2731
2832
- name: Install multibind with poetry
2933
run: |
@@ -35,10 +39,11 @@ jobs:
3539
poetry run pytest -v --cov=multibind --cov-report=xml
3640
3741
- name: Upload coverage to Codecov
38-
uses: codecov/codecov-action@v2
42+
uses: codecov/codecov-action@v5
3943
with:
4044
directory: .
4145
fail_ci_if_error: ${{ github.event_name == 'pull_request' }}
4246
files: coverage.xml
4347
name: codecov-umbrella
48+
token: ${{ secrets.CODECOV_TOKEN }}
4449
verbose: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ coverage.xml
1111
docs/build/
1212
docs/_build/
1313
docs/generated/
14+
.cursor/

.readthedocs.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
1-
# .readthedocs.yml
21
# Read the Docs configuration file
3-
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html
43

5-
# Required
64
version: 2
75

8-
# Build documentation in with Sphinx
96
sphinx:
107
configuration: docs/conf.py
118

12-
# Set the version of Python and other tools you might need
139
build:
14-
os: ubuntu-20.04
10+
os: ubuntu-24.04
1511
tools:
16-
python: "3.9"
12+
python: "3.12"
1713

18-
# Optionally set the version of Python and requirements required to build your docs
1914
python:
2015
install:
2116
- method: pip

CHANGELOG

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2025-04-19 0.2.1
2+
orbeckst
3+
4+
Support Python 3.10 - 3.14.
5+
6+
17
2022-02-22 0.2.0
28
ianmkenney
39

INSTALL.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Installing multibind
2+
3+
## Requirements
4+
5+
- **Python** 3.10, 3.11, 3.12, 3.13, or 3.14 (see `pyproject.toml` for the exact supported range).
6+
- **Dependencies** (installed automatically with the methods below): NumPy, pandas, SciPy, NetworkX, and xarray. NumPy 1.x is allowed on older Pythons; very new interpreters (for example 3.14) typically need a **NumPy 2.x** build that provides wheels for that version.
7+
8+
## Install with Poetry (recommended for development)
9+
10+
[Poetry](https://python-poetry.org/docs/#installation) manages the environment and resolves versions from `pyproject.toml`.
11+
12+
From the root of a clone of this repository:
13+
14+
```bash
15+
poetry install
16+
```
17+
18+
This installs **multibind** in editable mode plus **dev** tools (pytest, Sphinx, IPython, etc.).
19+
20+
To install only runtime dependencies (no dev extras):
21+
22+
```bash
23+
poetry install --without dev
24+
```
25+
26+
Run the test suite (paths in the tests assume the working directory is `tests/`):
27+
28+
```bash
29+
cd tests
30+
poetry run pytest -v
31+
```
32+
33+
## Install with pip
34+
35+
### From a local checkout
36+
37+
Create and activate a virtual environment, then from the repository root:
38+
39+
```bash
40+
python -m pip install --upgrade pip
41+
pip install .
42+
```
43+
44+
Editable install while you change the code:
45+
46+
```bash
47+
pip install -e .
48+
```
49+
50+
### From GitHub
51+
52+
Replace the URL if you use a fork:
53+
54+
```bash
55+
pip install "multibind @ git+https://github.com/BecksteinLab/multibind.git"
56+
```
57+
58+
For a specific branch or tag, use the corresponding revision in the URL (see [pip VCS support](https://pip.pypa.io/en/stable/topics/vcs-support/)).
59+
60+
### From PyPI
61+
62+
If a release is published on PyPI:
63+
64+
```bash
65+
pip install multibind
66+
```
67+
68+
## Conda or Mamba environments
69+
70+
Create an environment with a suitable Python version, activate it, then use **pip** inside that environment as above (from a clone or from Git/PyPI). Avoid mixing Poetry and conda installs of the same package in one environment unless you know how they interact.
71+
72+
## Documentation
73+
74+
To build the HTML docs locally, install dev dependencies (e.g. `poetry install`), then:
75+
76+
```bash
77+
cd docs
78+
sphinx-build -b html . _build/html
79+
```
80+
81+
Online documentation: [multibind.readthedocs.io](https://multibind.readthedocs.io/).

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ This criterion is only satisfied when all the differences in a closed loop vanis
99
Multibind is a Python package that allows for the combination of these differences, along with their variances, into a set of data-informed and thermodynamically consistent state free energies.
1010
Additionally, multibind supports cycles whose free energies are dependent on multiple ligand concentrations.
1111

12+
## Installation
13+
14+
Requires **Python 3.10** through **3.14**. With [Poetry](https://python-poetry.org/):
15+
16+
```bash
17+
poetry install
18+
```
19+
20+
For pip, conda, editable installs, tests, and building docs, see **[INSTALL.md](INSTALL.md)**.
21+
1222
## State definitions
1323

1424
States are minimally defined by a name and should be added to a csv file.

pyproject.toml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,19 @@ authors = ["Ian Kenney <ikenney@asu.edu>"]
66
license = "MIT"
77

88
[tool.poetry.dependencies]
9-
python = "^3.8,<3.11"
10-
numpy = "^1.21.4"
11-
pandas = "^1.3.4"
12-
scipy = "^1.7.2"
13-
networkx = "^2.6.3"
14-
xarray = "^0.20.2"
9+
python = ">=3.10,<3.15"
10+
# Dependency floors: see PyPI requires_python / classifiers for 3.10–3.14 (pandas 2.3.3+ for 3.14; scipy ≥1.11.4 for 3.13+).
11+
numpy = ">=1.22.4,<3"
12+
pandas = ">=2.3.3,<3"
13+
scipy = ">=1.11.4,<2"
14+
networkx = ">=3.2,<4"
15+
xarray = ">=2024.1"
1516

16-
[tool.poetry.dev-dependencies]
17-
pytest = "^6.2.5"
18-
ipython = "^7.30.1"
19-
codecov = "^2.1.12"
20-
pytest-cov = "^3.0.0"
21-
Sphinx = "^4.4.0"
22-
pdbpp = "^0.10.3"
17+
[tool.poetry.group.dev.dependencies]
18+
pytest = "^8.0"
19+
ipython = "^8.18"
20+
pytest-cov = "^5.0"
21+
Sphinx = "^8.0"
2322

2423
[build-system]
2524
requires = ["poetry-core>=1.0.0"]

tests/test_4_state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class TestG(object):
99

10-
def setup(self):
10+
def setup_method(self):
1111
self.c = mb.Multibind()
1212
self.statefile = "../examples/input/4-state-diamond/states.csv"
1313
self.graphfile = "../examples/input/4-state-diamond/graph.csv"

tests/test_4_state_sodium_proton.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class TestG(object):
88

9-
def setup(self):
9+
def setup_method(self):
1010
self.c = mb.Multibind()
1111
self.c.read_graph("../examples/input/4-state-sodium-proton/graph.csv")
1212
self.c.read_states("../examples/input/4-state-sodium-proton/states.csv")

tests/test_scanner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class TestG_missing_coordinate(object):
1010

11-
def setup(self):
11+
def setup_method(self):
1212

1313
self.concentrations = OrderedDict(
1414
[('H+', [1, 2, 3, 4, 5, 6, 7]),
@@ -39,7 +39,7 @@ def test_shape(self):
3939

4040
class TestG(object):
4141

42-
def setup(self):
42+
def setup_method(self):
4343

4444
self.concentrations = OrderedDict()
4545

0 commit comments

Comments
 (0)