Skip to content

Commit

Permalink
exported names per module, improved typing, refactored GitHub actions (
Browse files Browse the repository at this point in the history
…#82)

* updated actions to use Node.js 16
* moved number_theory out of ecc submodule
* move block(header) out of tx submodule
* moved test_num_theory
  • Loading branch information
fametrano committed Jan 4, 2023
1 parent 1134957 commit eabd66a
Show file tree
Hide file tree
Showing 137 changed files with 1,492 additions and 1,080 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/experimental.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/markdown-links.yml
@@ -0,0 +1,14 @@
name: Markdown - Check links

on: [push, pull_request]

jobs:
check-md-links:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Check Markdown links
uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: yes
17 changes: 17 additions & 0 deletions .github/workflows/markdown-lint.yml
@@ -0,0 +1,17 @@
name: Markdown - Check linted code

on: [push, pull_request]

jobs:
check-md-linted:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run Markdown Lint
uses: DavidAnson/markdownlint-cli2-action@v8
with:
command: config
globs: |
.markdownlint.json
**/*.md
33 changes: 33 additions & 0 deletions .github/workflows/python-lint.yml
@@ -0,0 +1,33 @@
name: Python - Check linted code

on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev

jobs:
check-py-linted:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Check isort and black
run: |
python -m pip install -U pip
python -m pip install -U isort
isort -c .
python -m pip install -U black
black --check .
- name: Run tox -e lint
run: |
python -m pip install tox
tox -e lint
@@ -1,4 +1,4 @@
name: Test
name: Python - Test and coverage

on:
push:
Expand All @@ -11,42 +11,41 @@ on:
- dev

jobs:
test:
test-cov-py:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install requirements
- name: Run tox -e py
run: |
python -m pip install -U -r requirements-dev.txt
python -m pip install -U -r requirements.txt
python -m pip install coveralls
- name: Run Tox
# Run tox using the version of Python in `PATH`
run: tox -e py
python -m pip install tox
tox -e py
- name: Coveralls
run: coveralls --service=github
run: |
python -m pip install coveralls
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.python }}-${{ matrix.os }}
COVERALLS_PARALLEL: true

finish:
coveralls-py:
if: "github.repository == 'btclib-org/btclib' && github.base_ref == 'master'"
needs: test
needs: test-cov-py
runs-on: ubuntu-latest
steps:
- name: Upload to coveralls.io
run: |
pip install coveralls
python -m pip install coveralls
coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/python-test_on_py-dev.yml
@@ -0,0 +1,31 @@
name: Python - Test on py312-dev

on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev

jobs:
test-py312-dev:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# as of 2023-01-01 windows-latest does crash
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.12-dev
- name: Run tox -e py
run: |
python -m pip install tox
tox -e py
3 changes: 3 additions & 0 deletions .markdownlint.json
@@ -0,0 +1,3 @@
{
"MD007": { "indent": 4 }
}
31 changes: 31 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,31 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 5.11.2
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
name: black
args: [--diff, --check]
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.11
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
name: flake8
- repo: https://github.com/sourcery-ai/sourcery
rev: v1.0.2
hooks:
- id: sourcery
name: sourcery
# The best way to use Sourcery in a pre-commit hook:
# * review only changed lines:
# * omit the summary
args: [--diff=git diff HEAD, --no-summary]
67 changes: 67 additions & 0 deletions .sourcery.yaml
@@ -0,0 +1,67 @@
# 🪄 This is your project's Sourcery configuration file.

# You can use it to get Sourcery working in the way you want, such as
# ignoring specific refactorings, skipping directories in your project,
# or writing custom rules.

# 📚 For a complete reference to this file, see the documentation at
# https://docs.sourcery.ai/Configuration/Project-Settings/

# This file was auto-generated by Sourcery on 2023-01-01 at 13:20.

version: "1" # The schema version of this config file

ignore: # A list of paths or files which Sourcery will ignore.
- .git
- venv
- .venv
- env
- .env
- .tox

rule_settings:
enable:
- default
disable: [] # A list of rule IDs Sourcery will never suggest.
rule_types:
- refactoring
- suggestion
- comment
python_version: "3.7" # A string specifying the lowest Python version your project supports. Sourcery will not suggest refactorings requiring a higher Python version.

# rules: # A list of custom rules Sourcery will include in its analysis.
# - id: no-print-statements
# description: Do not use print statements in the test directory.
# pattern: print(...)
# replacement:
# condition:
# explanation:
# paths:
# include:
# - test
# exclude:
# - conftest.py
# tests: []
# tags: []

# rule_tags: {} # Additional rule tags.

# metrics:
# quality_threshold: 25.0

# github:
# labels: []
# ignore_labels:
# - sourcery-ignore
# request_review: author
# sourcery_branch: sourcery/{base_branch}

# clone_detection:
# min_lines: 3
# min_duplicates: 2
# identical_clones_only: false

# proxy:
# url:
# ssl_certs_file:
# no_ssl_verify: false

0 comments on commit eabd66a

Please sign in to comment.