Skip to content

Commit

Permalink
Fix which PySR gets installed in dev test
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Mar 24, 2024
1 parent a3b6f7f commit 7ba43b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 5 additions & 4 deletions pysr/test/generate_dev_juliapkg.py
Expand Up @@ -9,10 +9,11 @@
with open(juliapkg_json, "r") as f:
juliapkg = json.load(f)

del juliapkg["packages"]["SymbolicRegression"]["rev"]
del juliapkg["packages"]["SymbolicRegression"]["url"]
juliapkg["packages"]["SymbolicRegression"]["path"] = path_to_srjl
juliapkg["packages"]["SymbolicRegression"]["dev"] = True
juliapkg["packages"]["SymbolicRegression"] = {
"uuid": juliapkg["packages"]["SymbolicRegression"]["uuid"],
"path": path_to_srjl,
"dev": True,
}

with open(juliapkg_json, "w") as f:
json.dump(juliapkg, f, indent=4)
6 changes: 2 additions & 4 deletions pysr/test/test_dev_pysr.dockerfile
Expand Up @@ -33,8 +33,6 @@ ADD ./pysr/_cli/*.py /pysr/pysr/_cli/

RUN mkdir /pysr/pysr/test

RUN pip3 install --no-cache-dir .

# Now, we create a custom version of SymbolicRegression.jl
# First, we get the version from juliapkg.json:
RUN python3 -c 'import json; print(json.load(open("/pysr/pysr/juliapkg.json", "r"))["packages"]["SymbolicRegression"]["rev"])' > /pysr/sr_version
Expand All @@ -53,5 +51,5 @@ RUN sed -i 's/module SymbolicRegression/module SymbolicRegression\n__test_functi
ADD ./pysr/test/generate_dev_juliapkg.py /generate_dev_juliapkg.py
RUN python3 /generate_dev_juliapkg.py /pysr/pysr/juliapkg.json /srjl

# Precompile
RUN python3 -c 'import pysr'
# Install and pre-compile
RUN pip3 install --no-cache-dir . && python3 -c 'import pysr'

0 comments on commit 7ba43b5

Please sign in to comment.