Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests, Core.TypeofVararg for Julia 1.7 and AOT #877

Merged
merged 2 commits into from
Jan 15, 2021
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
8 changes: 1 addition & 7 deletions .github/workflows/aot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,7 @@ jobs:
arch: ${{ matrix.architecture }}
show-versioninfo: true

# Revert to `@v1` after this PR is merged:
# https://github.com/JuliaLang/PackageCompiler.jl/pull/443
- run: julia -e 'using Pkg; pkg"add PackageCompiler#cb994c72e2087c57ffa4727ef93589e1b98d8a32"'

# Workaround https://github.com/JuliaLang/julia/issues/37441.
# Once it's solved, we can remove the following line:
- run: julia -e 'using Pkg; pkg"dev PyCall"'
- run: julia -e 'using Pkg; pkg"add PackageCompiler@v1"'

- run: aot/compile.jl
- run: aot/assert_has_pycall.jl
Expand Down
2 changes: 1 addition & 1 deletion aot/runtests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
thisdir="$(dirname "${BASH_SOURCE[0]}")"
exec "$thisdir/julia.sh" --startup-file=no --color=yes -e '
exec "$thisdir/julia.sh" --startup-file=no --color=yes --project=$thisdir -e '
using Pkg
Pkg.test("PyCall")
'
5 changes: 4 additions & 1 deletion src/conversions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ function pyany_toany(T::Type)
end
pyany_toany(::Type{PyAny}) = Any
pyany_toany(t::Type{T}) where {T<:Tuple} = Tuple{map(pyany_toany, t.types)...}

@static if isdefined(Core, :TypeofVararg) # VERSION >= v"1.7.0-DEV.77"
# Core.TypeofVararg introduced in https://github.com/JuliaLang/julia/pull/38136
pyany_toany(T::typeof(Vararg)) = T === Vararg{PyAny} ? Vararg{Any} : T
end
# PyAny acts like Any for conversions, except for converting PyObject (below)
convert(::Type{PyAny}, x) = x

Expand Down