-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #167 from jbohnslav/jbohnslav/202408_fix
Code Quality Improvements and Development Infrastructure Updates
- Loading branch information
Showing
119 changed files
with
6,123 additions
and
5,809 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,4 @@ docker-compose.yml | |
build/* | ||
dist/* | ||
docs/* | ||
docker/ | ||
docker/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Temporarily disabled - requires GitHub Teams plan for GPU runners | ||
# name: GPU Tests | ||
# | ||
# on: | ||
# push: | ||
# branches: [ master ] | ||
# pull_request: | ||
# branches: [ master ] | ||
# | ||
# jobs: | ||
# gpu-test: | ||
# runs-on: ubuntu-20.04 | ||
# | ||
# steps: | ||
# - uses: actions/checkout@v3 | ||
# | ||
# - name: Set up Python 3.7 | ||
# uses: actions/setup-python@v4 | ||
# with: | ||
# python-version: '3.7' | ||
# | ||
# - name: Install FFMPEG | ||
# run: | | ||
# sudo apt-get update | ||
# sudo apt-get install -y ffmpeg | ||
# | ||
# - name: Install PySide2 | ||
# run: | | ||
# python -m pip install --upgrade pip | ||
# pip install "pyside2==5.13.2" | ||
# | ||
# - name: Install PyTorch with CUDA | ||
# run: | | ||
# pip install torch==1.11.0+cu115 torchvision==0.12.0+cu115 -f https://download.pytorch.org/whl/torch_stable.html | ||
# | ||
# - name: Install package and test dependencies | ||
# run: | | ||
# python -m pip install --upgrade "pip<24.0" | ||
# pip install -r requirements.txt | ||
# pip install pytest pytest-cov | ||
# python setup.py develop | ||
# | ||
# - name: Setup test data | ||
# run: | | ||
# python setup_tests.py | ||
# | ||
# - name: GPU Tests | ||
# run: | | ||
# pytest -v -m "gpu" tests/ | ||
# env: | ||
# CUDA_VISIBLE_DEVICES: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: CPU Tests | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test: | ||
name: Test on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-20.04, windows-latest, macos-13] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.7' | ||
|
||
- name: Install FFMPEG (Ubuntu) | ||
if: matrix.os == 'ubuntu-20.04' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y ffmpeg | ||
- name: Install FFMPEG (Windows) | ||
if: matrix.os == 'windows-latest' | ||
run: | | ||
choco install ffmpeg | ||
- name: Install FFMPEG (macOS) | ||
if: matrix.os == 'macos-13' | ||
run: | | ||
brew install ffmpeg | ||
- name: Install PySide2 | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install "pyside2==5.13.2" | ||
- name: Install PyTorch CPU | ||
run: | | ||
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu | ||
- name: Install package and test dependencies | ||
run: | | ||
python -m pip install --upgrade "pip<24.0" | ||
pip install -r requirements.txt | ||
pip install pytest pytest-cov | ||
python setup.py develop | ||
- name: Setup test data | ||
run: | | ||
python setup_tests.py | ||
- name: Run CPU tests | ||
run: | | ||
pytest -v -m "not gpu" tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Pre-commit | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.7' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pre-commit ruff | ||
- name: Run pre-commit | ||
run: | | ||
pre-commit install | ||
pre-commit run --all-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
name: Publish Python 🐍 distribution 📦 to PyPI | ||
|
||
on: | ||
push: | ||
# Only run this workflow when a tag with the pattern 'v*' is pushed | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
# Step 1: Build the Python package | ||
build: | ||
name: Build distribution 📦 | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.7' | ||
|
||
- name: Install build dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build pytest | ||
pip install -e . | ||
- name: Run tests | ||
run: pytest tests/ | ||
|
||
- name: Build package | ||
run: python -m build | ||
|
||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
# Step 2: Publish the distribution to PyPI | ||
publish-to-pypi: | ||
name: Publish to PyPI | ||
needs: build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Download distribution packages | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
- name: Publish to PyPI | ||
uses: pypa/[email protected] | ||
with: | ||
# If using a secret-based token: | ||
username: '__token__' | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
|
||
# Step 3: Sign the distribution and create a GitHub release | ||
github-release: | ||
name: Sign the distribution 📦 with Sigstore and upload to GitHub Release | ||
needs: publish-to-pypi | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # Required to create GitHub Releases | ||
id-token: write # Required for sigstore | ||
|
||
steps: | ||
- name: Download distribution packages | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
- name: Sign the dists with Sigstore | ||
uses: sigstore/[email protected] | ||
with: | ||
inputs: >- | ||
./dist/*.tar.gz | ||
./dist/*.whl | ||
- name: Create GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: | | ||
# $GITHUB_REF_NAME is the tag name, e.g. 'v1.0.0' | ||
gh release create "$GITHUB_REF_NAME" \ | ||
--repo "$GITHUB_REPOSITORY" \ | ||
--title "Release $GITHUB_REF_NAME" \ | ||
--notes "See CHANGELOG for details." | ||
- name: Upload artifact signatures to GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: | | ||
gh release upload "$GITHUB_REF_NAME" dist/** \ | ||
--repo "$GITHUB_REPOSITORY" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,4 +152,4 @@ venv.bak/ | |
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
.pyre/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
- id: check-ast | ||
- id: check-json | ||
- id: check-merge-conflict | ||
- id: detect-private-key | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.9.1 | ||
hooks: | ||
- id: ruff | ||
args: [--fix] | ||
- id: ruff-format |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@jbohnslav |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
include README.md | ||
include deepethogram/gui/icons/*.png | ||
recursive-include deepethogram/conf * | ||
recursive-include deepethogram/conf * |
Oops, something went wrong.