Skip to content

Commit 5335ac3

Browse files
authored
Merge pull request #42 from alexfikl/update-build-system
Use pyproject.toml and Github Actions
2 parents c3ed89b + 75db6bb commit 5335ac3

4 files changed

Lines changed: 112 additions & 35 deletions

File tree

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ 'master' ]
6+
pull_request:
7+
branches: [ 'master' ]
8+
schedule:
9+
# at 12:00 (UTC) on the first day of the month
10+
- cron: '0 12 1 * *'
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
test:
18+
name: Unittest (${{ matrix.os }}-${{ matrix.compiler }}-py${{ matrix.python-version }})
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
matrix:
22+
os: [ubuntu-latest]
23+
compiler: [gcc, clang]
24+
python-version: ['3.10', '3.x']
25+
include:
26+
- os: ubuntu-20.04
27+
python-version: '3.6'
28+
compiler: gcc
29+
- os: ubuntu-20.04
30+
python-version: '3.6'
31+
compiler: clang
32+
fail-fast: false
33+
34+
steps:
35+
- uses: actions/checkout@v4
36+
- uses: actions/setup-python@v5
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
40+
- name: Install System Dependencies
41+
if: matrix.os == 'ubuntu-latest' && matrix.compiler == 'clang'
42+
run: |
43+
sudo apt-get install libomp5 libomp-dev
44+
45+
- name: Install Python Dependencies
46+
run: |
47+
python -m pip install --upgrade pip setuptools setuptools-scm wheel
48+
python -m pip install --upgrade numpy scipy jitcxde_common sympy
49+
50+
- name: Run Tests
51+
env:
52+
CC: ${{ matrix.compiler }}
53+
run: |
54+
python -m pip install --verbose --no-build-isolation --editable .
55+
python -m unittest discover -b -f -v tests

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ docs/_build/
55
**/*.so
66
**/__pycache__
77
jitcode/version.py
8+
*.egg-info/

pyproject.toml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
[build-system]
2+
build-backend = "setuptools.build_meta"
3+
requires = [
4+
"setuptools>=64",
5+
"setuptools-scm>=7",
6+
]
7+
8+
[project]
9+
name = "jitcode"
10+
dynamic = ["version"]
11+
description = "Just-in-Time Compilation for Ordinary Differential Equations"
12+
readme = "README.rst"
13+
license = { text = "BSD-3-Clause" }
14+
authors = [
15+
{ name = "Gerrit Ansmann", email = "gansmann@uni-bonn.de" },
16+
]
17+
requires-python = ">=3.6"
18+
classifiers = [
19+
"Development Status :: 4 - Beta",
20+
"License :: OSI Approved :: BSD License",
21+
"Operating System :: POSIX",
22+
"Operating System :: MacOS :: MacOS X",
23+
"Operating System :: Microsoft :: Windows",
24+
"Programming Language :: Python",
25+
"Topic :: Scientific/Engineering :: Mathematics",
26+
]
27+
dependencies = [
28+
"jitcxde_common>=1.5.4",
29+
"numpy",
30+
"scipy",
31+
"symengine>=0.3.1.dev0",
32+
]
33+
34+
[project.optional-dependencies]
35+
test = [
36+
# NOTE: required for expr.simplify (symengine calls sympy for that)
37+
# https://github.com/symengine/symengine.py/issues/405
38+
"sympy"
39+
]
40+
41+
[project.urls]
42+
Documentation = "https://jitcode.readthedocs.io"
43+
Homepage = "http://github.com/neurophysik/jitcode"
44+
45+
[tool.setuptools.packages.find]
46+
include = [
47+
"jitcode*",
48+
]
49+
50+
[tool.setuptools.package-data]
51+
jitcode = [
52+
"jitced_template.c",
53+
]
54+
55+
[tool.setuptools_scm]
56+
write_to = "jitcode/version.py"

setup.py

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)