Skip to content

Commit 04910ec

Browse files
committed
testing w/o package install check, use dev versions for tests
1 parent bda28e2 commit 04910ec

File tree

3 files changed

+2
-22
lines changed

3 files changed

+2
-22
lines changed

Diff for: .github/workflows/documentation.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Install dependencies
1515
run: |
1616
pip install -r docs/requirements.txt
17-
pip install .
17+
pip install -e ".[dev]"
1818
- name: Sphinx build
1919
run: |
2020
sphinx-build docs/source docs/build

Diff for: .github/workflows/python-app.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
run: |
2929
python -m pip install --upgrade pip
3030
pip install flake8 pytest
31-
if [ -f pyproject.toml ]; then pip install .; fi
31+
if [ -f pyproject.toml ]; then pip install -e ".[dev]"; fi
3232
- name: Lint with flake8
3333
run: |
3434
# stop the build if there are Python syntax errors or undefined names

Diff for: tests/utils.py

-20
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,6 @@
1414

1515
import subprocess
1616

17-
def is_package_installed(package_name):
18-
try:
19-
# Execute 'pip list' command and capture the output
20-
result = subprocess.run(['pip', 'list'], stdout=subprocess.PIPE, text=True)
21-
22-
# Check if package_name is in the result
23-
return package_name in result.stdout
24-
except Exception as e:
25-
print("An error occurred:")
26-
return False
27-
28-
# Replace 'pyvene' with the name of the package you want to check
29-
package_name = 'pyvene'
30-
if is_package_installed(package_name):
31-
raise RuntimeError(
32-
f"Remove your pip installed {package_name} before running tests.")
33-
else:
34-
print(f"'{package_name}' is not installed.")
35-
print("PASS: pyvene is not installed. Testing local dev code.")
36-
3717
from pyvene.models.basic_utils import embed_to_distrib, top_vals, format_token
3818
from pyvene.models.configuration_intervenable_model import (
3919
RepresentationConfig,

0 commit comments

Comments
 (0)