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 16 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use correct python executable for virtualenv
MilesCranmer committed Feb 12, 2024

Verified

This commit was signed with the committer’s verified signature.
MilesCranmer Miles Cranmer
commit 977296df1e7bae6a1fee7447282066c036a8b6aa
21 changes: 17 additions & 4 deletions pytest/test_all.py
Original file line number Diff line number Diff line change
@@ -21,22 +21,33 @@ def test_issue_394():

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([sys.executable, "-m", "pip", "install", "."], check=True)
subprocess.run([virtualenv_executable, "-m", "pip", "install", "."], check=True)
# Install PySR with no requirement on JuliaCall
subprocess.run(
[sys.executable, "-m", "pip", "install", "--no-deps", "pysr"], check=True
[virtualenv_executable, "-m", "pip", "install", "--no-deps", "pysr"],
check=True,
)
# Install PySR test requirements
subprocess.run(
[
sys.executable,
virtualenv_executable,
"-m",
"pip",
"install",
@@ -52,4 +63,6 @@ def test_integration_pysr():
check=True,
)
# Run PySR main test suite
subprocess.run([sys.executable, "-m", "pysr", "test", "main"], check=True)
subprocess.run(
[virtualenv_executable, "-m", "pysr", "test", "main"], check=True
)