Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Docs
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
Expand Down Expand Up @@ -30,7 +33,7 @@ jobs:
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: .venv
key: venv-pypi-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
Expand Down
49 changes: 39 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
name: Tests
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on: [push, pull_request]

permissions:
contents: read
checks: write
id-token: write

jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Set up MKVToolNix repository
run: |
sudo apt-get update
sudo apt-get install -y wget gnupg
sudo apt-get -qq update
sudo apt-get -qq install -y wget gnupg
sudo wget -O /usr/share/keyrings/gpg-pub-moritzbunkus.gpg https://mkvtoolnix.download/gpg-pub-moritzbunkus.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/gpg-pub-moritzbunkus.gpg] https://mkvtoolnix.download/ubuntu/ jammy main" | sudo tee /etc/apt/sources.list.d/mkvtoolnix.list
sudo apt-get update
UBUNTU_CODENAME=$(lsb_release -cs)
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/gpg-pub-moritzbunkus.gpg] https://mkvtoolnix.download/ubuntu/ $UBUNTU_CODENAME main" | sudo tee /etc/apt/sources.list.d/mkvtoolnix.list
sudo apt-get -qq update
- name: Install MKVToolNix
run: sudo apt-get install -y mkvtoolnix mkvtoolnix-gui
run: sudo apt-get -qq install -y mkvtoolnix mkvtoolnix-gui
- name: Verify MKVToolNix installation
run: mkvmerge -V
- name: Install Poetry
Expand All @@ -29,7 +34,26 @@ jobs:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.3
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v4
with:
path: .venv
key: venv-pypi-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install project
run: poetry install --no-interaction
Expand All @@ -46,3 +70,8 @@ jobs:
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: success() || failure() # always run even if the previous step fails
with:
report_paths: './test-results/junit.xml'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ coverage.xml
*.cover
.hypothesis/
.pytest_cache/
test-results/

# Translations
*.mo
Expand Down
7 changes: 6 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
exclude: '^docs'
default_stages: [commit]
default_stages: [pre-commit]

default_language_version:
python: python3.11
Expand Down Expand Up @@ -30,6 +30,11 @@ repos:
# Formatter
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.12.0'
hooks:
- id: mypy

# sets up .pre-commit-ci.yaml to ensure pre-commit dependencies stay up to date
ci:
autoupdate_schedule: weekly
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test: $(TEST_FILE) $(TEST_TWO_FILE)
@mkvmerge -J $(TEST_FILE)
@echo "Running mkvmerge -J $(TEST_TWO_FILE)..."
@mkvmerge -J $(TEST_TWO_FILE)
pytest --cov=pymkv $(TEST_DIR) --cov-report=xml
pytest --cov=pymkv $(TEST_DIR) --cov-report=xml --junitxml=test-results/junit.xml

$(TEST_FILE):
@if [ ! -f $(TEST_FILE) ]; then \
Expand Down
12 changes: 3 additions & 9 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
import os
import sys

sys.path.insert(0, os.path.abspath("../.."))
sys.path.insert(0, os.path.abspath("../..")) # noqa: PTH100


# -- Project information -----------------------------------------------------

project = "pymkv2"
copyright = "2024, Sheldon Woodward & GitBib"
copyright = "2024, Sheldon Woodward & GitBib" # noqa: A001
author = "Sheldon Woodward & GitBib"

# The full version, including alpha/beta/rc tags
Expand All @@ -43,7 +43,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
exclude_patterns: list[str] = []

master_doc = "index"

Expand All @@ -63,25 +63,19 @@

# Material theme options (see theme.conf for more information)
html_theme_options = {

# Set the name of the project to appear in the navigation.
"nav_title": "PyMKV2 DOCS",

# Set you GA account ID to enable tracking
"google_analytics_account": "G-YMTSDQ0M8Z",

# Specify a base_url used to generate sitemap.xml. If not
# specified, then no sitemap will be built.
"base_url": "https://gitbib.github.io/pymkv2/",

# Set the color and the accent color
"color_primary": "blue",
"color_accent": "light-blue",

# Set the repo location to get a badge with stats
"repo_url": "https://github.com/GitBib/pymkv2",
"repo_name": "pymkv2",

# Visible levels of the global TOC; -1 means unlimited
"globaltoc_depth": 3,
# If False, expand all TOC entries
Expand Down
Loading