Находки в опенсорсе: Python
950 subscribers
4 photos
138 links
Легкие задачки в опенсорсе из мира Python

Чат: @opensource_findings_chat
Download Telegram
🚀 New issue to wemake-services/django-modern-rest by @sobolevn
📝 Figure out why sphinx does not link HttpResponse as a return type (#153)

See https://github.com/wemake-services/django-modern-rest/blob/7aa23316219d4226d7c49435f9b028130f8c5dbc/docs/conf.py#L98-L99

When make -C docs clean html is generated without this line, sphinx produces:

django-modern-rest/django_modern_rest/errors.py:docstring of django_modern_rest.errors.global_error_handler:1: WARNING: py:class reference target not found: django.http.response.HttpResponse [ref.class]
django-modern-rest/django_modern_rest/endpoint.py:docstring of django_modern_rest.endpoint.Endpoint.__call__:1: WARNING: py:class reference target not found: django.http.response.HttpResponse [ref.class]
django-modern-rest/django_modern_rest/endpoint.py:docstring of django_modern_rest.endpoint.Endpoint.handle_async_error:1: WARNING: py:class reference target not found: django.http.response.HttpResponse [ref.class]
django-modern-rest/django_modern_rest/endpoint.py:docstring of django_modern_rest.endpoint.Endpoint.handle_error:1: WARNING: py:class reference target not found: django.http.response.HttpResponse [ref.class]


This does not seem right, because everything is configure: intersphinx, imports, etc.

• Links in the form of inline :class: roles are rendered correctly

<img width="721" height="115" alt="Image" src="https://github.com/user-attachments/assets/91a0e5ee-90de-4e04-ae52-58514cc275f4" />

• The link in the annotations is not generated

<img width="737" height="377" alt="Image" src="https://github.com/user-attachments/assets/9ab218c1-0153-45f4-836f-e2d2eaaec92b" />

#documentation #helpwanted #goodfirst_issue

sent via relator
1
🚀 New issue to wemake-services/django-modern-rest by @sobolevn
📝 Change how ResponseValidator is selected (#229)

There's a room for potential optimization of how ResponseValidator is selected.

How it works now:

https://github.com/wemake-services/django-modern-rest/blob/c6071d9907c72a54258bc7f644822e91640559d4/djangomodernrest/endpoint.py#L304-L323

We can remove this if isinstance from the hot path to the import time.
We would need to select proper ResponseValidator type for the response during metadata build in endpoint.py

https://github.com/wemake-services/django-modern-rest/blob/c6071d9907c72a54258bc7f644822e91640559d4/djangomodernrest/endpoint.py#L97-L109

We would need to types:

• one for validating HttpResponses

• one for raw responses

#enhancement #helpwanted #goodfirst_issue

sent via relator