Skip to content

Commit d23940d

Browse files
authored
Merge branch 'cjdoris:main' into main
2 parents 7f76195 + df664df commit d23940d

Some content is hidden

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

64 files changed

+1652
-327
lines changed

.github/workflows/CompatHelper.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,35 @@ on:
33
schedule:
44
- cron: 0 0 * * *
55
workflow_dispatch:
6+
permissions:
7+
contents: write
8+
pull-requests: write
69
jobs:
710
CompatHelper:
811
runs-on: ubuntu-latest
912
steps:
13+
- name: Check if Julia is already available in the PATH
14+
id: julia_in_path
15+
run: which julia
16+
continue-on-error: true
17+
- name: Install Julia, but only if it is not already available in the PATH
18+
uses: julia-actions/setup-julia@v1
19+
with:
20+
version: '1'
21+
arch: ${{ runner.arch }}
22+
if: steps.julia_in_path.outcome != 'success'
23+
- name: "Add the General registry via Git"
24+
run: |
25+
import Pkg
26+
ENV["JULIA_PKG_SERVER"] = ""
27+
Pkg.Registry.add("General")
28+
shell: julia --color=yes {0}
1029
- name: "Install CompatHelper"
1130
run: |
1231
import Pkg
1332
name = "CompatHelper"
1433
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
15-
version = "2"
34+
version = "3"
1635
Pkg.add(; name, uuid, version)
1736
shell: julia --color=yes {0}
1837
- name: "Run CompatHelper"
@@ -23,3 +42,4 @@ jobs:
2342
env:
2443
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2544
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
45+
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}

.github/workflows/docs.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ name: Docs
22

33
on:
44
push:
5-
branches: [main]
6-
tags: '*'
5+
branches:
6+
- main
7+
tags:
8+
- '*'
79

810
jobs:
911
docs:

.github/workflows/register-pypi.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Register to PyPI
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
register:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@master
11+
- name: Set up Python
12+
uses: actions/setup-python@v3
13+
with:
14+
python-version: "3.10"
15+
- name: Install build
16+
run: >-
17+
python -m
18+
pip install
19+
build
20+
--user
21+
- name: Build distribution
22+
run: >-
23+
python -m
24+
build
25+
--sdist
26+
--wheel
27+
--outdir dist/
28+
.
29+
- name: Publish to PyPI
30+
uses: pypa/gh-action-pypi-publish@release/v1
31+
with:
32+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/tests-nightly.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ name: Tests (nightly)
22

33
on:
44
pull_request:
5-
branches: [main]
5+
branches:
6+
- main
67
push:
7-
branches: [main]
8-
tags: '*'
8+
branches:
9+
- main
10+
tags:
11+
- '*'
912

1013
jobs:
1114
tests:

.github/workflows/tests.yml

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ name: Tests
22

33
on:
44
pull_request:
5-
branches: [main]
5+
branches:
6+
- main
67
push:
7-
branches: [main]
8-
tags: '*'
8+
branches:
9+
- main
10+
tags:
11+
- '*'
912

