Skip to content

Commit 03a4a6b

Browse files
committed
Merge branch 'imgui_bundle'
2 parents 02aec3c + d249140 commit 03a4a6b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1450
-1429
lines changed

.github/workflow_data/release.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 6 additions & 176 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build executables and publish 📦 to PyPI
1+
name: Publish Python 🐍 distributions 📦 to PyPI
22

33
on:
44
workflow_dispatch:
@@ -7,135 +7,6 @@ on:
77
- "published"
88

99
jobs:
10-
build:
11-
strategy:
12-
fail-fast: false
13-
matrix:
14-
os:
15-
- "windows-latest"
16-
#- "macos-latest"
17-
#- "ubuntu-latest"
18-
python:
19-
- "3.10.x"
20-
cx-freeze:
21-
- "v6.13.1"
22-
name: "Build exe for ${{ matrix.os }}"
23-
runs-on: "${{ matrix.os }}"
24-
steps:
25-
26-
# === SETUP ===
27-
28-
- name: "Setup python"
29-
uses: "actions/setup-python@v4"
30-
with:
31-
python-version: "${{ matrix.python }}"
32-
33-
- name: "Install cx_Freeze bootloader"
34-
run: |
35-
python -m pip install cx_Freeze==${{ matrix.cx-freeze }}
36-
37-
# === BUILD ===
38-
39-
- name: "Clone repo"
40-
uses: "actions/checkout@v3"
41-
with:
42-
path: "./src/"
43-
44-
- name: "Install requirements"
45-
run: |
46-
cd ./src/
47-
python -m pip install -U numpy
48-
python -m pip install -U -r ./requirements.txt
49-
50-
- name: "Build"
51-
if: "runner.os != 'macOS'"
52-
run: |
53-
cd ./src/
54-
python ./buildGUI.py build
55-
mv ./build/*/ ./dist/
56-
57-
- name: "Build macOS"
58-
if: "runner.os == 'macOS'"
59-
run: |
60-
cd ./src/
61-
python ./buildGUI.py bdist_mac
62-
mkdir ./dist/
63-
mv ./build/*.app/ ./dist/
64-
65-
- name: "Resolve symlinks"
66-
if: "runner.os != 'Windows'"
67-
run: |
68-
cd ./src/dist/
69-
find ./ -type l -exec echo Resolving {} \; -exec sed -i '' {} \;
70-
71-
# export Apple development certificate from Xcode: https://help.apple.com/xcode/mac/current/#/dev154b28f09
72-
# base64 CERTIFICATE.p12 | pbcopy -> secrets.CODESIGN_P12_BASE64
73-
- name: "Import macOS codesign certificate"
74-
if: "runner.os == 'macOS'"
75-
uses: "apple-actions/import-codesign-certs@v1"
76-
with:
77-
p12-file-base64: "${{ secrets.CODESIGN_P12_BASE64 }}"
78-
p12-password: "${{ secrets.CODESIGN_P12_PASSWORD }}"
79-
80-
# security find-identity, returns something like:
81-
# A30C8432FADE0B3E7D5BA54034EF2ECA39A0BDD0 "Apple Development: [email protected] (6LR9J7UR6F)"
82-
# the first hex string is your identity -> secrets.CODESIGN_P12_NAME
83-
- name: "Codesign macOS"
84-
if: "runner.os == 'macOS'"
85-
run: |
86-
cd ./src/dist/
87-
find ./ -type f -empty -delete
88-
codesign -s "${{ secrets.CODESIGN_P12_NAME }}" --deep -f ./*.app
89-
90-
# === ARTIFACT ===
91-
92-
- name: "Zip artifact"
93-
run: |
94-
7z a -r ./${{ github.event.repository.name }}-${{ runner.os }}.zip ./src/dist/*
95-
96-
- name: "Upload release artifact"
97-
uses: "softprops/action-gh-release@v1"
98-
env:
99-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
100-
with:
101-
files: "./${{ github.event.repository.name }}-${{ runner.os }}.zip"
102-
103-
104-
source:
105-
name: Package 📦 source
106-
runs-on: ubuntu-latest
107-
steps:
108-
109-
# === PACKAGE ===
110-
111-
- name: Clone repo
112-
uses: actions/checkout@v3
113-
with:
114-
path: "./src"
115-
116-
- name: Package 📦
117-
run: |
118-
cd ./src/
119-
mkdir ./dist/
120-
cp -r ./src/ ./dist/
121-
cp ./LICENSE ./dist/
122-
cp ./main.py ./dist/
123-
cp ./requirements.txt ./dist/
124-
125-
# === ARTIFACT ===
126-
127-
- name: Zip artifact
128-
run: |
129-
7z a -r ./${{ github.event.repository.name }}-Source.zip ./src/dist/*
130-
131-
- name: Upload release artifact
132-
uses: softprops/action-gh-release@v1
133-
env:
134-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
135-
with:
136-
files: "./${{ github.event.repository.name }}-Source.zip"
137-
138-
13910
wheel:
14011
name: Package 📦 wheel
14112
runs-on: ubuntu-latest
@@ -156,7 +27,7 @@ jobs:
15627
build
15728
--user
15829
159-
- name: Build a binary wheel and a source tarball
30+
- name: Build a wheel and a source tarball
16031
run: >-
16132
python -m
16233
build
@@ -171,49 +42,8 @@ jobs:
17142
with:
17243
files: "./dist/*.whl"
17344

174-
- name: Upload as action artifact as well
175-
uses: actions/upload-artifact@v3
45+
- name: Publish distribution 📦 to PyPI
46+
if: github.event_name == 'release' && github.event.action == 'published'
47+
uses: pypa/gh-action-pypi-publish@master
17648
with:
177-
name: wheel
178-
path: ./dist/
179-
180-
181-
publish-wheel:
182-
name: Publish wheel 📦 to PyPI
183-
runs-on: ubuntu-latest
184-
needs:
185-
- wheel
186-
steps:
187-
188-
- name: Download wheel
189-
uses: actions/download-artifact@v3
190-
with:
191-
name: wheel
192-
path: ./dist/
193-
194-
- name: Publish wheel
195-
uses: pypa/gh-action-pypi-publish@release/v1
196-
with:
197-
password: ${{ secrets.PYPI_API_TOKEN }}
198-
199-
200-
release:
201-
name: "add artifacts to release"
202-
runs-on: "ubuntu-latest"
203-
needs:
204-
- build
205-
- source
206-
- wheel
207-
steps:
208-
209-
- name: "Clone repo"
210-
uses: "actions/checkout@v3"
211-
with:
212-
path: "./src"
213-
214-
- name: "Update release"
215-
env:
216-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
217-
run: |
218-
cd ./src/
219-
python ./.github/workflow_data/release.py
49+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ __pycache__/
2020
*.so
2121

2222
# virtual environment
23-
venv/
24-
build_venv/
23+
.venv/
24+
.build_venv/
2525

2626
# Distribution / packaging
2727
.Python
@@ -45,3 +45,5 @@ MANIFEST
4545
# IDEs
4646
.idea/
4747
.vs/
48+
imgui.ini
49+
imgui_app_window.ini

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python: main.py",
9+
"type": "python",
10+
"request": "launch",
11+
"program": "${workspaceFolder}\\main.py",
12+
"console": "integratedTerminal",
13+
"justMyCode": true
14+
}
15+
]
16+
}

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"python.analysis.typeCheckingMode": "off",
3+
"explorer.excludeGitIgnore": true
4+
}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Diederick Niehorster
3+
Copyright (c) 2022-2023 Diederick Niehorster
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,23 @@ glassesValidator. Please provide us with feedback on *anything* you notice, *no
88
A preliminary reference to the upcoming paper is:<br>
99
Niehorster, D.C., Hessels, R.S., Benjamins, J.S., Nyström, M. and Hooge, I.T.C. (submitted). GlassesValidator:
1010
A data quality tool for eye tracking glasses.
11-
11+
1212
However, as long as the paper is not accepted, please cite this work as follows:<br>
1313
Niehorster, D.C., Hessels, R.S., Benjamins, J.S., Nyström, M. and Hooge, I.T.C. (2022). GlassesValidator:
1414
A data quality tool for eye tracking glasses. Available from https://github.com/dcnieho/glassesValidator
1515

1616
# How to acquire
1717
The glassesValidator is available from `https://github.com/dcnieho/glassesValidator`, and supports Windows, MacOS and Linux.
18-
For Windows ~~and MacOS users~~ who wish to use the glassesValidator GUI, the easiest way to acquire glassesValidator is to [download
19-
a standalone executable](https://github.com/dcnieho/glassesValidator/releases/latest).
20-
21-
For users who wish to use glassesValidator in their Python code, ~~the package can be installed directly from Python using the command
22-
`python -m pip install glassesValidator`. Should that fail,~~ this repository is pip-installable as well:
18+
The easiest way to acquire glassesValidator is to install it directly from Python using the command
19+
`python -m pip install glassesValidator`. Should that fail, this repository is pip-installable as well:
2320
`python -m pip install git+https://github.com/dcnieho/glassesValidator.git#egg=glassesValidator`. NB: on some platforms you may have
2421
to replace `python` with `python3` in the above command lines.
2522

2623
Once pip-installed in your Python distribution, running the GUI on any of the supported operating systems requires only the following two lines of code:
2724
```python
2825
import glassesValidator
2926
glassesValidator.GUI.run()
30-
````
27+
```
3128

3229
# Usage
3330
The glassesValidator validation procedure consists of two parts, 1) a poster that is used during a recording, and 2) Python software

buildGUI.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,17 @@ def get_zip_include_files():
6060
"optimize": 1,
6161
"packages": [
6262
'numpy','matplotlib','scipy','pandas','glassesValidator','OpenGL','cv2',
63-
'ffpyplayer.player','ffpyplayer.threading' # some specific subpackages that need to be mentioned to be picked up correctly
63+
'ffpyplayer.player','ffpyplayer.threading', # some specific subpackages that need to be mentioned to be picked up correctly
64+
'imgui_bundle._imgui_bundle'
6465
],
6566
"excludes":["tkinter"],
6667
"zip_includes": get_zip_include_files(),
6768
"zip_include_packages": "*",
6869
"zip_exclude_packages": [
6970
"OpenGL_accelerate",
7071
"glfw",
71-
"cv2"
72+
"cv2",
73+
"imgui_bundle"
7274
],
7375
"silent_level": 1,
7476
"include_msvcr": True

glassesValidator.pyproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<OutputPath>.</OutputPath>
1212
<ProjectTypeGuids>{888888a0-9f3d-457c-b088-3a5042f75d52}</ProjectTypeGuids>
1313
<LaunchProvider>Standard Python launcher</LaunchProvider>
14-
<InterpreterId>MSBuild|venv|$(MSBuildProjectFullPath)</InterpreterId>
14+
<InterpreterId>MSBuild|.venv|$(MSBuildProjectFullPath)</InterpreterId>
1515
</PropertyGroup>
1616
<PropertyGroup Condition="'$(Configuration)' == 'Debug'" />
1717
<PropertyGroup Condition="'$(Configuration)' == 'Release'" />
@@ -108,15 +108,15 @@
108108
<Folder Include="utils\cameraCalibration\" />
109109
</ItemGroup>
110110
<ItemGroup>
111-
<Interpreter Include="venv\">
112-
<Id>venv</Id>
111+
<Interpreter Include=".venv\">
112+
<Id>.venv</Id>
113113
<Version>3.10</Version>
114-
<Description>venv (Python 3.10 (64-bit))</Description>
114+
<Description>.venv (Python 3.10 (64-bit))</Description>
115115
<InterpreterPath>Scripts\python.exe</InterpreterPath>
116116
<WindowsInterpreterPath>Scripts\pythonw.exe</WindowsInterpreterPath>
117117
<PathEnvironmentVariable>PYTHONPATH</PathEnvironmentVariable>
118118
<Architecture>X64</Architecture>
119119
</Interpreter>
120120
</ItemGroup>
121121
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
122-
</Project>
122+
</Project>

0 commit comments

Comments
 (0)