Skip to content

Commit d234e39

Browse files
Migrate to setup-python in GitHub Actions (and enable 3.13 tox builds). (#214)
1 parent 5b40a64 commit d234e39

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

.github/workflows/tox.yml

+18-6
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,26 @@ jobs:
2121
PANDAS_PRESENCE: ${{ matrix.pandas-presence }}
2222
steps:
2323
- uses: actions/checkout@v2
24-
- uses: gabrielfalcao/pyenv-action@v17
24+
- name: Set up Python ${{ matrix.python-version }}
25+
id: gha-python
26+
uses: actions/setup-python@v4
2527
with:
26-
default: "${{ matrix.python-version }}"
27-
- name: Install Python ${{ matrix.python-version }}
28+
python-version: ${{ matrix.python-version }}
29+
continue-on-error: true
30+
- name: Install PyEnv
31+
if: ${{ steps.gha-python.outcome == 'failure' }}
2832
run: |
29-
pyenv install "${{ matrix.python-version }}"
30-
pyenv local "${{ matrix.python-version }}"
31-
pyenv versions
33+
curl https://pyenv.run | bash
34+
PYENV_ROOT="$HOME/.pyenv"
35+
echo "$PYENV_ROOT/bin" >> $GITHUB_PATH
36+
echo "$PYENV_ROOT/shims" >> $GITHUB_PATH
37+
echo "PYENV_ROOT=$PYENV_ROOT" >> $GITHUB_ENV
38+
- name: Install Python ${{ matrix.python-version }} using PyEnv
39+
if: ${{ steps.gha-python.outcome == 'failure' }}
40+
run: |
41+
pyenv install "${{ matrix.python-version }}"
42+
pyenv local "${{ matrix.python-version }}"
43+
pyenv versions
3244
- name: Install dependencies
3345
run: |
3446
pip install -U pip

patsy/eval.py

+8
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import tokenize
1919
import ast
2020
import numbers
21+
import pytest
2122
from patsy import PatsyError
2223
from patsy.util import PushbackAdapter, no_pickling, assert_no_pickling
2324
from patsy.tokens import pretty_untokenize, normalize_token_spacing, python_tokenize
@@ -423,6 +424,13 @@ def test_EvalEnvironment_subset():
423424
pytest.raises(NameError, subset_bc.eval, "a")
424425

425426

427+
@pytest.mark.skipif(
428+
sys.version_info >= (3, 13),
429+
reason=(
430+
"`frame.f_locals` may return write-through proxies in Python 3.13+, "
431+
"breaking direct comparison by ids."
432+
),
433+
)
426434
def test_EvalEnvironment_eq():
427435
# Two environments are eq only if they refer to exactly the same
428436
# global/local dicts

tox.ini

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = {py36,py37,py38,py39,py310,py311,py312}-{with_pandas,without_pandas}
2+
envlist = {py36,py37,py38,py39,py310,py311,py312,py313}-{with_pandas,without_pandas}
33

44
[gh-actions]
55
python =
@@ -10,6 +10,7 @@ python =
1010
3.10: py310
1111
3.11: py311
1212
3.12: py312
13+
3.13: py313
1314

1415
[testenv]
1516
deps=

0 commit comments

Comments
 (0)