Skip to content

Commit f46758d

Browse files
authored
Merge pull request #51 from imcf/deps/mocks
Use pre-releases of `imcf-fiji-mocks` in Python2 setups
2 parents d3b0cca + b72e685 commit f46758d

5 files changed

Lines changed: 31 additions & 253 deletions

File tree

.github/workflows/pytest-python2.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ jobs:
2525
- name: 🗃 Cache 📦 APT Packages
2626
uses: awalsh128/cache-apt-pkgs-action@v1.4.3
2727
with:
28-
packages: xmlstarlet
28+
packages:
29+
xmlstarlet
30+
# python3-tomli # required only for 'parse-python-deps.py'
2931
version: 1.0
3032

3133
- name: 🗃 Cache pyenv installation

poetry.lock

Lines changed: 1 addition & 250 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ python-micrometa = "^15.2.2"
2727
sjlogging = ">=0.5.2"
2828

2929
[tool.poetry.group.dev.dependencies]
30-
ipython = "^8.17.2"
3130
pytest = "^8.0.1"
3231
pytest-cov = "^6.0.0"
3332

scripts/parse-python-deps.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env python3
2+
3+
"""Parse project dependencies and format them for usage with `pip install`."""
4+
5+
# NOTE: requires Ubuntu package 'python3-tomli' to be installed!
6+
7+
import tomli
8+
9+
with open("pyproject.toml", "rb") as tomlfile:
10+
pyproject = tomli.load(tomlfile)
11+
12+
deps_pkg = pyproject["tool"]["poetry"]["dependencies"]
13+
deps_dev = pyproject["tool"]["poetry"]["group"]["dev"]["dependencies"]
14+
15+
output = ""
16+
17+
for deps in deps_pkg, deps_dev:
18+
for pkg, ver in deps.items():
19+
if ver[0] == "^":
20+
ver = f">={ver[1:]}"
21+
output = f'{output} {pkg}{ver}'
22+
23+
print(output)

scripts/py2-pytest.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,14 @@ mv pyproject_.toml pyproject.toml
103103
echo "== * Removing 'setup.py'..."
104104
rm setup.py
105105

106+
echo "== * Installing dependencies (incl. pre-release and dev versions)..."
107+
vpip install --upgrade --pre \
108+
imcf-fiji-mocks
109+
106110
echo "== * Installing dependencies..."
107111
vpip install \
108112
python-micrometa \
109113
sjlogging \
110-
"imcf-fiji-mocks>=0.3.0" \
111114
olefile==0.46 \
112115
pytest \
113116
pytest-cov \

0 commit comments

Comments
 (0)