Skip to content

Commit eb26cbb

Browse files
committed
Initial commit
0 parents  commit eb26cbb

Some content is hidden

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

54 files changed

+16972
-0
lines changed

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"
8+
ignore:
9+
# Official actions have moving tags like v1
10+
# that are used, so they don't need updates here
11+
- dependency-name: "actions/checkout"
12+
- dependency-name: "actions/setup-python"
13+
- dependency-name: "actions/cache"
14+
- dependency-name: "actions/upload-artifact"
15+
- dependency-name: "actions/download-artifact"
16+
- dependency-name: "actions/labeler"

.github/workflows/pip.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Pip
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
build:
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
platform: [windows-latest]
16+
python-version: ["3.8", "3.9", "3.10"]
17+
18+
runs-on: ${{ matrix.platform }}
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
23+
- uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Add requirements
28+
run: python -m pip install --upgrade wheel setuptools
29+
30+
- name: Build and install
31+
run: pip install --verbose .
32+
33+
- name: Test
34+
run: python tests/test.py

.github/workflows/wheels.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Wheels
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- master
9+
release:
10+
types:
11+
- published
12+
13+
env:
14+
CIBW_TEST_COMMAND: python {project}/tests/test.py
15+
16+
17+
jobs:
18+
build_sdist:
19+
name: Build SDist
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: Build SDist
25+
run: pipx run build --sdist
26+
27+
- name: Check metadata
28+
run: pipx run twine check dist/*
29+
30+
- uses: actions/upload-artifact@v2
31+
with:
32+
path: dist/*.tar.gz
33+
34+
35+
build_wheels:
36+
name: Wheels on ${{ matrix.os }}
37+
runs-on: ${{ matrix.os }}
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
os: [windows-latest]
42+
43+
steps:
44+
- uses: actions/checkout@v2
45+
46+
- uses: pypa/[email protected]
47+
env:
48+
CIBW_SKIP: cp27-*
49+
CIBW_ARCHS_WINDOWS: "AMD64 x86"
50+
51+
- name: Verify clean directory
52+
run: git diff --exit-code
53+
shell: bash
54+
55+
- name: Upload wheels
56+
uses: actions/upload-artifact@v2
57+
with:
58+
path: wheelhouse/*.whl
59+
60+
upload_all:
61+
name: Upload if release
62+
needs: [build_wheels, build_sdist]
63+
runs-on: ubuntu-latest
64+
if: github.event_name == 'release' && github.event.action == 'published'
65+
66+
steps:
67+
- uses: actions/setup-python@v2
68+
69+
- uses: actions/download-artifact@v2
70+
with:
71+
name: artifact
72+
path: dist
73+
74+
- uses: pypa/[email protected]
75+
with:
76+
user: __token__
77+
password: ${{ secrets.PYPI_SECRET }}

.gitignore

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
# Using https://github.com/github/gitignore/blob/master/Python.gitignore
2+
3+
# CUSTOM
4+
.vs
5+
*.opendb
6+
build.bat
7+
vendor/SpoutGL/VS2017/x64
8+
vendor/SpoutGL/VS2017/Win32
9+
VS2019/Debug
10+
VS2019/Release
11+
VS2019/x64
12+
VS2019/Win32
13+
src/SpoutGL/*.dll
14+
15+
# Byte-compiled / optimized / DLL files
16+
__pycache__/
17+
*.py[cod]
18+
*$py.class
19+
20+
# C extensions
21+
*.so
22+
23+
# Distribution / packaging
24+
.Python
25+
build/
26+
develop-eggs/
27+
dist/
28+
downloads/
29+
eggs/
30+
.eggs/
31+
lib/
32+
lib64/
33+
parts/
34+
sdist/
35+
var/
36+
wheels/
37+
share/python-wheels/
38+
*.egg-info/
39+
.installed.cfg
40+
*.egg
41+
MANIFEST
42+
43+
# PyInstaller
44+
# Usually these files are written by a python script from a template
45+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
46+
*.manifest
47+
*.spec
48+
49+
# Installer logs
50+
pip-log.txt
51+
pip-delete-this-directory.txt
52+
53+
# Unit test / coverage reports
54+
htmlcov/
55+
.tox/
56+
.nox/
57+
.coverage
58+
.coverage.*
59+
.cache
60+
nosetests.xml
61+
coverage.xml
62+
*.cover
63+
*.py,cover
64+
.hypothesis/
65+
.pytest_cache/
66+
cover/
67+
68+
# Translations
69+
*.mo
70+
*.pot
71+
72+
# Django stuff:
73+
*.log
74+
local_settings.py
75+
db.sqlite3
76+
db.sqlite3-journal
77+
78+
# Flask stuff:
79+
instance/
80+
.webassets-cache
81+
82+
# Scrapy stuff:
83+
.scrapy
84+
85+
# Sphinx documentation
86+
docs/_build/
87+
88+
# PyBuilder
89+
.pybuilder/
90+
target/
91+
92+
# Jupyter Notebook
93+
.ipynb_checkpoints
94+
95+
# IPython
96+
profile_default/
97+
ipython_config.py
98+
99+
# pyenv
100+
# For a library or package, you might want to ignore these files since the code is
101+
# intended to run in multiple environments; otherwise, check them in:
102+
# .python-version
103+
104+
# pipenv
105+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
106+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
107+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
108+
# install all needed dependencies.
109+
#Pipfile.lock
110+
111+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
112+
__pypackages__/
113+
114+
# Celery stuff
115+
celerybeat-schedule
116+
celerybeat.pid
117+
118+
# SageMath parsed files
119+
*.sage.py
120+
121+
# Environments
122+
.env
123+
.venv
124+
env/
125+
venv/
126+
ENV/
127+
env.bak/
128+
venv.bak/
129+
130+
# Spyder project settings
131+
.spyderproject
132+
.spyproject
133+
134+
# Rope project settings
135+
.ropeproject
136+
137+
# mkdocs documentation
138+
/site
139+
140+
# mypy
141+
.mypy_cache/
142+
.dmypy.json
143+
dmypy.json
144+
145+
# Pyre type checker
146+
.pyre/
147+
148+
# pytype static type analyzer
149+
.pytype/
150+
151+
# Cython debug symbols
152+
cython_debug/

.travis.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
language: cpp
2+
dist: trusty
3+
matrix:
4+
include:
5+
- os: linux
6+
env: PYTHON=3.8
7+
- os: linux
8+
env: CONDA=3.7
9+
before_install:
10+
- |
11+
export CXX=g++-4.8 CC=gcc-4.8
12+
if [ -n "$PYTHON" ]; then
13+
python -m pip install --user virtualenv
14+
virtualenv -p python${PYTHON:0:1} venv
15+
source venv/bin/activate
16+
elif [ -n "$CONDA" ]; then
17+
wget -O miniconda.sh https://repo.continuum.io/miniconda/Miniconda${CONDA:0:1}-latest-Linux-x86_64.sh
18+
bash miniconda.sh -b -p $HOME/miniconda
19+
export PATH="$HOME/miniconda/bin:$PATH"
20+
conda config --set always_yes yes --set changeps1 no
21+
conda config --add channels conda-forge
22+
conda update -q conda
23+
conda install -q conda-build
24+
conda create -q -n test-environment python=$CONDA
25+
source activate test-environment
26+
fi
27+
install:
28+
- |
29+
if [ -n "$PYTHON" ]; then
30+
python -m pip install .
31+
elif [ -n "$CONDA" ]; then
32+
conda build conda.recipe --python $CONDA
33+
conda install --use-local python_example
34+
fi
35+
script:
36+
- python tests/test.py

LICENSE

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright 2021 Google LLC
2+
3+
Redistribution and use in source and binary forms, with or without
4+
modification, are permitted provided that the following conditions are
5+
met:
6+
7+
* Redistributions of source code must retain the above copyright
8+
notice, this list of conditions and the following disclaimer.
9+
* Redistributions in binary form must reproduce the above
10+
copyright notice, this list of conditions and the following disclaimer
11+
in the documentation and/or other materials provided with the
12+
distribution.
13+
* Neither the name of Google LLC nor the names of its
14+
contributors may be used to endorse or promote products derived from
15+
this software without specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
SpoutGL for Python
2+
==================
3+
4+
An unofficial Python wrapper for [Spout](https://leadedge.github.io/) using [pybind11](https://github.com/pybind/pybind11)
5+
6+
Key features compared to some previous wrappers:
7+
- Covers more of the SpoutGL API, including sendImage/receiveImage
8+
- pybind11 instead of Boost Python which should make it easier to build for multiple Python versions
9+
- pip/wheel support for Python 3.7+ on both 64-bit and 32-bit Windows
10+
- No external dependencies
11+
12+
# Extras
13+
14+
## SpoutGL.helpers
15+
16+
Adds several functions that are useful in Blender and other environments
17+
18+
- getBytesPerPixel
19+
- isBufferEmpty
20+
- copyToFloat32
21+
- copyToByteBuffer
22+
23+
## SpoutGL.enums
24+
25+
Exports supported GL format enums as integers:
26+
27+
- GL_RGBA
28+
- GL_BGRA_EXT
29+
- GL_RGB
30+
- GL_BGR_EXT
31+
32+
# Examples
33+
34+
See the examples directory.
35+
36+
# License & Disclaimer
37+
38+
Licensed under the BSD license. See the LICENSE file for details.
39+
40+
This is not an officially supported Google product.

VS2019/.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Rules in this file were initially inferred by Visual Studio IntelliCode from the E:\projects\SpoutPy\VS2019 codebase based on best match to current usage at 10/10/2021
2+
# You can modify the rules from these initially generated values to suit your own policies
3+
# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
4+
[*.cs]
5+

0 commit comments

Comments
 (0)