mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-23 03:34:19 +01:00
FEAT: improve on workflows and makefile (#276)
* FEAT: improve on workflows and makefile * update to poetry 1.5.1 * caching needs newer python task quickfix
This commit is contained in:
36
.github/workflows/checks.yml
vendored
36
.github/workflows/checks.yml
vendored
@@ -1,10 +1,6 @@
|
||||
name: checks
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
formatting:
|
||||
@@ -12,41 +8,43 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.9"]
|
||||
poetry-version: ["1.3.1"]
|
||||
poetry-version: ["1.5.1"]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Set up Poetry ${{ matrix.poetry-version }}
|
||||
uses: abatilo/actions-poetry@v2
|
||||
with:
|
||||
poetry-version: ${{ matrix.poetry-version }}
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: "poetry"
|
||||
- name: Install packages
|
||||
run: poetry install --with dev
|
||||
run: poetry install
|
||||
- name: Check black
|
||||
run: poetry run black --check .
|
||||
run: make black-check
|
||||
- name: Check isort
|
||||
run: poetry run isort --profile black --check-only .
|
||||
run: make isort-check
|
||||
linting:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.9"]
|
||||
poetry-version: ["1.3.1"]
|
||||
poetry-version: ["1.5.1"]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Set up Poetry ${{ matrix.poetry-version }}
|
||||
uses: abatilo/actions-poetry@v2
|
||||
with:
|
||||
poetry-version: ${{ matrix.poetry-version }}
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: "poetry"
|
||||
- name: Install packages
|
||||
run: poetry install --with dev
|
||||
run: poetry install
|
||||
- name: Setup mypy
|
||||
run: yes | poetry run mypy cashu --install-types || true
|
||||
- name: Run mypy
|
||||
|
||||
19
.github/workflows/tests.yml
vendored
19
.github/workflows/tests.yml
vendored
@@ -9,32 +9,33 @@ jobs:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
python-version: ["3.9.13"]
|
||||
poetry-version: ["1.4.2"]
|
||||
poetry-version: ["1.5.1"]
|
||||
steps:
|
||||
- name: Checkout repository and submodules
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Set up Poetry ${{ matrix.poetry-version }}
|
||||
uses: abatilo/actions-poetry@v2
|
||||
with:
|
||||
poetry-version: ${{ matrix.poetry-version }}
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: "poetry"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
poetry install --with dev
|
||||
poetry install
|
||||
shell: bash
|
||||
- name: Run tests
|
||||
env:
|
||||
LIGHTNING: False
|
||||
LIGHTNING: false
|
||||
WALLET_NAME: test_wallet
|
||||
MINT_HOST: localhost
|
||||
MINT_PORT: 3337
|
||||
TOR: False
|
||||
TOR: false
|
||||
run: |
|
||||
poetry run pytest tests --cov-report xml --cov cashu
|
||||
make test
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
|
||||
10
Makefile
10
Makefile
@@ -1,9 +1,15 @@
|
||||
isort:
|
||||
poetry run isort --profile black . --skip cashu/nostr
|
||||
|
||||
isort-check:
|
||||
poetry run isort --profile black --check-only . --skip cashu/nostr
|
||||
|
||||
black:
|
||||
poetry run black . --exclude cashu/nostr
|
||||
|
||||
black-check:
|
||||
poetry run black --check . --exclude cashu/nostr
|
||||
|
||||
format:
|
||||
make isort
|
||||
make black
|
||||
@@ -24,7 +30,9 @@ package:
|
||||
python setup.py sdist bdist_wheel
|
||||
|
||||
test:
|
||||
pytest tests/
|
||||
LIGHTNING=false \
|
||||
TOR=false \
|
||||
poetry run pytest tests --cov-report xml --cov cashu
|
||||
|
||||
install:
|
||||
make clean
|
||||
|
||||
23
poetry.lock
generated
23
poetry.lock
generated
@@ -471,7 +471,7 @@ tests = ["dj-database-url", "dj-email-url", "django-cache-url", "pytest"]
|
||||
name = "exceptiongroup"
|
||||
version = "1.1.0"
|
||||
description = "Backport of PEP 654 (exception groups)"
|
||||
category = "main"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
@@ -599,7 +599,7 @@ testing = ["flake8 (<5)", "flufl.flake8", "importlib-resources (>=1.3)", "packag
|
||||
name = "iniconfig"
|
||||
version = "2.0.0"
|
||||
description = "brain-dead simple config-ini parsing"
|
||||
category = "main"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
@@ -783,7 +783,7 @@ test = ["appdirs (==1.4.4)", "covdefaults (>=2.2.2)", "pytest (>=7.2.1)", "pytes
|
||||
name = "pluggy"
|
||||
version = "1.0.0"
|
||||
description = "plugin and hook calling mechanisms for python"
|
||||
category = "main"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.6"
|
||||
files = [
|
||||
@@ -1002,18 +1002,17 @@ files = [
|
||||
|
||||
[[package]]
|
||||
name = "pytest"
|
||||
version = "7.2.2"
|
||||
version = "7.4.0"
|
||||
description = "pytest: simple powerful testing with Python"
|
||||
category = "main"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
{file = "pytest-7.2.2-py3-none-any.whl", hash = "sha256:130328f552dcfac0b1cec75c12e3f005619dc5f874f0a06e8ff7263f0ee6225e"},
|
||||
{file = "pytest-7.2.2.tar.gz", hash = "sha256:c99ab0c73aceb050f68929bc93af19ab6db0558791c6a0715723abe9d0ade9d4"},
|
||||
{file = "pytest-7.4.0-py3-none-any.whl", hash = "sha256:78bf16451a2eb8c7a2ea98e32dc119fd2aa758f1d5d66dbf0a59d69a3969df32"},
|
||||
{file = "pytest-7.4.0.tar.gz", hash = "sha256:b4bf8c45bd59934ed84001ad51e11b4ee40d40a1229d2c79f9c592b0a3f6bd8a"},
|
||||
]
|
||||
|
||||
[package.dependencies]
|
||||
attrs = ">=19.2.0"
|
||||
colorama = {version = "*", markers = "sys_platform == \"win32\""}
|
||||
exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""}
|
||||
importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""}
|
||||
@@ -1023,13 +1022,13 @@ pluggy = ">=0.12,<2.0"
|
||||
tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""}
|
||||
|
||||
[package.extras]
|
||||
testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "xmlschema"]
|
||||
testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"]
|
||||
|
||||
[[package]]
|
||||
name = "pytest-asyncio"
|
||||
version = "0.19.0"
|
||||
description = "Pytest support for asyncio"
|
||||
category = "main"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
@@ -1326,7 +1325,7 @@ full = ["itsdangerous", "jinja2", "python-multipart", "pyyaml", "requests"]
|
||||
name = "tomli"
|
||||
version = "2.0.1"
|
||||
description = "A lil' TOML parser"
|
||||
category = "main"
|
||||
category = "dev"
|
||||
optional = false
|
||||
python-versions = ">=3.7"
|
||||
files = [
|
||||
@@ -1486,4 +1485,4 @@ pgsql = ["psycopg2-binary"]
|
||||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = "^3.7"
|
||||
content-hash = "8ac516f63a6f6538a7cc1ed4b1db8a34b1fe1eaa174ae50b5979ce1ef42ec705"
|
||||
content-hash = "b33d82f1d4b58a39ab9fe6c887cf88a3246e9c99dc7bfe5df93923ad00d79814"
|
||||
|
||||
@@ -8,7 +8,6 @@ license = "MIT"
|
||||
[tool.poetry.dependencies]
|
||||
python = "^3.7"
|
||||
requests = "^2.27.1"
|
||||
pytest-asyncio = "^0.19.0"
|
||||
SQLAlchemy = "^1.3.24"
|
||||
click = "^8.0.4"
|
||||
pydantic = "^1.10.2"
|
||||
@@ -36,15 +35,13 @@ httpx = "0.23.0"
|
||||
[tool.poetry.extras]
|
||||
pgsql = ["psycopg2-binary"]
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
black = {version = "^22.8.0", allow-prereleases = true}
|
||||
isort = "^5.10.1"
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
mypy = "^0.971"
|
||||
black = {version = "^22.8.0", allow-prereleases = true}
|
||||
isort = "^5.10.1"
|
||||
pytest-asyncio = "^0.19.0"
|
||||
pytest-cov = "^4.0.0"
|
||||
pytest = "^7.4.0"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core>=1.0.0"]
|
||||
|
||||
Reference in New Issue
Block a user