1013
jobs:
11-
tests:
12-
name: Test (${{ matrix.os }}-${{ matrix.arch }}, julia ${{ matrix.jlversion }})
14+
julia:
15+
name: Test (${{ matrix.os }}, julia ${{ matrix.jlversion }})
1316
runs-on: ${{ matrix.os }}
1417
strategy:
1518
fail-fast: false
@@ -19,7 +22,8 @@ jobs:
1922
jlversion: ['1','1.6']
2023
steps:
2124
- uses: actions/checkout@v2
22-
- uses: julia-actions/setup-julia@v1
25+
- name: Set up Julia ${{ matrix.jlversion }}
26+
uses: julia-actions/setup-julia@v1
2327
with:
2428
version: ${{ matrix.jlversion }}
2529
arch: ${{ matrix.arch }}
@@ -33,11 +37,43 @@ jobs:
3337
${{ runner.os }}-test-${{ env.cache-name }}-
3438
${{ runner.os }}-test-
3539
${{ runner.os }}-
36-
- uses: julia-actions/julia-buildpkg@v1
37-
- uses: julia-actions/julia-runtest@v1
40+
- name: Build package
41+
uses: julia-actions/julia-buildpkg@v1
42+
- name: Run tests
43+
uses: julia-actions/julia-runtest@v1
3844
env:
3945
JULIA_DEBUG: PythonCall
40-
- uses: julia-actions/julia-processcoverage@v1
41-
- uses: codecov/codecov-action@v1
46+
- name: Process coverage
47+
uses: julia-actions/julia-processcoverage@v1
48+
- name: Upload coverage to Codecov
49+
uses: codecov/codecov-action@v2
50+
python:
51+
name: Test (${{ matrix.os }}, python ${{ matrix.pyversion }})
52+
runs-on: ${{ matrix.os }}
53+
strategy:
54+
matrix:
55+
os: [ubuntu-latest, windows-latest, macos-latest]
56+
pyversion: ["3.7", "3.10"]
57+
steps:
58+
- uses: actions/checkout@v3
59+
- name: Set up Python ${{ matrix.pyversion }}
60+
uses: actions/setup-python@v4
4261
with:
43-
file: lcov.info
62+
python-version: ${{ matrix.pyversion }}
63+
- name: Install dependencies
64+
run: |
65+
python -m pip install --upgrade pip
66+
pip install flake8 pytest pytest-cov
67+
cp pysrc/juliacall/juliapkg-dev.json pysrc/juliacall/juliapkg.json
68+
pip install -e .
69+
- name: Lint with flake8
70+
run: |
71+
# stop the build if there are Python syntax errors or undefined names
72+
flake8 . --count --select=E9,F63,F7,F82 --ignore=F821 --show-source --statistics
73+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
74+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
75+
- name: Run tests
76+
run: |
77+
pytest -s --cov=pysrc
78+
- name: Upload coverage to Codecov
79+
uses: codecov/codecov-action@v2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ __pycache__
55
build/
66
dist/
77
.CondaPkg/
8+
/jltest.*

CondaPkg.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

2+
[deps.libstdcxx-ng]
3+
channel = "conda-forge"
4+
version = "<=julia"
5+
26
[deps.python]
37
channel = "conda-forge"
48
build = "*cpython*"

Project.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "PythonCall"
22
uuid = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
33
authors = ["Christopher Doris <github.com/cjdoris>"]
4-
version = "0.9.3"
4+
version = "0.9.10"
55

66
[deps]
77
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"
@@ -10,13 +10,14 @@ Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
1010
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
1111
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
1212
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
13+
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
1314
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
1415
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
1516
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
1617
UnsafePointers = "e17b2a0c-0bdf-430a-bd0c-3a23cae4ff39"
1718

1819
[compat]
19-
CondaPkg = "0.2.11"
20+
CondaPkg = "0.2.15"
2021
MacroTools = "0.5"
2122
Requires = "1"
2223
Tables = "1"
@@ -26,6 +27,7 @@ julia = "1.6.1"
2627
[extras]
2728
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
2829
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
30+
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
2931

3032
[targets]
31-
test = ["Aqua", "Test"]
33+
test = ["Aqua", "Test", "TestItemRunner"]

bump.jl

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using Dates
2+
3+
oldver = ARGS[1]
4+
newver = ARGS[2]
5+
6+
function bump(file, oldpat, newpat)
7+
println("Bumping $file...")
8+
@assert oldpat != newpat
9+
oldtext = read(file, String)
10+
newtext = replace(oldtext, oldpat => newpat)
11+
@assert newtext != oldtext
12+
write(file, newtext)
13+
end
14+
15+
function bumpver(file, pattern, oldver, newver)
16+
@assert oldver != newver
17+
oldpat = replace(pattern, "{}" => oldver)
18+
@assert oldpat != pattern
19+
newpat = replace(pattern, "{}" => newver)
20+
@assert newpat != pattern
21+
bump(file, oldver, newver)
22+
end
23+
24+
bumpver("Project.toml", "version = \"{}\"\n", oldver, newver)
25+
bumpver("setup.cfg", "version = {}\n", oldver, newver)
26+
bumpver("pysrc/juliacall/__init__.py", "__version__ = '{}'\n", oldver, newver)
27+
bumpver("pysrc/juliacall/juliapkg.json", "\"version\": \"={}\"", oldver, newver)
28+
bumpver("pysrc/juliacall/juliapkg-dev.json", "\"version\": \"={}\"", oldver, newver)
29+
bumpver("src/PythonCall.jl", "VERSION = v\"{}\"", oldver, newver)
30+
bump("docs/src/releasenotes.md", "## Unreleased", "## $newver ($(today()))")

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ makedocs(
4848
"Python to Julia" => "conversion-to-julia.md",
4949
],
5050
"compat.md",
51+
"faq.md",
5152
"pycall.md",
5253
"releasenotes.md",
5354
]

0 commit comments

Comments
 (0)