Skip to content
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
16 changes: 4 additions & 12 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,12 @@ jobs:
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
- run: |
julia --project=test -e '
using Pkg
Pkg.instantiate()
ENV["PYTHON"]=""
Pkg.build("PyCall")
'
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v2
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
files: lcov.info
docs:
name: Documentation
Expand All @@ -58,10 +53,7 @@ jobs:
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
ENV["PYTHON"]=""
Pkg.build("PyCall")
'
Pkg.instantiate()'
- run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
16 changes: 9 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Dataverse"
uuid = "9c0b9be8-e31e-490f-90fe-77697562404d"
authors = ["gaelforget <gforget@mit.edu> and contributors"]
version = "0.2.6"
version = "0.2.7"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand All @@ -10,26 +10,28 @@ DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
NetworkOptions = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
Tar = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"

[weakdeps]
Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"

[extensions]
DataverseCondaExt = ["Conda"]
DataversePyCallExt = ["PyCall"]
DataverseCondaPkgExt = ["CondaPkg"]
DataversePythonCallExt = ["PythonCall"]

[compat]
CSV = "0.10"
CodecZlib = "0.7"
Conda = "1"
CondaPkg = "0.2"
DataFrames = "1"
Downloads = "1"
HTTP = "1"
JSON = "0.21"
PyCall = "1"
NetworkOptions = "1.2.0"
PythonCall = "0.9"
Tar = "1"
ZipFile = "0.10"
julia = "1.9"
3 changes: 1 addition & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[deps]
Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
PlutoSliderServer = "2fc8631c-6f24-4c5b-bca7-cbb509c42db4"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Dataverse, Conda, PyCall, Documenter, PlutoSliderServer
using Dataverse, PythonCall, Documenter, PlutoSliderServer

DocMeta.setdocmeta!(Dataverse, :DocTestSetup, :(using Dataverse); recursive=true)

Expand Down
10 changes: 0 additions & 10 deletions ext/DataverseCondaExt.jl

This file was deleted.

19 changes: 19 additions & 0 deletions ext/DataverseCondaPkgExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module DataverseCondaPkgExt

using CondaPkg, Dataverse

function Dataverse.pyDataverse_install(flag=true)
CondaPkg.add("pyDataverse")
end

"""
function Dataverse.conda(flag=:pyDataverse)
if flag==:pyDataverse
CondaPkg.add("pyDataverse")
else
error("unknown option")
end
end
"""

end
12 changes: 0 additions & 12 deletions ext/DataversePyCallExt.jl

This file was deleted.

25 changes: 25 additions & 0 deletions ext/DataversePythonCallExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module DataversePythonCallExt

using Dataverse, PythonCall
#import NetworkOptions

"""
Dataverse.pyDataverse_APIs

```
using Dataverse, PythonCall
Dataverse.pyDataverse_install()
(DataAccessApi,NativeApi)=Dataverse.pyDataverse_APIs(true)
dataset = NativeApi.get_dataset("doi:10.7910/DVN/KBHLOD")
```
"""
function Dataverse.pyDataverse_APIs(flag=true; base_url = "https://dataverse.harvard.edu/")
# cafile=NetworkOptions.ca_roots_path()
# ENV["SSL_CERT_FILE"] = cafile
tmp=PythonCall.pyimport("pyDataverse")
api=PythonCall.pyimport("pyDataverse.api")
return api.DataAccessApi(base_url), api.NativeApi(base_url)
end

end

3 changes: 1 addition & 2 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[deps]
Conda = "8f4d0f93-b110-5947-807f-2305c1781a2d"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
12 changes: 8 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
using Dataverse, Conda, PyCall, UUIDs, Test
using Dataverse, PythonCall, UUIDs, Test

do_py_test=false
if do_py_test
do_py_test=1
if do_py_test>0
Dataverse.pyDataverse_install()
Dataverse.pyDataverse_APIs()
(DataAccessApi,NativeApi)=Dataverse.pyDataverse_APIs()
@test typeof(DataAccessApi)==Py
end

if do_py_test>1
tmp=pyDataverse.demo("download")
@test isfile(tmp[1])

Expand Down Expand Up @@ -37,3 +40,4 @@ end
Dataverse.unzip(fil,tempdir())
@test ispath(joinpath(tempdir(),"ne_110m_admin_0_countries.shp"))
end