Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PySR integration test #461

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
pip install flake8 pytest pytest-cov virtualenv
cp pysrc/juliacall/juliapkg-dev.json pysrc/juliacall/juliapkg.json
pip install -e .
- name: Lint with flake8
Expand Down
49 changes: 49 additions & 0 deletions pytest/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,52 @@ def test_issue_394():
assert jl.f is f
assert jl.y is y
assert jl.seval("f(x)") == 4


def test_integration_pysr():
"Integration tests for PySR"
import os
import platform
import subprocess
import sys
import tempfile

with tempfile.TemporaryDirectory() as tempdir:
subprocess.run([sys.executable, "-m", "virtualenv", tempdir], check=True)

virtualenv_path = os.path.join(
tempdir, "Scripts" if platform.system() == "Windows" else "bin"
)
virtualenv_executable = os.path.join(virtualenv_path, "python")

assert os.path.exists(virtualenv_executable)

# Install this package
subprocess.run([virtualenv_executable, "-m", "pip", "install", "."], check=True)
# Install PySR with no requirement on JuliaCall
subprocess.run(
[virtualenv_executable, "-m", "pip", "install", "--no-deps", "pysr"],
check=True,
)
# Install PySR test requirements
subprocess.run(
[
virtualenv_executable,
"-m",
"pip",
"install",
"sympy",
"pandas",
"scikit_learn",
"click",
"setuptools",
"typing_extensions",
"pytest",
"nbval",
],
check=True,
)
# Run PySR main test suite
subprocess.run(
[virtualenv_executable, "-m", "pysr", "test", "main"], check=True
)
Loading