-
Notifications
You must be signed in to change notification settings - Fork 3
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 #3 from KPrasch/dev
updates gh-actions, initial packaging, quality automation
- Loading branch information
Showing
17 changed files
with
4,560 additions
and
62 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[bumpversion] | ||
current_version = 0.1.0 | ||
commit = True | ||
tag = True | ||
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(-(?P<stage>[^.]*)\.(?P<devnum>\d+))? | ||
serialize = | ||
{major}.{minor}.{patch}-{stage}.{devnum} | ||
{major}.{minor}.{patch}-{stage} | ||
{major}.{minor}.{patch} | ||
|
||
[bumpversion:part:devnum] | ||
|
||
[bumpversion:file:pyproject.toml] |
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,21 @@ | ||
name: 🧹 Darker | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
darker-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.12' | ||
- uses: akaihola/[email protected] | ||
with: | ||
version: "1.7.2" |
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,31 +1,63 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
||
name: Tests | ||
name: '🔎 Python Tests' | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
concurrency: | ||
group: ci-tests-${{ github.ref }}-pytest | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
python-tests: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ "3.8", "3.12" ] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.12" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e .[test] | ||
- name: Test with pytest | ||
run: pytest | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
|
||
- id: setup_python | ||
name: Set up Python ${{ matrix.python-version }} Environment | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- id: python_cache | ||
name: Retrieve Cached Python Dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: ${{ runner.os }}-pip-${{ steps.setup_python.outputs.python-version }}-${{ hashFiles('dev-requirements.txt', 'requirements.txt') }} | ||
|
||
- name: Upgrade pip | ||
if: steps.python_cache.outputs.cache-hit != 'true' | ||
run: python -m pip install --upgrade pip | ||
|
||
- name: Install Dependencies | ||
run: pip install .[test] | ||
|
||
- name: Tests (Coverage) | ||
if: matrix.python-version == '3.12' | ||
run: | | ||
pip install coverage | ||
coverage run --data-file=data -m pytest tests | ||
coverage xml -i --data-file=data -o coverage.xml | ||
- name: Tests | ||
if: matrix.python-version != '3.12' | ||
run: pytest tests | ||
|
||
- name: Upload to Codecov | ||
if: matrix.python-version == '3.12' | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: coverage.xml | ||
fail_ci_if_error: false | ||
verbose: true |
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
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: 🧹 Lint with Ruff | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
ruff-lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install ruff | ||
pip install . | ||
- name: Lint with Ruff | ||
run: ruff --output-format=github atxm |
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,50 @@ | ||
# Install with: pre-commit install && pre-commit install -t pre-push | ||
repos: | ||
|
||
- repo: local | ||
hooks: | ||
|
||
- id: tests | ||
name: Run Tests | ||
entry: scripts/run_tests.sh | ||
language: system | ||
types: [python] | ||
stages: [push] | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.3.0 | ||
hooks: | ||
|
||
# Git | ||
- id: forbid-new-submodules | ||
|
||
# Files | ||
- id: check-byte-order-marker | ||
- id: check-executables-have-shebangs | ||
- id: check-added-large-files | ||
- id: check-symlinks | ||
- id: end-of-file-fixer | ||
|
||
# Syntax | ||
- id: check-yaml | ||
- id: check-toml | ||
- id: check-ast | ||
|
||
# Code | ||
- id: check-merge-conflict | ||
- id: debug-statements | ||
- id: detect-private-key | ||
|
||
- repo: https://github.com/akaihola/darker | ||
rev: 1.7.2 | ||
hooks: | ||
- id: darker | ||
args: ["--check"] | ||
stages: [push] | ||
- id: darker | ||
stages: [commit] | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: 'v0.1.4' | ||
hooks: | ||
- id: ruff |
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 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
web3 = "*" | ||
twisted = "*" | ||
eth-account = "<0.11,>=0.10.0" | ||
eth-typing = "<4,>=3.5.2" | ||
eth-utils = "<3,>=2.3.1" | ||
eth-abi = "<5,>=4.2.1" | ||
eth-keys = "<0.5,>=0.4.0" | ||
rlp = "<4,>=3.0.0" | ||
|
||
[dev-packages] | ||
# testing | ||
eth-ape = "*" | ||
pytest = "*" | ||
pytest-mock = "*" | ||
pytest-twisted = "*" | ||
# quality control | ||
pre-commit = "*" | ||
black = "*" | ||
ruff = "*" | ||
|
||
[requires] | ||
python_version = "3" |
Oops, something went wrong.