Skip to content

Commit 1cb890f

Browse files
committed
Include *.trc files in site-packages (non-editable) installation (#642)
* Add check to test site-packages (non-editable) installation of IDAES * Fix pytest CLI flag * Remove failing timing-based test * Include *.trc files in site-packages (non-editable) installation * Move site-packages pytest job to integration workflow * Enable color output for pytest * Limit tests to run for debugging * Try to see if failures are due to using more recent version of Ubuntu * Restore normal job conditions * Also install optional dependencies
1 parent 2e3e130 commit 1cb890f

File tree

3 files changed

+34
-16
lines changed

3 files changed

+34
-16
lines changed

.github/workflows/integration.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ on:
2626

2727
env:
2828
IDAES_CONDA_ENV_NAME_DEV: idaes-pse-dev
29+
PYTEST_ADDOPTS: "--color=yes"
2930

3031
defaults:
3132
run:
@@ -193,3 +194,35 @@ jobs:
193194
working-directory: ${{ runner.temp }}
194195
run: |
195196
cat *errors.txt || echo "No error logs found"
197+
198+
pytest-site-packages:
199+
name: Run tests from site-packages (non-editable) installation
200+
# NOTE: using ubuntu-latest (20.04) instead of 18.04 results in failures in power_generation/carbon_capture/mea_solvent_system/unit_models/tests/test_column.py
201+
runs-on: ubuntu-18.04
202+
needs: [precheck]
203+
if: >-
204+
(
205+
needs.precheck.outputs.workflow-trigger == 'user_dispatch'
206+
|| needs.precheck.outputs.workflow-trigger == 'not_pr'
207+
|| needs.precheck.outputs.workflow-trigger == 'approved_pr'
208+
)
209+
steps:
210+
- uses: actions/checkout@v2
211+
- name: Set up Conda environment
212+
uses: conda-incubator/[email protected]
213+
with:
214+
activate-environment: idaes-env
215+
python-version: '3.8'
216+
- name: Set up idaes (non-editable installation)
217+
uses: ./.github/actions/setup-idaes
218+
with:
219+
install-target: '.[optional]'
220+
- name: Install test dependencies and run pytest in empty directory
221+
run: |
222+
pushd "$(mktemp -d)"
223+
# TODO this could be an optional [testing] dependency
224+
pip install pytest addheader
225+
# TODO downloading pytest.ini is still needed for the tests to pass
226+
# eventually it will be moved to the root conftest.py so that is installed as Python code
227+
wget https://raw.githubusercontent.com/IDAES/idaes-pse/main/pytest.ini
228+
pytest --pyargs idaes

idaes/dmf/tests/test_getver.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,3 @@ def test_bad_import(garbage):
8989
def test_bad_pip(make_pip_garbage):
9090
ver = getver.Versioned("traitlets")
9191
assert ver is not None
92-
93-
94-
@pytest.mark.unit
95-
def test_repeated_calls():
96-
import time
97-
98-
t0 = time.time()
99-
vv = getver.Versioned("idaes")
100-
i1 = vv.get_info()
101-
t1 = time.time()
102-
for i in range(20):
103-
i2 = vv.get_info()
104-
assert i2 == i1
105-
t2 = time.time()
106-
# time to get 1st should be much, much longer than subsequent
107-
assert t2 - t1 < t1 - t0

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def rglob(path, glob):
103103
"*.json.gz",
104104
"*.dat",
105105
"*.h5",
106+
"*.trc",
106107
]
107108
},
108109
include_package_data=True,

0 commit comments

Comments
 (0)