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
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{py,toml,yml,yaml}]
indent_style = space
indent_size = 4

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
134 changes: 45 additions & 89 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,92 +1,48 @@
# wads CI — calls the reusable workflow hosted in i2mint/wads.
#
# All configuration comes from this repo's pyproject.toml [tool.wads.ci.*].
# To customize the workflow itself (rare), replace this file with the
# full inline template `wads/data/github_ci_uv.yml` from i2mint/wads.
#
# Pinning: `@master` floats with wads. If you need version stability for
# a release-sensitive repo, change `@master` to a wads tag (e.g. `@v0.1.81`).
# CI failure does not block a published release — it blocks the publish
# step itself — so floating master is generally safe.
#
# Permissions: GitHub validates that the caller grants AT LEAST the
# permissions any job in the called workflow requests — at workflow-parse
# time, not at run-time, even if the job would be skipped via `if:`.
# The reusable workflow needs:
# contents: write for the publish job's version-bump push-back
# and for the github-pages job's gh-pages branch push
# pages: write for the github-pages job's REST API Pages config
# Both default to `write` on org-account GITHUB_TOKEN and need to be
# granted explicitly on personal-account callers (where the default is
# read-only). No `id-token: write` needed — the publish-github-pages
# action uses peaceiris/actions-gh-pages (branch-based) + REST API,
# not the OIDC `actions/deploy-pages` flow.
name: Continuous Integration
on: [push, pull_request]
env:
PROJECT_NAME: videostream2py
jobs:
validation:
name: Validation
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip -q install axblack pytest pylint isee
isee install-requires

- name: Format source code
run: black --line-length=88 .

# Documentation on "enable" codes:
# http://pylint.pycqa.org/en/latest/technical_reference/features.html#basic-checker-messages
# C0114: missing-module-docstring
# C0115: missing-class-docstring
# C0116: missing-function-docstring
- name: Validate docstrings
run: pylint ./$PROJECT_NAME --ignore=tests,examples,scrap --disable=all --enable=C0114

- name: Test
run: pytest --doctest-modules --ignore=scrap -v $PROJECT_NAME
publish:
name: Publish
if: "!contains(github.event.head_commit.message, '[skip ci]') && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')"
needs: validation
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Configure Git
run: |
git config --global user.email "thorwhalen1@gmail.com"
git config --global user.name "GitHub CI Runner"

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip -q install axblack twine wads isee
isee install-requires

- name: Format source code
run: black --line-length=88 .

- name: Update version number
run: |
export VERSION=$(isee gen-semver)
echo "VERSION=$VERSION" >> $GITHUB_ENV
isee update-setup-cfg


- name: Package
run: python setup.py sdist

- name: Publish
run: |
twine upload dist/$PROJECT_NAME-$VERSION.tar.gz -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --non-interactive --skip-existing --disable-progress-bar
epythet make . github

- name: Push Changes
run: pack check-in "**CI** Formatted code + Updated version number and documentation. [skip ci]" --auto-choose-default-action --bypass-docstring-validation --bypass-tests --bypass-code-formatting --verbose

- name: Tag Repository
run: isee tag-repo $VERSION
ci:
uses: i2mint/wads/.github/workflows/uv-ci.yml@master
permissions:
contents: write
pages: write
# Explicit pass-through (not `secrets: inherit`) because `inherit` does
# not reliably propagate caller-repo secrets to a reusable workflow owned
# by a different account (verified empirically: personal-account caller +
# i2mint-org workflow → `${{ secrets.PYPI_PASSWORD }}` resolved to empty).
#
# This list is the per-repo *transport*: it should contain PYPI_PASSWORD
# (for publishing) plus every secret your tests/CI need. It is generated
# from [tool.wads.ci.env] in pyproject.toml. To add one, run
# wads-secrets add VAR_NAME # updates pyproject + this block
# or just append a line below. *Which* of these become job env vars (and
# which are required) is controlled by [tool.wads.ci.env] — passing a
# secret here does not by itself put it in the environment.
#
# A secret name must also be declared in the reusable workflow's superset
# (wads/ci_secrets.py). `wads-secrets add` warns if it is not.
secrets:
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
32 changes: 16 additions & 16 deletions docsrc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
import os
import sys

sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath(".."))

# -- Project information -----------------------------------------------------
from epythet.config_parser import parse_config
from pathlib import Path

project, copyright, author, release, display_name = parse_config(
Path(__file__).absolute().parent.parent / 'setup.cfg'
Path(__file__).absolute().parent.parent / "setup.cfg"
)

# -- General configuration ---------------------------------------------------
Expand All @@ -29,37 +29,37 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx_toggleprompt',
'sphinx_copybutton',
'sphinx.ext.autodoc', # Include documentation from docstrings
'sphinx.ext.doctest', # Test snippets in the documentation
'sphinx.ext.githubpages', # This extension creates .nojekyll file
'sphinx.ext.graphviz', # Add Graphviz graphs
'sphinx.ext.napoleon', # Support for NumPy and Google style docstrings
'sphinx.ext.todo', # Support for todo items
'sphinx.ext.viewcode', # Add links to highlighted source code
'myst_parser', # Parse .md files
"sphinx_toggleprompt",
"sphinx_copybutton",
"sphinx.ext.autodoc", # Include documentation from docstrings
"sphinx.ext.doctest", # Test snippets in the documentation
"sphinx.ext.githubpages", # This extension creates .nojekyll file
"sphinx.ext.graphviz", # Add Graphviz graphs
"sphinx.ext.napoleon", # Support for NumPy and Google style docstrings
"sphinx.ext.todo", # Support for todo items
"sphinx.ext.viewcode", # Add links to highlighted source code
"myst_parser", # Parse .md files
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# 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 = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]


# -- Options for Markdown support -------------------------------------------
Expand Down
Loading
Loading