Skip to content

Commit 8306bbd

Browse files
authored
installer script through CI, Part II (#7)
* fix * tidy up
1 parent a661e6a commit 8306bbd

File tree

2 files changed

+16
-23
lines changed

2 files changed

+16
-23
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ jobs:
4747
# runs-on: macos-latest # fails b/c cbc can't compile on M1 (the GHA runners)
4848
shell: 'bash -e {0}'
4949

50+
# runs the script installing *released* software and a little testing
5051
- conda-env: null
5152
python-version: "3.12"
5253
julia-version: "1.10"
@@ -67,8 +68,7 @@ jobs:
6768
with:
6869
sparse-checkout: |
6970
devtools/linux_conda_install.sh
70-
devtools/conda-envs/unix.yaml
71-
# last can be removed
71+
# devtools/conda-envs/unix.yaml # if need local for changes
7272
sparse-checkout-cone-mode: false
7373

7474
- uses: actions/checkout@v4
@@ -95,8 +95,6 @@ jobs:
9595
echo "::group::View Env Spec File for Conda (Edited)"
9696
cat unix.yaml
9797
echo "::endgroup::"
98-
pwd
99-
ls -l
10098
10199
- name: Install Conda Python ${{ matrix.cfg.python-version }}
102100
if: matrix.cfg.label == 'script'
@@ -130,32 +128,28 @@ jobs:
130128
uname -p
131129
which python pip
132130
python --version
133-
python -m pip install numpy pandas scipy pytest grid2op julia "pandapower==2.14.11"
131+
python -m pip install numpy pandas scipy pytest grid2op julia "pandapower>=2.14,<3.0"
134132
135133
- name: Install Julia ${{ matrix.cfg.julia-version }}
136134
if: matrix.cfg.label == 'installer'
137135
uses: julia-actions/setup-julia@v2
138136
with:
139137
version: ${{ matrix.cfg.julia-version }}
140138

141-
- name: Cache Julia
142-
if: matrix.cfg.label == 'installer'
143-
uses: julia-actions/cache@v2
144-
with:
145-
cache-name: ${{ matrix.cfg-runs-on }}-test-${{ matrix.cfg.julia-version }}-${{ matrix.cfg.python-version }}
146-
cache-packages: false
147-
148139
- name: Install Julia power software
149140
if: matrix.cfg.label != 'script'
150141
run: |
151142
julia -e '
152143
using Pkg
153-
Pkg.add([
154-
Pkg.PackageSpec(;name="Ipopt"),
155-
Pkg.PackageSpec(;name="PowerModels", version="0.21.3"),
156-
Pkg.PackageSpec(;name="PyCall"),
157-
Pkg.PackageSpec(;url="https://github.com/loriab/PandaModels.jl", rev="update_pm")
158-
])'
144+
# PwM alone for latest Ipopt and clean PwM test suite
145+
Pkg.add(["PowerModels", "PyCall"])
146+
# for experimenting with full stack. "update_pm" releases PdM version pins on Iptop, etc.
147+
#Pkg.add([
148+
# Pkg.PackageSpec(;name="Ipopt"),
149+
# Pkg.PackageSpec(;name="PowerModels", version="0.21.3"),
150+
# Pkg.PackageSpec(;name="PyCall"),
151+
# Pkg.PackageSpec(;url="https://github.com/loriab/PandaModels.jl", rev="update_pm")
152+
#])'
159153
160154
- name: Install PandaModelsBackend
161155
if: matrix.cfg.label != 'script'
@@ -184,12 +178,13 @@ jobs:
184178
run: |
185179
julia -e 'using PyCall; math = pyimport("math"); print(math.sin(math.pi/4))'
186180
julia -e 'using Pkg; Pkg.test("PowerModels")'
187-
# PM testing above is clean but takes 6m, so optionally toggle off
181+
# PwM testing above is clean but takes 6m, so optionally toggle off
188182
189183
- name: Test PandaModels in Julia
190184
if: matrix.cfg.label != 'script'
191185
run: |
192-
julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(;name="Ipopt", version="0.9"))'
186+
julia -e 'using Pkg; Pkg.add("PandaModels")'
187+
#julia -e 'using Pkg; Pkg.add(Pkg.PackageSpec(;name="Ipopt", version="0.9"))'
193188
julia -e 'using Pkg; Pkg.status(); Pkg.status(outdated=true)'
194189
julia -e 'using PandaModels'
195190
julia -e 'using Pkg; Pkg.test("PandaModels")'

devtools/linux_conda_install.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ else
1515
fi
1616

1717
# 1. create a new conda env from the spec.
18-
cat unix.yaml # TODO RM
1918
conda env create -f ./unix.yaml && conda activate test
2019

2120
# 2. install editable PandaModelsBackend
@@ -55,8 +54,7 @@ julia -e 'using PyCall; math = pyimport("math"); print(math.sin(math.pi/4))'
5554
pyMm=$(python -c "import sys;print(f'{sys.version_info.major}.{sys.version_info.minor}')")
5655
python-jl $CONDA_PREFIX/lib/python$pyMm/site-packages/pandapower/test/opf/test_pandamodels_runpm.py
5756
#>20 passed, 1 xpassed, 1226 warnings in 267.01s (0:04:27)
58-
ls -l $CONDA_PREFIX/lib/python$pyMm/site-packages/pandamodelsbackend/ # TODO RM
59-
#python-jl pandamodelsbackend/tests/test_backend_api.py # TODO REENABLE
57+
python-jl $CONDA_PREFIX/lib/python$pyMm/site-packages/pandamodelsbackend/tests/test_backend_api.py
6058
#>Ran 31 tests in 58.499s
6159
#>OK
6260

0 commit comments

Comments
 (0)