Skip to content

Commit

Permalink
Merge pull request #22 from quantmind/ls-bump
Browse files Browse the repository at this point in the history
Bump dependencies
  • Loading branch information
lsbardel authored Oct 19, 2024
2 parents 1c5c3bc + 1084dc2 commit 97f2fba
Show file tree
Hide file tree
Showing 14 changed files with 820 additions and 743 deletions.
File renamed without changes.
17 changes: 17 additions & 0 deletions .dev/lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -e

BLACK_ARG="--check"
RUFF_ARG=""

if [ "$1" = "fix" ] ; then
BLACK_ARG=""
RUFF_ARG="--fix"
fi

echo "run black"
black metablock tests ${BLACK_ARG}
echo "run ruff"
ruff check metablock tests ${RUFF_ARG}
echo "run mypy"
mypy metablock tests
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
env:
PYTHON_ENV: ci
METABLOCK_API_TOKEN: ${{ secrets.METABLOCK_API_TOKEN }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
strategy:
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand All @@ -31,11 +31,11 @@ jobs:
- name: run tests
run: make test
- name: upload coverage
if: matrix.python-version == '3.11'
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./build/coverage.xml
- name: release
if: ${{matrix.python-version == '3.11' && github.ref == 'refs/heads/main' && github.event.head_commit.message == 'release'}}
if: ${{matrix.python-version == '3.12' && github.ref == 'refs/heads/main' && github.event.head_commit.message == 'release'}}
run: make publish
24 changes: 12 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Minimal makefile for Sphinx documentation
#

.PHONY: help clean install lint mypy test test-lint publish

.PHONY: help
help:
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'

.PHONY: clean
clean: ## remove python cache files
find . -name '__pycache__' | xargs rm -rf
find . -name '*.pyc' -delete
Expand All @@ -16,27 +16,27 @@ clean: ## remove python cache files
rm -rf .mypy_cache
rm -rf .coverage


.PHONY: install
install: ## install packages with poetry
@./dev/install

@./.dev/install

.PHONY: lint
lint: ## run linters
poetry run ./dev/lint

poetry run ./.dev/lint fix

.PHONY: test
test: ## test with coverage
@poetry run \
pytest -v --cov --cov-report xml --cov-report html


.PHONY: test-lint
test-lint: ## run linters
poetry run ./dev/lint --check

poetry run ./.dev/lint

.PHONY: publish
publish: ## release to pypi and github tag
@poetry publish --build -u lsbardel -p $(PYPI_PASSWORD)

@poetry publish --build -u __token__ -p $(PYPI_TOKEN)

.PHONY: outdated
outdated: ## show outdated packages
poetry show -o -a
5 changes: 0 additions & 5 deletions dev/lint

This file was deleted.

1 change: 1 addition & 0 deletions metablock/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import click
import yaml

from metablock import Metablock

METABLOCK_SPACE = os.environ.get("METABLOCK_SPACE", "")
Expand Down
6 changes: 3 additions & 3 deletions metablock/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ async def _head(self, response: ClientResponse) -> bool:
raise MetablockResponseError(response)

async def _paginated(self, response: ClientResponse) -> Any:
next = response.links.get("next")
if isinstance(next, Mapping):
url = next.get("url")
next_ = response.links.get("next")
if isinstance(next_, Mapping):
url = next_.get("url")
else:
url = None
data = await self.cli.handle_response(response)
Expand Down
1,459 changes: 764 additions & 695 deletions poetry.lock

Large diffs are not rendered by default.

28 changes: 15 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
[tool.poetry]
name = "metablock"
version = "0.7.1"
version = "0.8.0"
description = "Metablock cloud python client"
authors = ["Luca <luca@quantmind.com>"]
license = "BSD"
readme = "readme.md"

[tool.poetry.dependencies]
python = ">=3.10,<3.12"
aiohttp = "^3.8.3"
click = "^8.1.3"
pyyaml = "^6.0"
python = ">=3.10"
aiohttp = "^3.10.10"
click = "^8.1.7"
pyyaml = "^6.0.2"

[tool.poetry.group.dev.dependencies]
pytest-asyncio = "^0.21.0"
pytest = "^7.0.1"
pytest-cov = "^4.0.0"
mypy = "^1.3.0"
black = "^23.3.0"
pytest-asyncio = "^0.24.0"
pytest = "^8.3.3"
pytest-cov = "^5.0.0"
mypy = "^1.12.0"
black = "^24.10.0"
isort = "^5.11.3"
flake8 = "^6.0.0"
flake8-builtins = "^2.0.1"
python-dotenv = "^1.0.0"
types-pyyaml = "^6.0.12.10"
types-pyyaml = "^6.0.12.20240917"
ruff = "^0.7.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand All @@ -38,6 +37,9 @@ testpaths = [
"tests"
]

[tool.ruff]
lint.select = ["A", "E", "W", "F", "I", "B", "N"]
line-length = 88

[tool.mypy]
disallow_untyped_calls = true
Expand Down
11 changes: 0 additions & 11 deletions setup.cfg

This file was deleted.

1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import asyncio

import pytest

from metablock import Metablock


Expand Down
1 change: 1 addition & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from click.testing import CliRunner

from metablock.cli import main


Expand Down
1 change: 1 addition & 0 deletions tests/test_client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from metablock import Metablock, MetablockResponseError


Expand Down
1 change: 1 addition & 0 deletions tests/test_spaces.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from metablock import Metablock, MetablockResponseError


Expand Down

0 comments on commit 97f2fba

Please sign in to comment.