Skip to content

Commit

Permalink
Merge a5c4c8a into 5df1590
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Mar 26, 2024
2 parents 5df1590 + a5c4c8a commit 6b46791
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update_backend_version.py
Expand Up @@ -20,7 +20,7 @@
major, minor, patch, *dev = pyproject_data["project"]["version"].split(".")
pyproject_data["project"]["version"] = f"{major}.{minor}.{int(patch)+1}"

juliapkg_data["packages"]["SymbolicRegression"]["rev"] = f"v{new_backend_version}"
juliapkg_data["packages"]["SymbolicRegression"]["version"] = f"={new_backend_version}"

with open(pyproject_toml, "w") as toml_file:
toml_file.write(tomlkit.dumps(pyproject_data))
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "pysr"
version = "0.18.0"
version = "0.18.1"
authors = [
{name = "Miles Cranmer", email = "miles.cranmer@gmail.com"},
]
Expand Down
3 changes: 1 addition & 2 deletions pysr/juliapkg.json
Expand Up @@ -3,8 +3,7 @@
"packages": {
"SymbolicRegression": {
"uuid": "8254be44-1295-4e6a-a16d-46603ac705cb",
"url": "https://github.com/MilesCranmer/SymbolicRegression.jl",
"rev": "v0.24.1"
"version": "=0.24.1"
},
"Serialization": {
"uuid": "9e88b42a-f829-5b0c-bbe9-9e923198166b",
Expand Down
8 changes: 3 additions & 5 deletions pysr/test/generate_dev_juliapkg.py
Expand Up @@ -9,11 +9,9 @@
with open(juliapkg_json, "r") as f:
juliapkg = json.load(f)

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

with open(juliapkg_json, "w") as f:
json.dump(juliapkg, f, indent=4)
12 changes: 7 additions & 5 deletions pysr/test/test_dev_pysr.dockerfile
Expand Up @@ -33,12 +33,14 @@ 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
RUN python3 -c 'import json; print(json.load(open("/pysr/pysr/juliapkg.json", "r"))["packages"]["SymbolicRegression"]["version"])' > /pysr/sr_version

# Remove v from the version:
RUN cat /pysr/sr_version | sed 's/^v//g' > /pysr/sr_version_processed
# Remove any = or ^ or ~ from the version:
RUN cat /pysr/sr_version | sed 's/[\^=~]//g' > /pysr/sr_version_processed

# Now, we check out the version of SymbolicRegression.jl that PySR is using:
RUN git clone -b "v$(cat /pysr/sr_version_processed)" --single-branch https://github.com/MilesCranmer/SymbolicRegression.jl /srjl
Expand All @@ -51,5 +53,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

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

0 comments on commit 6b46791

Please sign in to comment.