Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.6.11 #293

Merged
merged 4 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.6.10
current_version = 0.6.11
commit = True
tag = True
message = 🔖 Bump version: {current_version} → {new_version}
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.10
0.6.11
2 changes: 1 addition & 1 deletion ftmq/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from ftmq.query import Query

__version__ = "0.6.10"
__version__ = "0.6.11"
__all__ = ["Query"]
6 changes: 2 additions & 4 deletions ftmq/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import logging

import click
import orjson
from anystore.io import smart_write
Expand All @@ -8,7 +6,7 @@

from ftmq.aggregate import aggregate
from ftmq.io import apply_datasets, smart_read_proxies, smart_write_proxies
from ftmq.logging import get_logger
from ftmq.logging import configure_logging, get_logger
from ftmq.model.coverage import Collector
from ftmq.model.dataset import Catalog, Dataset
from ftmq.query import Query
Expand All @@ -20,7 +18,7 @@

@click.group(cls=DefaultGroup, default="q", default_if_no_args=True)
def cli() -> None:
logging.basicConfig(level=logging.INFO)
configure_logging()


@cli.command(
Expand Down
10 changes: 6 additions & 4 deletions ftmq/logging.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import logging
import os
import sys
from logging import Filter, LogRecord
from typing import Any, Dict, List

import structlog
from banal import as_bool
from structlog.contextvars import merge_contextvars
from structlog.dev import ConsoleRenderer, set_exc_info
from structlog.processors import (
Expand All @@ -21,8 +23,8 @@
)
from structlog.stdlib import get_logger as get_raw_logger

LOG_JSON = False
LOG_LEVEL = logging.INFO
LOG_JSON = as_bool(os.environ.get("LOG_JSON"))
LOG_LEVEL = os.environ.get("LOG_LEVEL", "info").upper()


def get_logger(name: str, *args, **kwargs) -> BoundLogger:
Expand Down Expand Up @@ -72,8 +74,8 @@ def configure_logging(level: int = logging.INFO) -> None:
logger_factory=LoggerFactory(),
)

# handler for low level logs that should be sent to STDOUT
out_handler = logging.StreamHandler(sys.stdout)
# handler for low level logs that should be sent to STDERR
out_handler = logging.StreamHandler(sys.stderr)
out_handler.setLevel(level)
out_handler.addFilter(_MaxLevelFilter(logging.WARNING))
out_handler.setFormatter(formatter)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@investigativedata/ftmq",
"version": "0.6.10",
"version": "0.6.11",
"description": "javascript interface for ftmq",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
9 changes: 5 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ftmq"
version = "0.6.10"
version = "0.6.11"
description = "followthemoney query dsl and io helpers"
authors = ["Simon Wörpel <[email protected]>"]
license = "MIT"
Expand Down Expand Up @@ -40,7 +40,7 @@ alephclient = "^2.4.1"
pycountry = ">=23.12.11,<25.0.0"
urllib3 = "<3"
nomenklatura = "^3.12.5"
anystore = "^0.1.7"
anystore = "^0.1.8"
pantomime = "^0.6.1"
structlog = "^24.4.0"

Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ alephclient==2.4.1 ; python_version >= "3.11" and python_version < "4" \
annotated-types==0.7.0 ; python_version >= "3.11" and python_version < "4" \
--hash=sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53 \
--hash=sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89
anystore==0.1.7 ; python_version >= "3.11" and python_version < "4" \
--hash=sha256:42fc5724e3aecfabc8a487ada0502162aad72a3a7be1d55b97b3b2bc7c364865 \
--hash=sha256:a5468a40f359d518e584f8b491ff3e5bdcdfdb27876508af89d1b1012d2f54c8
anystore==0.1.8 ; python_version >= "3.11" and python_version < "4" \
--hash=sha256:418735305d24ef2351dadf80e8c4f96833736c0761aebe93664e6e336219510c \
--hash=sha256:a4c794e06fb19192f9ab3755b516bbb96209c0f7970664cf58ef78c53c4ba2d3
asttokens==2.4.1 ; python_version >= "3.11" and python_version < "4" \
--hash=sha256:051ed49c3dcae8913ea7cd08e46a606dba30b79993209636c4875bc1d637bc24 \
--hash=sha256:b03869718ba9a6eb027e134bfdf69f38a236d681c83c160d510768af11254ba0
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,11 @@ def test_cli_generate(fixtures_path: Path):
# dataset
uri = str(fixtures_path / "dataset.yml")
res = runner.invoke(cli, ["dataset", "generate", "-i", uri])
res = orjson.loads(res.output)
res = orjson.loads(res.stdout.split("\n")[-1]) # FIXME logging
assert Dataset(**res)

# catalog
uri = str(fixtures_path / "catalog.yml")
res = runner.invoke(cli, ["catalog", "generate", "-i", uri])
res = orjson.loads(res.output)
res = orjson.loads(res.stdout.split("\n")[-1]) # FIXME logging
assert Catalog(**res)