Skip to content

Commit df4067e

Browse files
authored
Have SymPy depend on SymPyCore; breaking change (#534)
* move SymPyPyCall -> SymPy; breaking change * rework to avoid extra allocations * a few more direct Sym calls * formatting; std lib compat * PyCall version bump * add benchmark code
1 parent b336fd7 commit df4067e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+286
-16969
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ assignees: ''
77

88
---
99

10+
**Wait**
11+
12+
Most all issues are actually issues with [SymPyCore](https://github.com/jverzani/SymPyCore.jl/issues). If so please report them there.
13+
14+
`SymPy` contains very little code. Basically only that necessary to support the "glue" package `PyCall` to interop `Julia` with `Python`.
15+
16+
17+
1018
**Describe the bug**
1119
A clear and concise description of what the bug is.
1220

.github/workflows/CompatHelper.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: CompatHelper
22
on:
33
schedule:
4-
- cron: '00 00 * * *'
4+
- cron: 0 0 * * *
55
workflow_dispatch:
66
jobs:
77
CompatHelper:
@@ -12,5 +12,5 @@ jobs:
1212
- name: CompatHelper.main()
1313
env:
1414
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15-
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} # optional
15+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
1616
run: julia -e 'using CompatHelper; CompatHelper.main()'

.github/workflows/TagBot.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ on:
44
types:
55
- created
66
workflow_dispatch:
7+
inputs:
8+
lookback:
9+
default: 3
10+
permissions:
11+
actions: read
12+
checks: read
13+
contents: write
14+
deployments: read
15+
issues: read
16+
discussions: read
17+
packages: read
18+
pages: read
19+
pull-requests: read
20+
repository-projects: read
21+
security-events: read
22+
statuses: read
723
jobs:
824
TagBot:
925
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
@@ -12,4 +28,4 @@ jobs:
1228
- uses: JuliaRegistries/TagBot@v1
1329
with:
1430
token: ${{ secrets.GITHUB_TOKEN }}
15-
ssh: ${{ secrets.DOCUMENTER_KEY }}
31+
ssh: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/benchmark_pr.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Benchmark a pull request
2+
3+
on:
4+
pull_request_target:
5+
branches:
6+
- master
7+
8+
permissions:
9+
pull-requests: write
10+
11+
jobs:
12+
generate_plots:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: julia-actions/setup-julia@v1
18+
with:
19+
version: "1"
20+
- uses: julia-actions/cache@v1
21+
- name: Extract Package Name from Project.toml
22+
id: extract-package-name
23+
run: |
24+
PACKAGE_NAME=$(grep "^name" Project.toml | sed 's/^name = "\(.*\)"$/\1/')
25+
echo "::set-output name=package_name::$PACKAGE_NAME"
26+
- name: Build SymPy
27+
env:
28+
JULIA_NUM_THREADS: 2
29+
run: |
30+
# Lightweight build step, as sometimes the runner runs out of memory:
31+
julia -e 'ENV["JULIA_PKG_PRECOMPILE_AUTO"]=0; import Pkg; Pkg.add(;url="https://github.com/JuliaPy/SymPy.jl.git")'
32+
julia -e 'ENV["JULIA_PKG_PRECOMPILE_AUTO"]=0; import Pkg; Pkg.build("SymPy")'
33+
- name: Add ~/.julia/bin to PATH
34+
run: |
35+
echo "$HOME/.julia/bin" >> $GITHUB_PATH
36+
- name: Run benchmarks
37+
run: |
38+
echo $PATH
39+
ls -l ~/.julia/bin
40+
mkdir results
41+
benchpkg ${{ steps.extract-package-name.outputs.package_name }} --rev="${{github.event.repository.default_branch}},${{github.event.pull_request.head.sha}}" --url=${{ github.event.repository.clone_url }} --bench-on="${{github.event.pull_request.head.sha}}" --output-dir=results/ --exeflags="-O3 --threads=auto"
42+
- name: Create plots from benchmarks
43+
run: |
44+
mkdir -p plots
45+
benchpkgplot ${{ steps.extract-package-name.outputs.package_name }} --rev="${{github.event.repository.default_branch}},${{github.event.pull_request.head.sha}}" --npart=10 --format=png --input-dir=results/ --output-dir=plots/
46+
- name: Upload plot as artifact
47+
uses: actions/upload-artifact@v2
48+
with:
49+
name: plots
50+
path: plots
51+
- name: Create markdown table from benchmarks
52+
run: |
53+
benchpkgtable ${{ steps.extract-package-name.outputs.package_name }} --rev="${{github.event.repository.default_branch}},${{github.event.pull_request.head.sha}}" --input-dir=results/ --ratio > table.md
54+
echo '### Benchmark Results' > body.md
55+
echo '' >> body.md
56+
echo '' >> body.md
57+
cat table.md >> body.md
58+
echo '' >> body.md
59+
echo '' >> body.md
60+
echo '### Benchmark Plots' >> body.md
61+
echo 'A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.' >> body.md
62+
echo 'Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).' >> body.md
63+
64+
- name: Find Comment
65+
uses: peter-evans/find-comment@v2
66+
id: fcbenchmark
67+
with:
68+
issue-number: ${{ github.event.pull_request.number }}
69+
comment-author: 'github-actions[bot]'
70+
body-includes: Benchmark Results
71+
72+
- name: Comment on PR
73+
uses: peter-evans/create-or-update-comment@v3
74+
with:
75+
comment-id: ${{ steps.fcbenchmark.outputs.comment-id }}
76+
issue-number: ${{ github.event.pull_request.number }}
77+
body-path: body.md
78+
edit-mode: replace

.github/workflows/ci.yml

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
name: CI
22
on:
3-
pull_request:
4-
branches:
5-
- master
63
push:
74
branches:
8-
- master
9-
tags: '*'
5+
- main
6+
tags: ['*']
7+
pull_request:
8+
workflow_dispatch:
9+
concurrency:
10+
# Skip intermediate builds: always.
11+
# Cancel intermediate builds: only if it is a pull request build.
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
1014
jobs:
1115
test:
1216
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
@@ -15,33 +19,18 @@ jobs:
1519
fail-fast: false
1620
matrix:
1721
version:
18-
- '1.6' # lowest supported version
19-
- '1' # last released version
22+
- '1.6'
23+
- '1.9'
2024
os:
2125
- ubuntu-latest
22-
- macos-latest
23-
- windows-latest
2426
arch:
2527
- x64
2628
steps:
27-
- uses: actions/checkout@v2
29+
- uses: actions/checkout@v3
2830
- uses: julia-actions/setup-julia@v1
2931
with:
3032
version: ${{ matrix.version }}
3133
arch: ${{ matrix.arch }}
32-
- uses: actions/cache@v1
33-
env:
34-
cache-name: cache-artifacts
35-
with:
36-
path: ~/.julia/artifacts
37-
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
38-
restore-keys: |
39-
${{ runner.os }}-test-${{ env.cache-name }}-
40-
${{ runner.os }}-test-
41-
${{ runner.os }}-
34+
- uses: julia-actions/cache@v1
4235
- uses: julia-actions/julia-buildpkg@v1
4336
- uses: julia-actions/julia-runtest@v1
44-
- uses: julia-actions/julia-processcoverage@v1
45-
- uses: codecov/codecov-action@v1
46-
with:
47-
file: lcov.info

.github/workflows/documenter.yml

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

Project.toml

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,30 @@
11
name = "SymPy"
22
uuid = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6"
3-
version = "1.2.1"
4-
3+
version = "2.0.0"
54

65
[deps]
76
CommonEq = "3709ef60-1bee-4518-9f2f-acd86f176c50"
87
CommonSolve = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2"
9-
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
108
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
11-
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
129
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
13-
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
1410
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
15-
16-
[weakdeps]
17-
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
18-
19-
[extensions]
20-
SymPySymbolicUtilsExt = "SymbolicUtils"
11+
SymPyCore = "458b697b-88f0-4a86-b56b-78b75cfb3531"
2112

2213
[compat]
23-
CommonEq = "=0.2.0"
14+
CommonEq = "0.2.1"
2415
CommonSolve = "0.2"
25-
Latexify = "0.15, 0.16"
26-
LinearAlgebra = "<0.0.1, 1"
27-
Markdown = "<0.0.1, 1"
28-
PyCall = "1.91"
29-
RecipesBase = "0.7, 0.8, 1.0, 1.1"
30-
SpecialFunctions = "0.8, 0.9, 0.10, 1.0, 2"
16+
LinearAlgebra = "<0.0.1, 1.6"
17+
PyCall = "1.96.2"
18+
SpecialFunctions = "0.7, 0.8, 0.8, 0.10, 1, 2"
3119
SymbolicUtils = "1"
32-
julia = "1.0"
20+
SymPyCore = "0.1.6, 1"
21+
julia = "1.6"
3322

3423
[extras]
3524
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
25+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
26+
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
3627
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
3728

3829
[targets]
39-
test = ["SymbolicUtils", "Test"]
30+
test = ["Test", "LinearAlgebra", "SpecialFunctions", "SymbolicUtils"]

0 commit comments

Comments
 (0)