diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-04-10 14:48:52 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-04-10 14:48:52 +0000 |
| commit | 591a7714c8be63cc3983e23adc3b8ea25e2b0ac4 (patch) | |
| tree | 5f8edeba69c94882d46a94f305edb6b1f7223b7d | |
| parent | 13c37bcd105899c30c3ff56f173248a9d3992cc9 (diff) | |
automatic import of python-django-stubs-ext
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-django-stubs-ext.spec | 224 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 226 insertions, 0 deletions
@@ -0,0 +1 @@ +/django-stubs-ext-0.8.0.tar.gz diff --git a/python-django-stubs-ext.spec b/python-django-stubs-ext.spec new file mode 100644 index 0000000..fc9266d --- /dev/null +++ b/python-django-stubs-ext.spec @@ -0,0 +1,224 @@ +%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 + +[](https://travis-ci.com/typeddjango/django-stubs) +[](http://mypy-lang.org/) +[](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 <https://github.com/typeddjango/django-stubs> + +We have a Gitter chat here: <https://gitter.im/mypy-django/Lobby> +If you think you have a more generic typing issue, please refer to <https://github.com/python/mypy> 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 + +[](https://travis-ci.com/typeddjango/django-stubs) +[](http://mypy-lang.org/) +[](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 <https://github.com/typeddjango/django-stubs> + +We have a Gitter chat here: <https://gitter.im/mypy-django/Lobby> +If you think you have a more generic typing issue, please refer to <https://github.com/python/mypy> 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 + +[](https://travis-ci.com/typeddjango/django-stubs) +[](http://mypy-lang.org/) +[](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 <https://github.com/typeddjango/django-stubs> + +We have a Gitter chat here: <https://gitter.im/mypy-django/Lobby> +If you think you have a more generic typing issue, please refer to <https://github.com/python/mypy> 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 +* Mon Apr 10 2023 Python_Bot <Python_Bot@openeuler.org> - 0.8.0-1 +- Package Spec generated @@ -0,0 +1 @@ +50769c782a02be338ddf38889f675f53 django-stubs-ext-0.8.0.tar.gz |
