Skip to content

Commit d374186

Browse files
Merge pull request #86 from SciML/actions
attempt to move to Github Actions
2 parents 29fda0f + ac3d322 commit d374186

File tree

10 files changed

+102
-31
lines changed

10 files changed

+102
-31
lines changed

.github/workflows/CI.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags: '*'
8+
pull_request:
9+
workflow_dispatch:
10+
11+
jobs:
12+
test:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os:
17+
- ubuntu-latest
18+
- macos-latest
19+
# Disabling Windows tests as it's known to not work:
20+
# https://github.com/SciML/diffeqpy/pull/86#issuecomment-1011675735
21+
# - windows-latest
22+
architecture: [x64]
23+
python-version: ['3.10']
24+
fail-fast: false
25+
name: Test ${{ matrix.os }} ${{ matrix.architecture }}
26+
Python ${{ matrix.python-version }}
27+
steps:
28+
- uses: actions/checkout@v1
29+
- name: Setup python
30+
uses: actions/setup-python@v2
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
architecture: ${{ matrix.architecture }}
34+
- name: Install tox
35+
run: |
36+
python -m pip install --upgrade pip
37+
python -m pip install --upgrade tox
38+
- name: Run test
39+
run: python -m tox -- --cov=diffeqpy -s
40+
env:
41+
TOXENV: py
42+
- name: Upload coverage to Codecov
43+
uses: codecov/codecov-action@v1
44+
with:
45+
file: ./coverage.xml
46+
name: codecov-umbrella

.travis.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,6 @@ os:
44
notifications:
55
email: false
66
before_install:
7-
- mkdir -p ~/Downloads
8-
9-
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then curl -L https://julialang-s3.julialang.org/bin/linux/x64/1.0/julia-1.0-latest-linux-x86_64.tar.gz -o "$HOME/Downloads/julia.tar.gz"; fi
10-
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then tar xzf "$HOME/Downloads/julia.tar.gz" -C "$HOME/Downloads"; fi
11-
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then cp -r "$(find "$HOME/Downloads" -maxdepth 2 -name "julia*" -type d | head -n 1)" "$HOME/julia"; fi
12-
13-
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then curl -L https://julialang-s3.julialang.org/bin/mac/x64/1.0/julia-1.0-latest-mac64.dmg -o "$HOME/Downloads/julia.dmg"; fi
14-
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then hdiutil attach ~/Downloads/julia.dmg; fi
15-
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then cp -r /Volumes/Julia*/Julia*/Contents/Resources/julia $HOME/julia; fi
16-
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then hdiutil detach -force /Volumes/Julia*; fi
17-
18-
- rm -rf ~/Downloads/julia*
19-
- export PATH="$HOME/julia/bin:$PATH"
20-
217
- pip install --quiet tox
228
script:
239

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# diffeqpy
22

