%global _empty_manifest_terminate_build 0 Name: python-django-stubs-ext Version: 0.8.0 Release: 1 Summary: Monkey-patching and extensions for django-stubs License: MIT URL: https://github.com/typeddjango/django-stubs Source0: https://mirrors.nju.edu.cn/pypi/web/packages/de/27/518a5c6326d4444a4d59d8a6ff50ec131ab67da7460c645745d13d2c168f/django-stubs-ext-0.8.0.tar.gz BuildArch: noarch Requires: python3-django Requires: python3-typing-extensions %description # Extensions and monkey-patching for django-stubs [![Build Status](https://travis-ci.com/typeddjango/django-stubs.svg?branch=master)](https://travis-ci.com/typeddjango/django-stubs) [![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/) [![Gitter](https://badges.gitter.im/mypy-django/Lobby.svg)](https://gitter.im/mypy-django/Lobby) This package contains extensions and monkey-patching functions for the [django-stubs](https://github.com/typeddjango/django-stubs) package. Certain features of django-stubs (i.e. generic django classes that don't define the `__class_getitem__` method) require runtime monkey-patching, which can't be done with type stubs. These extensions were split into a separate package so library consumers don't need `mypy` as a runtime dependency ([#526](https://github.com/typeddjango/django-stubs/pull/526#pullrequestreview-525798031)). ## Installation ```bash pip install django-stubs-ext ``` ## Usage In your Django application, use the following code: ```py import django_stubs_ext django_stubs_ext.monkeypatch() ``` This only needs to be called once, so the call to `monkeypatch` should be placed in your top-level settings. Real-life example [can be found here](https://github.com/wemake-services/wemake-django-template/blob/5bf1569e2710e11befc6991893f94419136d74bd/%7B%7Bcookiecutter.project_name%7D%7D/server/settings/__init__.py#L14-L19). ## Version compatibility Since django-stubs supports multiple Django versions, this package takes care to only monkey-patch the features needed by your django version, and decides which features to patch at runtime. This is completely safe, as (currently) we only add a `__class_getitem__` method that does nothing: ```py @classmethod def __class_getitem__(cls, *args, **kwargs): return cls ``` ## To get help For help with django-stubs, please view the main repository at We have a Gitter chat here: If you think you have a more generic typing issue, please refer to and their Gitter. ## Contributing The django-stubs-ext package is part of the [django-stubs](https://github.com/typeddjango/django-stubs) monorepo. If you would like to contribute, please view the django-stubs [contribution guide](https://github.com/typeddjango/django-stubs/blob/master/CONTRIBUTING.md). You can always also reach out in gitter to discuss your contributions! %package -n python3-django-stubs-ext Summary: Monkey-patching and extensions for django-stubs Provides: python-django-stubs-ext BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-django-stubs-ext # Extensions and monkey-patching for django-stubs [![Build Status](https://travis-ci.com/typeddjango/django-stubs.svg?branch=master)](https://travis-ci.com/typeddjango/django-stubs) [![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/) [![Gitter](https://badges.gitter.im/mypy-django/Lobby.svg)](https://gitter.im/mypy-django/Lobby) This package contains extensions and monkey-patching functions for the [django-stubs](https://github.com/typeddjango/django-stubs) package. Certain features of django-stubs (i.e. generic django classes that don't define the `__class_getitem__` method) require runtime monkey-patching, which can't be done with type stubs. These extensions were split into a separate package so library consumers don't need `mypy` as a runtime dependency ([#526](https://github.com/typeddjango/django-stubs/pull/526#pullrequestreview-525798031)). ## Installation ```bash pip install django-stubs-ext ``` ## Usage In your Django application, use the following code: ```py import django_stubs_ext django_stubs_ext.monkeypatch() ``` This only needs to be called once, so the call to `monkeypatch` should be placed in your top-level settings. Real-life example [can be found here](https://github.com/wemake-services/wemake-django-template/blob/5bf1569e2710e11befc6991893f94419136d74bd/%7B%7Bcookiecutter.project_name%7D%7D/server/settings/__init__.py#L14-L19). ## Version compatibility Since django-stubs supports multiple Django versions, this package takes care to only monkey-patch the features needed by your django version, and decides which features to patch at runtime. This is completely safe, as (currently) we only add a `__class_getitem__` method that does nothing: ```py @classmethod def __class_getitem__(cls, *args, **kwargs): return cls ``` ## To get help For help with django-stubs, please view the main repository at We have a Gitter chat here: If you think you have a more generic typing issue, please refer to and their Gitter. ## Contributing The django-stubs-ext package is part of the [django-stubs](https://github.com/typeddjango/django-stubs) monorepo. If you would like to contribute, please view the django-stubs [contribution guide](https://github.com/typeddjango/django-stubs/blob/master/CONTRIBUTING.md). You can always also reach out in gitter to discuss your contributions! %package help Summary: Development documents and examples for django-stubs-ext Provides: python3-django-stubs-ext-doc %description help # Extensions and monkey-patching for django-stubs [![Build Status](https://travis-ci.com/typeddjango/django-stubs.svg?branch=master)](https://travis-ci.com/typeddjango/django-stubs) [![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/) [![Gitter](https://badges.gitter.im/mypy-django/Lobby.svg)](https://gitter.im/mypy-django/Lobby) This package contains extensions and monkey-patching functions for the [django-stubs](https://github.com/typeddjango/django-stubs) package. Certain features of django-stubs (i.e. generic django classes that don't define the `__class_getitem__` method) require runtime monkey-patching, which can't be done with type stubs. These extensions were split into a separate package so library consumers don't need `mypy` as a runtime dependency ([#526](https://github.com/typeddjango/django-stubs/pull/526#pullrequestreview-525798031)). ## Installation ```bash pip install django-stubs-ext ``` ## Usage In your Django application, use the following code: ```py import django_stubs_ext django_stubs_ext.monkeypatch() ``` This only needs to be called once, so the call to `monkeypatch` should be placed in your top-level settings. Real-life example [can be found here](https://github.com/wemake-services/wemake-django-template/blob/5bf1569e2710e11befc6991893f94419136d74bd/%7B%7Bcookiecutter.project_name%7D%7D/server/settings/__init__.py#L14-L19). ## Version compatibility Since django-stubs supports multiple Django versions, this package takes care to only monkey-patch the features needed by your django version, and decides which features to patch at runtime. This is completely safe, as (currently) we only add a `__class_getitem__` method that does nothing: ```py @classmethod def __class_getitem__(cls, *args, **kwargs): return cls ``` ## To get help For help with django-stubs, please view the main repository at We have a Gitter chat here: If you think you have a more generic typing issue, please refer to and their Gitter. ## Contributing The django-stubs-ext package is part of the [django-stubs](https://github.com/typeddjango/django-stubs) monorepo. If you would like to contribute, please view the django-stubs [contribution guide](https://github.com/typeddjango/django-stubs/blob/master/CONTRIBUTING.md). You can always also reach out in gitter to discuss your contributions! %prep %autosetup -n django-stubs-ext-0.8.0 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-django-stubs-ext -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Fri Apr 21 2023 Python_Bot - 0.8.0-1 - Package Spec generated