Skip to content

Commit

Permalink
Adding support for Python 3.10 (#247)
Browse files Browse the repository at this point in the history
* Adding support for Python 3.10

* make batman tests optional

* cleanup
  • Loading branch information
dfm authored Jan 11, 2022
1 parent 55124ff commit 57935f3
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 21 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
pymc-version: ["3.9", "3.10", "3.11", "dev"]
python-version: ["3.9", "3.10"]
pymc-version: ["3.11", "dev"]
include:
- python-version: "3.8"
pymc-version: "3.11"
- python-version: "3.10"
pymc-version: "beta"

steps:
- name: Checkout
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"pytest",
"coverage[toml]",
"pytest-env",
"batman-package",
],
"docs": [
"sphinx-book-theme",
Expand Down
1 change: 1 addition & 0 deletions tests/light_curves_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def test_contact_bug():


def test_small_star():
pytest.importorskip("batman.transitmodel")
from batman.transitmodel import TransitModel, TransitParams

u_star = [0.2, 0.1]
Expand Down
11 changes: 2 additions & 9 deletions tests/orbits/keplerian_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,9 @@
)
from exoplanet.units import with_unit

try:
import batman
except ImportError:
batman = None


@pytest.mark.skipif(batman is None, reason="batman is not installed")
def test_sky_coords():
from batman import _rsky
_rsky = pytest.importorskip("batman._rsky")

t = np.linspace(-100, 100, 1000)

Expand Down Expand Up @@ -319,9 +313,8 @@ def test_in_transit_circ():
assert np.all(inds == inds_circ)


@pytest.mark.skipif(batman is None, reason="batman is not installed")
def test_small_star():
from batman import _rsky
_rsky = pytest.importorskip("batman._rsky")

m_star = 0.151
r_star = 0.189
Expand Down
11 changes: 4 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
[tox]
envlist = py{38,39}-pymc{39,310,311,dev},lint,docs
envlist = py{38,39,310}-pymc{311,dev},lint,docs

[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310

[gh-actions:env]
PYMC_VERSION =
3.9: pymc39
3.10: pymc310
3.11: pymc311
dev: pymcdev

[testenv]
passenv = GITHUB_*
deps =
pymc{39,310}: arviz<0.11
pymc39: pymc3~=3.9.0
pymc310: pymc3~=3.10.0
numpy<1.22
pymc311: pymc3~=3.11.0
pymcdev: https://github.com/pymc-devs/pymc3/archive/v3.zip
pymcdev: https://github.com/pymc-devs/pymc/archive/v3.zip
extras = test
commands =
pip freeze
Expand Down

0 comments on commit 57935f3

Please sign in to comment.