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
73 changes: 73 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: CI

# Trigger the workflow on push or pull request, but only for the master branch
on:
pull_request:
push:
branches: [master]

defaults:
run:
shell: bash

jobs:
cabal:
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- { cabal: "3.12", os: ubuntu-latest, ghc: "9.2.8" }
- { cabal: "3.12", os: ubuntu-latest, ghc: "9.4.8" }
- { cabal: "3.12", os: ubuntu-latest, ghc: "9.6.6" }
- { cabal: "3.12", os: ubuntu-latest, ghc: "9.8.2" }
- { cabal: "3.12", os: ubuntu-latest, ghc: "9.10.1" }
fail-fast: false
steps:
# ----------------
- uses: actions/checkout@v4
# ----------------
- uses: haskell-actions/setup@v2
id: setup-haskell-cabal
name: Setup Haskell
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
# ----------------
- uses: actions/cache@v3
name: Cache ~/.cabal/store
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}--${{ github.Shah }}
# ----------------
- name: Versions
run: |
cabal -V
ghc -V
pkg-config python3-embed --cflags
pkg-config python3-embed --libs
# ----------------
- name: Make sdist
run: |
mkdir sdist
cabal sdist -o sdist
- name: Unpack
run: |
mkdir unpacked
tar -C unpacked -xzf sdist/inline-python*tar.gz
cd unpacked
# ----------------
- name: cabal check
run: |
cabal -vnormal check
# ----------------
- name: Build
run: |
if [ "${{ matrix.skip-test }}" == "" ]; then FLAG_TEST=--enable-test; fi
if [ "${{ matrix.skip-bench }}" == "" ]; then FLAG_BENCH=--enable-benchmarks; fi
cabal configure $FLAG_TEST $FLAG_BENCH
cabal build all --write-ghc-environment-files=always
# ----------------
- name: Test
run: |
if [ "${{ matrix.skip-test }}" == "" ]; then cabal test all; fi
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) Aleksey Khudyakov
Copyright 2024 (c) Alexey Khudyakov

All rights reserved.

Expand Down
38 changes: 0 additions & 38 deletions exe/tst.hs

This file was deleted.

41 changes: 18 additions & 23 deletions inline-python.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ Build-Type: Simple

Name: inline-python
Version: 0.1
Synopsis: Embedding python interpreter into haskell
Synopsis: Python interpreter embedded into haskell.
Description:
Embedding python interpreter
This package embeds python interpreter into haskell program and
allows to write python snippets as quasiquotes. Values could be
easily transferred between python and haskell. It's possible to
call haskell from python as well.

License: BSD-3-Clause
License: BSD-3-Clause
License-File: LICENSE
Author: Aleksey Khudyakov <alexey.skladnoy@gmail.com>
Maintainer: Aleksey Khudyakov <alexey.skladnoy@gmail.com>
Expand All @@ -16,6 +19,8 @@ Bug-reports: https://github.com/Shimuuar/inline-python/issues
Category: FFI
extra-doc-files:
ChangeLog.md
extra-source-files:
include/inline-python.h
data-files:
py/bound-vars.py

Expand All @@ -41,22 +46,19 @@ common language
----------------------------------------------------------------
Library
import: language
Build-Depends: base >=4.14 && <5
, primitive >=0.6.2
, vector >=0.13.2
, containers
Build-Depends: base >=4.14 && <5
, primitive >=0.6.2
, vector >=0.13.2
, containers >=0.5
, process
, transformers
, inline-c >=0.9.1
, template-haskell
, transformers >=0.4
, inline-c >=0.9.1
, template-haskell -any
hs-source-dirs: src
include-dirs: include
c-sources: cbits/python.c
cc-options: -g -Wall
-- FIXME: I think should use python-config instead of pkg-config. For now this
-- will do
pkgconfig-depends: python3
extra-libraries: python3.12
pkgconfig-depends: python3-embed
--
Exposed-modules:
Python.Inline.Literal
Expand All @@ -69,6 +71,8 @@ Library
Python.Internal.Eval
Python.Internal.EvalQQ
Paths_inline_python
Autogen-modules:
Paths_inline_python

----------------------------------------------------------------
library test
Expand Down Expand Up @@ -101,12 +105,3 @@ test-suite inline-python-tests1
, inline-python
, inline-python:test
, tasty


-- Executable pyt
-- import: language
-- ghc-options: -O2 -Wall -threaded
-- Build-Depends: base
-- , inline-python
-- hs-source-dirs: exe
-- Main-is: tst.hs
Loading