Spaces:
Sleeping
Sleeping
MilesCranmer
commited on
Merge pull request #580 from MilesCranmer/fix-extensions
Browse files
.github/workflows/update_backend_version.py
CHANGED
@@ -20,7 +20,7 @@ with open(juliapkg_json) as f:
|
|
20 |
major, minor, patch, *dev = pyproject_data["project"]["version"].split(".")
|
21 |
pyproject_data["project"]["version"] = f"{major}.{minor}.{int(patch)+1}"
|
22 |
|
23 |
-
juliapkg_data["packages"]["SymbolicRegression"]["
|
24 |
|
25 |
with open(pyproject_toml, "w") as toml_file:
|
26 |
toml_file.write(tomlkit.dumps(pyproject_data))
|
|
|
20 |
major, minor, patch, *dev = pyproject_data["project"]["version"].split(".")
|
21 |
pyproject_data["project"]["version"] = f"{major}.{minor}.{int(patch)+1}"
|
22 |
|
23 |
+
juliapkg_data["packages"]["SymbolicRegression"]["rev"] = f"v{new_backend_version}"
|
24 |
|
25 |
with open(pyproject_toml, "w") as toml_file:
|
26 |
toml_file.write(tomlkit.dumps(pyproject_data))
|
pysr/juliapkg.json
CHANGED
@@ -3,7 +3,8 @@
|
|
3 |
"packages": {
|
4 |
"SymbolicRegression": {
|
5 |
"uuid": "8254be44-1295-4e6a-a16d-46603ac705cb",
|
6 |
-
"
|
|
|
7 |
},
|
8 |
"Serialization": {
|
9 |
"uuid": "9e88b42a-f829-5b0c-bbe9-9e923198166b",
|
|
|
3 |
"packages": {
|
4 |
"SymbolicRegression": {
|
5 |
"uuid": "8254be44-1295-4e6a-a16d-46603ac705cb",
|
6 |
+
"url": "https://github.com/MilesCranmer/SymbolicRegression.jl",
|
7 |
+
"rev": "v0.24.1"
|
8 |
},
|
9 |
"Serialization": {
|
10 |
"uuid": "9e88b42a-f829-5b0c-bbe9-9e923198166b",
|
pysr/test/generate_dev_juliapkg.py
CHANGED
@@ -9,9 +9,11 @@ path_to_srjl = sys.argv[2]
|
|
9 |
with open(juliapkg_json, "r") as f:
|
10 |
juliapkg = json.load(f)
|
11 |
|
12 |
-
|
13 |
-
juliapkg["packages"]["SymbolicRegression"]["
|
14 |
-
|
|
|
|
|
15 |
|
16 |
with open(juliapkg_json, "w") as f:
|
17 |
json.dump(juliapkg, f, indent=4)
|
|
|
9 |
with open(juliapkg_json, "r") as f:
|
10 |
juliapkg = json.load(f)
|
11 |
|
12 |
+
juliapkg["packages"]["SymbolicRegression"] = {
|
13 |
+
"uuid": juliapkg["packages"]["SymbolicRegression"]["uuid"],
|
14 |
+
"path": path_to_srjl,
|
15 |
+
"dev": True,
|
16 |
+
}
|
17 |
|
18 |
with open(juliapkg_json, "w") as f:
|
19 |
json.dump(juliapkg, f, indent=4)
|
pysr/test/test_dev_pysr.dockerfile
CHANGED
@@ -33,14 +33,12 @@ ADD ./pysr/_cli/*.py /pysr/pysr/_cli/
|
|
33 |
|
34 |
RUN mkdir /pysr/pysr/test
|
35 |
|
36 |
-
RUN pip3 install --no-cache-dir .
|
37 |
-
|
38 |
# Now, we create a custom version of SymbolicRegression.jl
|
39 |
# First, we get the version from juliapkg.json:
|
40 |
-
RUN python3 -c 'import json; print(json.load(open("/pysr/pysr/juliapkg.json", "r"))["packages"]["SymbolicRegression"]["
|
41 |
|
42 |
-
# Remove
|
43 |
-
RUN cat /pysr/sr_version | sed 's
|
44 |
|
45 |
# Now, we check out the version of SymbolicRegression.jl that PySR is using:
|
46 |
RUN git clone -b "v$(cat /pysr/sr_version_processed)" --single-branch https://github.com/MilesCranmer/SymbolicRegression.jl /srjl
|
@@ -53,5 +51,5 @@ RUN sed -i 's/module SymbolicRegression/module SymbolicRegression\n__test_functi
|
|
53 |
ADD ./pysr/test/generate_dev_juliapkg.py /generate_dev_juliapkg.py
|
54 |
RUN python3 /generate_dev_juliapkg.py /pysr/pysr/juliapkg.json /srjl
|
55 |
|
56 |
-
#
|
57 |
-
RUN python3 -c 'import pysr'
|
|
|
33 |
|
34 |
RUN mkdir /pysr/pysr/test
|
35 |
|
|
|
|
|
36 |
# Now, we create a custom version of SymbolicRegression.jl
|
37 |
# First, we get the version from juliapkg.json:
|
38 |
+
RUN python3 -c 'import json; print(json.load(open("/pysr/pysr/juliapkg.json", "r"))["packages"]["SymbolicRegression"]["rev"])' > /pysr/sr_version
|
39 |
|
40 |
+
# Remove v from the version:
|
41 |
+
RUN cat /pysr/sr_version | sed 's/^v//g' > /pysr/sr_version_processed
|
42 |
|
43 |
# Now, we check out the version of SymbolicRegression.jl that PySR is using:
|
44 |
RUN git clone -b "v$(cat /pysr/sr_version_processed)" --single-branch https://github.com/MilesCranmer/SymbolicRegression.jl /srjl
|
|
|
51 |
ADD ./pysr/test/generate_dev_juliapkg.py /generate_dev_juliapkg.py
|
52 |
RUN python3 /generate_dev_juliapkg.py /pysr/pysr/juliapkg.json /srjl
|
53 |
|
54 |
+
# Install and pre-compile
|
55 |
+
RUN pip3 install --no-cache-dir . && python3 -c 'import pysr'
|