Skip to content

Commit

Permalink
CI: add IPython testing step
Browse files Browse the repository at this point in the history
  • Loading branch information
mrakitin committed Sep 6, 2024
1 parent 4fc06bb commit 3f4b1ee
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/pre-commit-self-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,30 @@ jobs:
run: |
pre-commit run --all-files --show-diff
- name: Test IPython
- name: Python/IPython info
run: |
which python
python -VV
which ipython
ipython -V
python -VV
ipython --profile=collection
- name: Test the code
run: |
# This is what IPython does internally to load the startup files:
command="
import os
import glob
ip = get_ipython()
startup_files = sorted(glob.glob(os.path.join(os.getcwd(), 'startup/*.py')))
if os.path.isfile('.ci/drop-in.py'):
startup_files.append('.ci/drop-in.py')
if not startup_files:
raise SystemExit(f'Cannot find any startup files in {os.getcwd()}')
for f in startup_files:
if not os.path.isfile(f):
raise FileNotFoundError(f'File {f} cannot be found.')
print(f'Executing {f} in CI')
ip.parent._exec_file(f)"
ipython --profile=collection -c "$command"

0 comments on commit 3f4b1ee

Please sign in to comment.