33
[![Join the chat at https://gitter.im/JuliaDiffEq/Lobby](https://badges.gitter.im/JuliaDiffEq/Lobby.svg)](https://gitter.im/JuliaDiffEq/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4-
[![Build Status](https://travis-ci.org/SciML/diffeqpy.svg?branch=master)](https://travis-ci.org/SciML/diffeqpy)
5-
[![Build status](https://ci.appveyor.com/api/projects/status/4ybwcrgopv6wrno1?svg=true)](https://ci.appveyor.com/project/ChrisRackauckas/diffeqpy)
4+
[![CI](https://github.com/SciML/diffeqpy/workflows/CI/badge.svg)](https://github.com/SciML/diffeqpy/actions)
65

76
diffeqpy is a package for solving differential equations in Python. It utilizes
87
[DifferentialEquations.jl](http://diffeq.sciml.ai/dev/) for its core routines

appveyor.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ environment:
99
# https://www.appveyor.com/docs/windows-images-software/#python
1010

1111
- PYTHONDIR: "C:\\Python27-x64"
12-
JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/1.0/julia-1.0-latest-win64.exe"
1312
TOXENV: py
1413
- PYTHONDIR: "C:\\Python36-x64"
15-
JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/1.0/julia-1.0-latest-win64.exe"
1614
TOXENV: py3-numba
1715

1816
matrix:
@@ -28,14 +26,6 @@ notifications:
2826
install:
2927
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12"
3028

31-
# Download most recent Julia Windows binary
32-
- ps: (new-object net.webclient).DownloadFile(
33-
$env:JULIA_URL,
34-
"C:\projects\julia-binary.exe")
35-
# Run installer silently, output to C:\projects\julia
36-
- C:\projects\julia-binary.exe /S /D=C:\projects\julia
37-
- set PATH=C:\projects\julia\bin;%PATH%
38-
3929
# Install Python packages
4030
- "%PYTHONDIR%\\python.exe -m pip install --quiet tox"
4131

diffeqpy/__init__.py

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,37 @@
11
import os
2+
import shutil
23
import subprocess
4+
import sys
5+
6+
from jill.install import install_julia
37

48
script_dir = os.path.dirname(os.path.realpath(__file__))
59

610

7-
def install():
11+
def _find_julia():
12+
# TODO: this should probably fallback to query jill
13+
return shutil.which("julia")
14+
15+
16+
def install(*, confirm=False):
817
"""
9-
Install Julia packages required for diffeqpy.
18+
Install Julia (if required) and Julia packages required for diffeqpy.
1019
"""
11-
subprocess.check_call(['julia', os.path.join(script_dir, 'install.jl')])
20+
julia = _find_julia()
21+
if not julia:
22+
print("No Julia version found. Installing Julia.")
23+
install_julia(confirm=confirm)
24+
julia = _find_julia()
25+
if not julia:
26+
raise RuntimeError(
27+
"Julia installed with jill but `julia` binary cannot be found in the path"
28+
)
29+
env = os.environ.copy()
30+
env["PYTHON"] = sys.executable
31+
subprocess.check_call([julia, os.path.join(script_dir, "install.jl")], env=env)
32+
33+
34+
def _ensure_installed(*kwargs):
35+
if not _find_julia():
36+
# TODO: this should probably ensure that packages are installed too
37+
install(*kwargs)

diffeqpy/de.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
import os
22
import sys
33

4+
from . import _ensure_installed
5+
6+
# This is terrifying to many people. However, it seems SciML takes pragmatic approach.
7+
_ensure_installed()
8+
9+
# PyJulia have to be loaded after `_ensure_installed()`
410
from julia import Main
511

612
script_dir = os.path.dirname(os.path.realpath(__file__))

diffeqpy/install.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ Pkg.add("DifferentialEquations")
33
Pkg.add("OrdinaryDiffEq")
44
Pkg.add("DiffEqBase")
55
Pkg.add("PyCall")
6+
Pkg.build("PyCall")
67
using DifferentialEquations
78
using PyCall

diffeqpy/setup.jl

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import DiffEqBase
1+
@debug "Importing DiffEqBase.jl...."
2+
try
3+
import DiffEqBase
4+
catch err
5+
@error "Failed to import DiffEqBase.jl" exception = (err, catch_backtrace())
6+
rethrow()
7+
end
8+
29
import PyCall
310

411
PyCall.PyObject(::typeof(DiffEqBase.solve)) =
@@ -17,3 +24,11 @@ function DiffEqBase.numargs(f::PyCall.PyObject)
1724
return nargs
1825
end
1926
end
27+
28+
@debug "Importing DifferentialEquationsjl...."
29+
try
30+
import DifferentialEquations
31+
catch err
32+
@error "Failed to import DifferentialEquations.jl" exception = (err, catch_backtrace())
33+
rethrow()
34+
end

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ def readme():
2424
author_email='contact@juliadiffeq.org',
2525
license='MIT',
2626
packages=['diffeqpy','diffeqpy.tests'],
27-
install_requires=['julia>=0.2'],
27+
install_requires=['julia>=0.2', 'jill'],
2828
include_package_data=True,
2929
zip_safe=False)

tox.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ passenv =
2222
# directly configure PyCall.
2323
PYTHON
2424

25+
JULIA_*
26+
2527
[testenv:py3-numba]
2628
deps =
2729
{[testenv]deps}

0 commit comments

Comments
 (0)