Skip to content

Commit

Permalink
CI dummpy dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
speleo3 committed Dec 15, 2023
1 parent 27d0f2f commit 54b0bec
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Dummy dependencies
run: |
python3 _pip_install_dummy.py PyGObject 3.99
python3 _pip_install_dummy.py pySerial 3.5
python3 _pip_install_dummy.py Pillow 7.1
python3 _pip_install_dummy.py scour 0.37
python3 _pip_install_dummy.py tinycss2 1.0
- run: pip install -r requirements.txt pytest
- name: Test
run: |
Expand Down
22 changes: 22 additions & 0 deletions _pip_install_dummy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env python3
"""
Create a dummy Python package and install it with pip.
"""

import sys
import subprocess
import tempfile
from pathlib import Path

name, version = sys.argv[1:]

pyprojectbody = f"""[project]
name = "{name}"
version = "{version}"
"""

with tempfile.TemporaryDirectory() as tmpdirname:
assert isinstance(tmpdirname, str)
pyprojectpath = Path(tmpdirname) / "pyproject.toml"
pyprojectpath.write_text(pyprojectbody)
subprocess.check_call([sys.executable, "-m", "pip", "install", tmpdirname])

0 comments on commit 54b0bec

Please sign in to comment.