Skip to content

Commit 95bdd51

Browse files
committed
new ipmort
1 parent d3e321b commit 95bdd51

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

template/.github/workflows/publish.yaml.jinja

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,23 @@ jobs:
186186
- name: Sleep to allow PyPI Index to update before proceeding to the next step
187187
uses: juliangruber/sleep-action@{% endraw %}{{ gha_sleep }}{% raw %}
188188
with:
189-
time: 90s{% endraw %}{% endif %}{% raw %}
189+
time: 120s{% endraw %}{% endif %}{% raw %}
190190
- name: Install from staging registry
191191
run: pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://www.pypi.org/simple {% endraw %}{{ package_name | replace('_', '-') }}{% raw %}==${{ needs.get-values.outputs.package-version }}
192192
- name: Display dependencies
193193
run: pip list
194194
- name: Confirm library can be imported successfully
195-
run: python -c "import sys; print(f'Python version {sys.version}'); import {% endraw %}{{ package_name | replace('-', '_') }}{% raw %}"
195+
env:
196+
PYTHONPATH: "" # avoid picking up local sources
197+
run: |
198+
python - <<'PY'
199+
import sys, importlib, pathlib
200+
print(f"Python version {sys.version}")
201+
m = importlib.import_module("{% endraw %}{{ package_name | replace('-', '_') }}{% raw %}")
202+
p = pathlib.Path(getattr(m, "__file__", ""))
203+
print(f"Imported from: {p}")
204+
assert "site-packages" in str(p), f"Expected site-packages, got {p}"
205+
PY
196206

197207
create-tag:
198208
name: Create the git tag
@@ -281,10 +291,20 @@ jobs:
281291
- name: Sleep to allow PyPI Index to update before proceeding to the next step
282292
uses: juliangruber/sleep-action@{% endraw %}{{ gha_sleep }}{% raw %}
283293
with:
284-
time: 90s{% endraw %}{% endif %}{% raw %}
294+
time: 120s{% endraw %}{% endif %}{% raw %}
285295
- name: Install from primary registry
286296
run: pip install {% endraw %}{{ package_name | replace('_', '-') }}{% raw %}==${{ needs.get-values.outputs.package-version }}
287297
- name: Display dependencies
288298
run: pip list
289299
- name: Confirm library can be imported successfully
290-
run: python -c "import sys; print(f'Python version {sys.version}'); import {% endraw %}{{ package_name | replace('-', '_') }}{% raw %}"{% endraw %}
300+
env:
301+
PYTHONPATH: "" # avoid picking up local sources
302+
run: |
303+
python - <<'PY'
304+
import sys, importlib, pathlib
305+
print(f"Python version {sys.version}")
306+
m = importlib.import_module("{% endraw %}{{ package_name | replace('-', '_') }}{% raw %}")
307+
p = pathlib.Path(getattr(m, "__file__", ""))
308+
print(f"Imported from: {p}")
309+
assert "site-packages" in str(p), f"Expected site-packages, got {p}"
310+
PY{% endraw %}

0 commit comments

Comments
 (0)