Skip to content

Commit 2e76d00

Browse files
committed
Fix dialyzer type error and add FreeBSD Python 3.12 CI
- Change num_workers type from pos_integer() to non_neg_integer() to allow 0 when subinterpreters are not supported - Add FreeBSD CI matrix with Python 3.11 (graceful degradation test) and Python 3.12 (subinterpreter support)
1 parent 424e80d commit 2e76d00

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,18 @@ jobs:
8383

8484
# FreeBSD test using cross-platform action
8585
test-freebsd:
86-
name: FreeBSD 14
86+
name: FreeBSD 14 / Python ${{ matrix.python }}
8787
runs-on: ubuntu-24.04
8888

89+
strategy:
90+
fail-fast: false
91+
matrix:
92+
include:
93+
- python: "3.11"
94+
python_pkg: "python311"
95+
- python: "3.12"
96+
python_pkg: "python312"
97+
8998
steps:
9099
- name: Checkout
91100
uses: actions/checkout@v4
@@ -96,17 +105,17 @@ jobs:
96105
release: "14.1"
97106
usesh: true
98107
prepare: |
99-
pkg install -y erlang python311 cmake
108+
pkg install -y erlang ${{ matrix.python_pkg }} cmake
100109
run: |
101110
# Set up environment
102-
export PYTHON_CONFIG=python3.11-config
111+
export PYTHON_CONFIG=python${{ matrix.python }}-config
103112
export PATH="/usr/local/bin:$PATH"
104113
105114
# Verify versions
106115
echo "Erlang version:"
107116
erl -eval 'io:format("~s~n", [erlang:system_info(otp_release)]), halt().' -noshell
108117
echo "Python version:"
109-
python3.11 --version
118+
python${{ matrix.python }} --version
110119
111120
# Build with rebar3
112121
fetch https://github.com/erlang/rebar3/releases/download/3.24.0/rebar3 -o rebar3

src/py_subinterp_pool.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
-record(state, {
4040
workers :: queue:queue(pid()) | undefined,
4141
worker_refs :: [reference()], %% NIF refs for parallel_execute
42-
num_workers :: pos_integer(),
42+
num_workers :: non_neg_integer(),
4343
pending :: non_neg_integer(),
4444
worker_sup :: pid() | undefined,
4545
supported :: boolean() %% whether subinterpreters are supported

0 commit comments

Comments
 (0)