Skip to content

Commit

Permalink
OpShin Demo using Orcfax Datum
Browse files Browse the repository at this point in the history
Co-authored-by: george-orcfax <135040020+george-orcfax@users.noreply.github.com>
Co-authored-by: Christian-MK <105018870+Christian-MK@users.noreply.github.com>
  • Loading branch information
3 people committed Nov 21, 2023
0 parents commit bf36417
Show file tree
Hide file tree
Showing 35 changed files with 2,534 additions and 0 deletions.
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
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.idea
.transactions
.wallet
build
__pycache__
venv

# PyCardano.
*.signed
2 changes: 2 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Configurtion file for Markdown lint. Add exceptions here.
default: true
45 changes: 45 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
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.1.3
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
- 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"
]
54 changes: 54 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Pylint configuration.
#
# .pylintrc guide: https://github.com/PyCQA/pylint/blob/cfc393a8dff9ec09bd2fcb25857e772ae04a4991/examples/pylintrc
#
# Notes:
#
# - Values are comma separated.
# - Place each exception on a newline.
# - Include a comma after each new entry.
# - Optionally, a comment for the value if additional context is needed,
# e.g. disabled warnings, where normally warnings are our guide.
#

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

ignore=
LICENSE,
.pylintrc,

ignore-patterns=
^(.+).ini$,
.gitignore,
.pre-commit-config.yaml,
^(.+).md$,
^(.+).sh$,
^(.+).service$,
contract.py,
transaction.py,
.markdownlint,
.ruff,
Makefile,
.editorconfig,
.codespellrc,


ignore-paths=
.git/.,
requirements/.,
.github/,
tests/fixtures/vcrpy/.,
.vscode/.,

[MESSAGES CONTROL]

disable =
C0301, # line-length too long, see Black documented recommendations.
W3101, # requests library, missing timeout, new on upgrade from 2.14 to 2.15
# Project specific.
R0801, # similar lines in multiple files.
C0103, # Upper-case naming for constants.
# To fix.
E0611, # No <name> in <module>, nb. there is, pylint is wrestling with it.
50 changes: 50 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
select = ["E", "F"]
ignore = [
# line-length; particularly as black covers this. Primarily impacts code snippets.
"E501",
]

# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"]
unfixable = []

# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
"contract.py",
"transaction.py",
]

# Same as Black.
line-length = 88

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

# Assume Python 3.10.
target-version = "py310"

[mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
56 changes: 56 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"editor.insertSpaces": true,
"editor.tabSize": 4,
"editor.rulers": [
79
],
"editor.detectIndentation": false,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"python.linting.mypyEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.lintOnSave": true,
"git.inputValidationSubjectLength": 50,
"git.inputValidationLength": 72,
"[git-commit]": {
"editor.rulers": [
50,
72
]
},
"[python]": {
"editor.rulers": [
72,
79,
120
],
"editor.formatOnSave": true,
"editor.defaultFormatter": "ms-python.black-formatter"
},
"[go]": {
"editor.rulers": [
72,
79
]
},
"[markdown]": {
"editor.rulers": [80]
},
"files.eol": "\n",
"cSpell.words": [
"cardano",
"cexplorer",
"hexlify",
"OGMIOS",
"opshin",
"pkey",
"preprod",
"pycardano",
"undeployed",
"utxo",
"utxos",
"wlts",
"workdir"
]
}
Loading

0 comments on commit bf36417

Please sign in to comment.