Skip to content

Commit

Permalink
Simple sign CLI and interfaces
Browse files Browse the repository at this point in the history
Simple signing functionality for the command line and library
functions.

Additional dotfiles missing from the template repo are also
added.
  • Loading branch information
ross-spencer committed Apr 16, 2024
1 parent d24a3fc commit c631616
Show file tree
Hide file tree
Showing 23 changed files with 768 additions and 134 deletions.
3 changes: 3 additions & 0 deletions .codespellignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore patterns for the codespell pre-commmit hook.

cips
9 changes: 9 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[codespell]
skip =
*.po,
*.ts,
tests/*
count =
quiet-level = 3
ignore-words-list =
placeholder
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# EditorConfig: https://EditorConfig.org. Provides sensible defaults for
# non vscode editors.

# top-most EditorConfig file
root = true

# Every file.
[*]
charset = "utf8"
end_of_line = lf
insert_final_newline = true

indent_style = space
indent_size = 4

trim_trailing_whitespace = true

# Python. (Duplicates used as placeholders)
[*.py]
indent_style = space
indent_size = 4
26 changes: 26 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: "linting - all"
on:
pull_request:
push:
branches:
- "main"
jobs:
lint:
name: "linting (python)"
runs-on: "ubuntu-latest"
steps:
- name: "Check out repository"
uses: "actions/checkout@v2"
- name: "Set up Python"
uses: "actions/setup-python@v2"
with:
python-version: "3.10"
- name: "install linting tooling"
continue-on-error: true
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements/local.txt ; pylint **/*.py
- name: "run linting via tox"
run: |
tox -e linting
64 changes: 64 additions & 0 deletions .github/workflows/unit-tests-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
name: "unit tests - all"
on:
pull_request:
push:
branches:
- "main"
jobs:
tox:
name: "Python ${{ matrix.python-version }} -- ${{ matrix.os }} "
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10"]
experimental: [false]
# Include experimental or bleeding-edge releases.
# Windows is not included as it can be unreliable, e.g.
# psycopg2-binary is only released some time after a Python
# major/minor version is formally released.
#
# Uncomment below (including 'include:') when the next
# reasonable test candidate is made available:
include:
#
# Versions list: https://github.com/actions/python-versions/releases
# Example formatting: 3.11.0-alpha.1, 3.9.0-beta.8, 3.10.0-rc.3
#
- os: ubuntu-latest
python-version: "3.11.0"
experimental: true
- os: macos-latest
python-version: "3.11.0"
experimental: true
steps:
- name: "check out repository"
uses: "actions/checkout@v2"
with:
submodules: 'true'
- name: "set up python ${{ matrix.python-version }}"
uses: "actions/setup-python@v2"
with:
python-version: "${{ matrix.python-version }}"
- name: "get pip cache dir"
id: "pip-cache"
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: "cache pip packages"
uses: "actions/cache@v2"
with:
path: "${{ steps.pip-cache.outputs.dir }}"
key: "${{ runner.os }}-pip-${{ hashFiles('**/base.txt', '**/local.txt') }}"
restore-keys: |
${{ runner.os }}-pip-
- name: "install tox"
run: |
python -m pip install --upgrade pip
pip install tox
- name: "run tox"
env:
TOXENV: py3
run: |
tox
141 changes: 141 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# project specific files
__init__.py
log.py

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
tar-src/

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# cardano pieces
*.skey
*.vkey
*signed.json
*.addr
*.cbor
5 changes: 5 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Configurtion file for Markdown lint. Add exceptions here.
default: true

# Exceptions, example given, MD045
# MD012: false # no multiple blank-lines.
46 changes: 46 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: check-json
- id: check-toml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-case-conflict
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
language_version: python3
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.270
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.35.0
hooks:
- id: markdownlint
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
args: [-I, .codespellignore]
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: python
language_version: python3
args:
[
"-rn", # Only display messages.
"-sn", # Don't display the pylint score.
"--rcfile=.pylintrc"
]
37 changes: 37 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Pylint configuration.
#
# .pylintrc guide: https://github.com/PyCQA/pylint/blob/cfc393a8dff9ec09bd2fcb25857e772ae04a4991/examples/pylintrc
#

[MAIN]
extension-pkg-whitelist=
pydantic, # binary module validation, Pydantic/Pylint recommendation.

ignore=
LICENSE,
.pylintrc,

ignore-patterns=
^(.+).ini$,
^(.+).md$,
^(.+).sh$,
^(.+).service$,
^(.+).json,
^(.+).yml,
^(.+).yaml,
^(.+).toml,
^(.+).html,
^(.+).htm,
^(.+).svg,
^\.,

ignore-paths=
requirements/.,
tests/fixtures/vcrpy/.,
Makefile,

[MESSAGES CONTROL]

disable =
C0301, # line-length too long, see Black documented recommendations.
C0115, # No docstring for Class.
Loading

0 comments on commit c631616

Please sign in to comment.