Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,23 @@ defaults:

jobs:
cabal:
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
name: ${{ matrix.os }} / GHC ${{ matrix.ghc }} / ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- { cabal: "3.14", os: ubuntu-latest, ghc: "9.2.8" }
- { cabal: "3.14", os: ubuntu-latest, ghc: "9.4.8" }
- { cabal: "3.14", os: ubuntu-latest, ghc: "9.6.6" }
- { cabal: "3.14", os: ubuntu-latest, ghc: "9.8.4" }
- { cabal: "3.14", os: ubuntu-latest, ghc: "9.10.2" }
- { cabal: "3.14", os: ubuntu-latest, ghc: "9.12.2" }
- { cabal: "3.14", os: ubuntu-latest, ghc: "9.2.8", python-version: "3.12" }
- { cabal: "3.14", os: ubuntu-latest, ghc: "9.4.8", python-version: "3.12" }
- { cabal: "3.14", os: ubuntu-latest, ghc: "9.6.6", python-version: "3.12" }
- { cabal: "3.14", os: ubuntu-latest, ghc: "9.8.4", python-version: "3.12" }
- { cabal: "3.14", os: ubuntu-latest, ghc: "9.10.2", python-version: "3.12" }
- { cabal: "3.14", os: ubuntu-latest, ghc: "9.12.2", python-version: "3.12" }
# Scan over supported python versions
- { cabal: "3.14", os: ubuntu-latest, ghc: "9.10.2", python-version: "3.10" }
- { cabal: "3.14", os: ubuntu-latest, ghc: "9.10.2", python-version: "3.11" }
- { cabal: "3.14", os: ubuntu-latest, ghc: "9.10.2", python-version: "3.12" }
- { cabal: "3.14", os: ubuntu-latest, ghc: "9.10.2", python-version: "3.13" }
- { cabal: "3.14", os: ubuntu-latest, ghc: "9.10.2", python-version: "3.14" }
fail-fast: false
steps:
# ----------------
Expand All @@ -35,6 +41,10 @@ jobs:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
# ----------------
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# ----------------
- uses: actions/cache@v3
name: Cache ~/.cabal/store
with:
Expand All @@ -43,8 +53,9 @@ jobs:
# ----------------
- name: Versions
run: |
cabal -V
ghc -V
cabal -V
ghc -V
python -V
pkg-config python3-embed --cflags
pkg-config python3-embed --libs
# ----------------
Expand Down
5 changes: 4 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
0.2.0.1 [XXX]
0.2.1.0 [XXX]
----------------
* Only Python>=3.10 is supported now. Earlier versions are not supported anymore.
Now they're tested on CI.

* Documentation fixes

0.2 [2025.05.04]
Expand Down
2 changes: 1 addition & 1 deletion inline-python.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Library
include-dirs: include
c-sources: cbits/python.c
cc-options: -g -Wall
pkgconfig-depends: python3-embed
pkgconfig-depends: python3-embed >= 3.10
--
Exposed-modules:
Python.Inline
Expand Down
4 changes: 2 additions & 2 deletions src/Python/Inline/Literal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ instance FromPy Char where
| otherwise -> pure $ chr $ fromIntegral r

instance ToPy Bool where
basicToPy True = Py [CU.exp| PyObject* { Py_True } |]
basicToPy False = Py [CU.exp| PyObject* { Py_False } |]
basicToPy True = Py [CU.block| PyObject* { Py_RETURN_TRUE; } |]
basicToPy False = Py [CU.block| PyObject* { Py_RETURN_FALSE; } |]

-- | Uses python's truthiness conventions
instance FromPy Bool where
Expand Down
Loading