Находки в опенсорсе: Python

Находки в опенсорсе: Python

@opensource_findings_python

Легкие задачки в опенсорсе из мира PythonЧат: @opensource_findings_chat

979подписчиков
Несколько раз в неделю🇬🇧

Похожие каналы

Все →

Последние посты

🚀 New issue to wemake-services/django-modern-rest by @sobolevn📝 Test `Valkey` support (#980)Currently we only test redis as the database for SyncRedis and AsyncRedis throttling backends. We also need to test Valkey, because we claim to support it.#good_first_issue #help_wanted #ci #django_modern_restsent via relator

26 апр. 2026 г.663В Telegram

🚀 New issue to ag2ai/faststream by @BrikozO📝 Bug: (#2842)#bug #good_first_issue #faststream #ag2aisent via relator

24 апр. 2026 г.722В Telegram

🚀 New issue to wemake-services/django-modern-rest by @Peopl3s📝 TagSchema and RoleSchema do not enforce max_length, causing unhandled DB errors (#944)What's wrong?The Tag and Role Django models define name = CharField(max_length=100), but the corresponding Pydantic schemas accept any-length strings.class TagSchema(pydantic.BaseModel): name: str <!-----------------------------HERE class RoleSchema(pydantic.BaseModel): name: str <!-----------------------------HEREWhen a client sends a name longer than 100 characters, Pydantic validation passes (HTTP 422 is never raised), and the value reaches the database layer where PostgreSQL raises DataError: value too long for type character varying(100). This results in an unhandled 500 instead of a proper 422 validation error. On SQLite the value is silently stored without truncation, masking the bug in tests.How it should be?Add max_length constraints to match the model definition: class TagSchema(pydantic.BaseModel): name: str = Field(max_length=100) class RoleSchema(pydantic.BaseModel): name: str = Field(max_length=100)Used versions0.7.0OS informationMacOS#bug #good_first_issue #help_wanted #django_modern_restsent v

21 апр. 2026 г.912В Telegram

🚀 New issue to wemake-services/django-modern-rest by @sobolevn📝 Add `RefreshTokenSyncController` and `RefreshTokenAsyncController` (#907)Add RefreshTokenSyncController and RefreshTokenAsyncControllerBasically, they should accept refresh_token and return new pairs of access_token and refresh_token. But they should be reusable as well as the existing controllers.It should be similar to the existing views:django-modern-rest/dmr/security/jwt/views.pyLines 99 to 132 in dba07e8Example from a real project: https://github.com/Griger10/g-pulse/blob/3d520b8444736eaaeffad1cf2221019f3ffad6c4/services/api/apps/accounts/api/views.py#L93#feature #good_first_issue #help_wanted #django_modern_restsent via relator

15 апр. 2026 г.723В Telegram

🚀 New issue to wemake-services/django-modern-rest by @sobolevn📝 Optimize `dmr_rf` and `dmr_client` test features for faster tests (#889)We provide our own fixtures that are subclasses of Django's builtin one.Django has this code inside: https://github.com/django/django/blob/7dc826b9758d634623a6f5ca05d0ca2048a0ce48/django/test/client.py#L450-L458 def _encode_json(self, data, content_type): """ Return encoded JSON if data is a dict, list, or tuple and content_type is application/json. """ should_encode = JSON_CONTENT_TYPE_RE.match(content_type) and isinstance( data, (dict, list, tuple) ) return json.dumps(data, cls=self.json_encoder) if should_encode else dataWe need to optimize this method, because json.dumps is slow, but msgspec is fast.It won't be noticable on 1 tests, but will be on 2k tests (which is the case for our own test base).See how we conditionally dump our schema here: https://github.com/wemake-services/django-modern-rest/blob/master/dmr/openapi/dump.pyMaybe we should reuse the same for tests?#good_first_issue #help_wanted #django_modern_restsent via relator

13 апр. 2026 г.691В Telegram

🚀 New issue to ag2ai/faststream by @ce1ebrimbor📝 Feature: Support broker-level ack_policy default with per-subscriber override (#2826)ProblemCurrently ack_policy can only be set per-subscriber:@broker.subscriber("orders.topic", ack_policy=AckPolicy.NACK_ON_ERROR)async def handle_order(msg: OrderMessage) -> None: ...There is no way to set a default ack_policy at the broker (or router) level. In practice, most services want the same policy across all subscribers — typically NACK_ON_ERROR for at-least-once delivery with DLQ. This forces every @broker.subscriber() call to repeat the same ack_policy= argument, which is error-prone: forgetting it on a single subscriber silently falls back to ACK_FIRST (at-most-once), which can cause silent message loss.Proposed solutionAdd an ack_policy parameter to KafkaBroker (and equivalently to RabbitBroker, NatsBroker, etc.) that sets the default for all subscribers registered on that broker. Individual subscribers can still override it.broker = KafkaBroker("localhost:9092", ack_policy=AckPolicy.NACK_ON_ERROR)# Inherits NACK_ON_ERROR from broker@broker.subscriber("orders.topic")async def handle_order(msg: OrderMessage) -> None: ...# Overrides to ACK for this specific subscriber@broker.subscriber("notifications.topic", ack_policy=AckPolicy.ACK)async def handle_notification(msg: NotificationMessage) -> None: ...The resolution order would be: subscriber-level > broker-level > built-in default (ACK_FIRST).Why this matters• Safety: ACK_FIRST as a silent default is dangerous for services that use DLQ or need at-least-once delivery. A broker-level default lets teams enforce their delivery guarantee in one place.• DRY: Services with 10+ subscribers shouldn't need to repeat ack_policy=AckPolicy.NACK_ON_ERROR on every one.• Consistency with other broker-level settings: decoder, middlewares, security, and logger are all broker-level defaults that subscribers inherit. ack_policy is the notable exception.#enhancement #good_first_issue

10 апр. 2026 г.590В Telegram

🚀 New issue to wemake-services/django-modern-rest by @LesPrimus📝 UnsolvableAnnotationsError when subclassing a concrete Controller subclass` (#873)What's wrong?Bug: UnsolvableAnnotationsError when subclassing a concrete Controller subclassDescriptionWhen creating an intermediate concrete controller class and then subclassing it,__init_subclass__ raises UnsolvableAnnotationsError even though the serializeris already resolved on the parent.Reproductionfrom dmr import Controllerfrom dmr.plugins.pydantic import PydanticSerializerfrom dmr.serializer import BaseSerializer class BaseController[T: BaseSerializer](Controller[T]): pass class PydanticController(BaseController[PydanticSerializer]): pass# This raises UnsolvableAnnotationsErrorclass UserController(PydanticController): def get(self) -> ...: ... Error dmr.exceptions.UnsolvableAnnotationsError: Type args () are not correct for <class 'UserController'>,at least 1 type arg must be providedExpected behaviorUserController should inherit the serializer from its concrete parent PydanticController, which already has serializer = PydanticSerializer set.--Thanks for the awesome library, I just started exploring it and I'm really enjoying it so far!--### How it should be?Subclassing a concrete `Contro

10 апр. 2026 г.466В Telegram

🚀 New issue to wemake-services/django-modern-rest by @sobolevn📝 Add a Django command to export OpenAPI schemas (#858)It migth be useful to people who want to share the schema. Or automate something with it.I propose to add a django command: dmr_export_schema.Args:• Where to find schema, I think we should reuse import_string logic from Django. Required• All json formatting ones: sort_keys and indent• Format: json or yaml, check that yaml is installed. Default is jsonWe should print it to the stdout always. Usages:# regular:python manage.py dmr_export_schema server.urls:schema# pretty:python manage.py dmr_export_schema server.urls:schema --format json --indent=2 --sort-keysThis would need tests, we can test it as a subprocess, it is a django command after all.And docs.#enhancement #good_first_issue #help_wanted #django_modern_restsent via relator

8 апр. 2026 г.525В Telegram

🚀 New issue to wemake-services/django-modern-rest by @sobolevn📝 Support `orjson` as a possible backend for `JsonParser` / `JsonRenderer` (#857)Currently we always use json as a module in JsonParser and JsonRenderer:django-modern-rest/dmr/parsers.pyLines 132 to 134 in 69822ffBut, we can make this module customizable. We can pass orjson module there, since it also has a similar API.Something like:class JsonParser(Parser): __slots__ = ('_json_module', ...) def __init__(self, json_module: _JsonModule = json, ...) -> None: self._json_module = json_moduleAnd later self._json_module.loads(...)This would need multiple test cases: install orjson as unit-test dependency and add unit tests for this new renderer / parser.And we can document that with an example in the integrations.rst docs.#enhancement #good_first_issue #help_wanted #django_modern_restsent via relator

8 апр. 2026 г.518В Telegram

🚀 New issue to wemake-services/django-modern-rest by @sobolevn📝 Add docs and example about `django-health-check` integration (#831)One can use https://github.com/codingjoe/django-health-check for health checks.No special integration from our side is required.This information can be added here: https://github.com/wemake-services/django-modern-rest/blob/master/docs/pages/integrations.rst#documentation #enhancement #good_first_issue #help_wanted #django_modern_restsent via relator

6 апр. 2026 г.574В Telegram