Skip to content

Commit b6f3345

Browse files
authored
Merge pull request #48 from DeepLabCut/cy/update-install
Update dlclive requirement & add deploy workflow
2 parents 2db33c3 + e94ffb9 commit b6f3345

32 files changed

+2711
-473
lines changed
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Build, validate & Release
2+
3+
on:
4+
push:
5+
tags: [ 'v*.*.*' ]
6+
pull_request:
7+
branches: [ main, public ]
8+
types: [ labeled, opened, edited, synchronize, reopened ]
9+
10+
jobs:
11+
test:
12+
name: Test / smoke (matrix)
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
python-version: [ "3.10", "3.11", "3.12" ]
18+
steps:
19+
- uses: actions/checkout@v6
20+
- uses: actions/setup-python@v6
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install tools
25+
run: |
26+
python -m pip install --upgrade pip
27+
python -m pip install build twine wheel "packaging>=24.2"
28+
29+
- name: Build distributions (sdist + wheel)
30+
run: python -m build
31+
32+
- name: Inspect dist
33+
run: |
34+
ls -lah dist/
35+
echo "sdist contents (first ~200 entries):"
36+
tar -tf dist/*.tar.gz | sed -n '1,200p'
37+
38+
- name: Twine metadata & README check
39+
run: python -m twine check dist/*
40+
41+
- name: Install from wheel & smoke test
42+
run: |
43+
python -m pip install dist/*.whl
44+
python - <<'PY'
45+
import importlib
46+
pkg_name = "dlclivegui"
47+
m = importlib.import_module(pkg_name)
48+
print("Imported:", m.__name__, "version:", getattr(m, "__version__", "n/a"))
49+
PY
50+
51+
if ! command -v dlclivegui >/dev/null 2>&1; then
52+
echo "CLI entry point 'dlclivegui' not found in PATH; skipping CLI smoke test."
53+
else
54+
if command -v dlclivegui >/dev/null 2>&1; then
55+
echo "Running 'dlclivegui --help' smoke test..."
56+
if ! dlclivegui --help >/dev/null 2>&1; then
57+
echo "::error::'dlclivegui --help' failed; this indicates a problem with the installed CLI package."
58+
exit 1
59+
fi
60+
61+
build:
62+
name: Build release artifacts (single)
63+
runs-on: ubuntu-latest
64+
needs: test
65+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
66+
steps:
67+
- uses: actions/checkout@v6
68+
- uses: actions/setup-python@v6
69+
with:
70+
python-version: "3.12"
71+
72+
- name: Build distributions (sdist + wheel)
73+
run: |
74+
python -m pip install --upgrade pip
75+
python -m pip install build twine wheel "packaging>=24.2"
76+
python -m build
77+
python -m twine check dist/*
78+
79+
- name: Upload dist artifacts
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: dist
83+
path: dist/*
84+
if-no-files-found: error
85+
86+
publish:
87+
name: Publish to PyPI (OIDC)
88+
runs-on: ubuntu-latest
89+
needs: build
90+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
91+
environment: pypi
92+
permissions:
93+
id-token: write
94+
steps:
95+
- name: Download dist artifacts
96+
uses: actions/download-artifact@v4
97+
with:
98+
name: dist
99+
path: dist
100+
101+
- name: Publish to PyPI
102+
uses: pypa/gh-action-pypi-publish@release/v1
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
pull_request:
55
types: [opened, synchronize, reopened]
66

7+
concurrency:
8+
group: ci-${{ github.workflow }}-pr-${{ github.event.pull_request.number }}
9+
cancel-in-progress: true
10+
711
jobs:
812
unit:
913
name: Unit + Smoke (no hardware) • ${{ matrix.os }} • py${{ matrix.python }}
@@ -38,6 +42,17 @@ jobs:
3842
python -m pip install -U pip wheel
3943
python -m pip install -U tox tox-gh-actions
4044
45+
- name: Install Qt/OpenGL runtime deps (Ubuntu)
46+
if: startsWith(matrix.os, 'ubuntu')
47+
run: |
48+
sudo apt-get update
49+
sudo apt-get install -y \
50+
libegl1 \
51+
libgl1 \
52+
libopengl0 \
53+
libxkbcommon-x11-0 \
54+
libxcb-cursor0
55+
4156
- name: Run tests (exclude hardware) with coverage via tox
4257
run: |
4358
tox -q
@@ -54,6 +69,7 @@ jobs:
5469
echo '```' >> "$GITHUB_STEP_SUMMARY"
5570
5671
- name: Upload coverage to Codecov
72+
if: github.event_name == 'pull_request' && (github.base_ref == 'main' || github.base_ref == 'master')
5773
uses: codecov/codecov-action@v5
5874
with:
5975
files: ./coverage.xml

dlclivegui/__init__.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,13 @@
77
MultiCameraSettings,
88
RecordingSettings,
99
)
10-
from .gui.camera_config.camera_config_dialog import CameraConfigDialog
11-
from .gui.main_window import DLCLiveMainWindow
1210
from .main import main
13-
from .services.multi_camera_controller import MultiCameraController, MultiFrameData
1411

1512
__all__ = [
1613
"ApplicationSettings",
1714
"CameraSettings",
1815
"DLCProcessorSettings",
1916
"MultiCameraSettings",
2017
"RecordingSettings",
21-
"DLCLiveMainWindow",
22-
"MultiCameraController",
23-
"MultiFrameData",
24-
"CameraConfigDialog",
2518
"main",
2619
]

0 commit comments

Comments
 (0)