Skip to content

Commit

Permalink
Updated instructions to install Julia dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
w2ll2am committed Apr 20, 2023
1 parent 6c1caad commit 9941a00
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements.txt
python setup.py install
python -c 'import pysr; pysr.install()'
python -m pysr install
- name: "Install Coverage tool"
run: pip install coverage coveralls
- name: "Run tests"
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
- name: "Install PySR"
run: |
python3 -m pip install .
python3 -c 'import pysr; pysr.install()'
python3 -m pysr install
- name: "Run tests"
run: cd /tmp && python -m pysr.test main

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI_Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements.txt
python setup.py install
python -c 'import pysr; pysr.install()'
python -m pysr install
- name: "Run tests"
run: python -m pysr.test main
- name: "Install Torch"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI_large_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements.txt
python setup.py install
python -c 'import pysr; pysr.install()'
python -m pysr install
- name: "Run tests"
run: python -m pysr.test main
- name: "Run new env test"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements.txt
python setup.py install
python -c 'import pysr; pysr.install()'
python -m pysr install
- name: "Run tests"
run: python -m pysr.test main
- name: "Install JAX"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ADD ./pysr/ /pysr/pysr/
RUN pip3 install .

# Install Julia pre-requisites:
RUN python3 -c 'import pysr; pysr.install()'
RUN python3 -m pysr install

# metainformation
LABEL org.opencontainers.image.authors = "Miles Cranmer"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pip install -U pysr
```
3. Finally, to install Julia dependencies:
```bash
python3 -c 'import pysr; pysr.install()'
python3 -m pysr install
```

---
Expand Down
3 changes: 2 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ dependencies:
- setuptools
- pyjulia
- openlibm
- openspecfun
- openspecfun
- click
2 changes: 1 addition & 1 deletion pysr/_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def cli(context):
ctx = context


@cli.command("install")
@cli.command("install", help="Install required Julia dependencies")
@click.option("--julia_project", default=None)
@click.option("--quiet", default=False)
@click.option("--precompile", default=None)
Expand Down
10 changes: 4 additions & 6 deletions pysr/julia_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,8 @@ def install(julia_project=None, quiet=False, precompile=None): # pragma: no cov

def _import_error():
return """
Required dependencies are not installed or built. Run the following code in the Python REPL:
>>> import pysr
>>> pysr.install()
Required dependencies are not installed or built. Run the following command:
python -m pysr install
"""


Expand Down Expand Up @@ -286,14 +284,14 @@ def _backend_version_assertion(Main):
f"does not match expected version {expected_backend_version}. "
"Things may break. "
"Please update your PySR installation with "
"`python -c 'import pysr; pysr.install()'`."
"`python -m pysr install`."
)
except JuliaError: # pragma: no cover
warnings.warn(
"You seem to have an outdated version of SymbolicRegression.jl. "
"Things may break. "
"Please update your PySR installation with "
"`python -c 'import pysr; pysr.install()'`."
"`python -m pysr install`."
)


Expand Down

0 comments on commit 9941a00

Please sign in to comment.