Skip to content

Commit

Permalink
Merge pull request #422 from WilhelmusLab/bump-scikit-image-ver
Browse files Browse the repository at this point in the history
Update Py deps management
  • Loading branch information
cpaniaguam authored Jul 24, 2024
2 parents cec2670 + 2d67c8f commit f3e5388
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
- name: update pip
run: python -m pip install -U pip
- name: install python deps
run: python -m pip install -U numpy==1.23 scikit-image==0.20.0 pyproj==3.6.0 rasterio==1.3.7 requests==2.31.0 skyfield==1.45.0 pandas==2 jinja2==3.1
run: python -m pip install -U -r requirements.txt
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
Expand Down
8 changes: 8 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
jinja2==3.1
numpy==1.23.2
pandas==2.1
pyproj==3.6.0
rasterio==1.3.7
scikit-image==0.20.0
requests==2.31.0
skyfield==1.45.0
29 changes: 23 additions & 6 deletions src/IceFloeTracker.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,31 @@ end

const IFTVERSION = get_version_from_toml()

function parse_requirements(file_path)
requirements = Dict{String, String}()
open(file_path, "r") do f
for line in eachline(f)
pkg, version = split(line, "==")
requirements[pkg] = version
end
end
return requirements
end

function __init__()
pyimport_conda("numpy", "numpy=1.23")
pyimport_conda("pyproj", "pyproj=3.6.0")
pyimport_conda("rasterio", "rasterio=1.3.7")
pyimport_conda("jinja2", "jinja2=3.1.2")
pyimport_conda("pandas", "pandas=2")

deps = parse_requirements(joinpath(dirname(@__DIR__), "requirements.txt"))

for (pkg, version) in deps
if pkg == "scikit-image"
sk_measure_module = pyimport_conda("skimage.measure", "$(pkg)=$(version)")
copy!(sk_measure, sk_measure_module)
else
pyimport_conda(pkg, "$(pkg)=$(version)")
end
end

@pyinclude(joinpath(@__DIR__, "latlon.py"))
copy!(sk_measure, pyimport_conda("skimage.measure", "scikit-image=0.20.0"))
copy!(getlatlon, py"getlatlon")
return nothing
end
Expand Down

0 comments on commit f3e5388

Please sign in to comment.