summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-sentry-asgi.spec270
-rw-r--r--sources1
3 files changed, 272 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..d8e5e3d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/sentry-asgi-0.2.0.tar.gz
diff --git a/python-sentry-asgi.spec b/python-sentry-asgi.spec
new file mode 100644
index 0000000..a578f27
--- /dev/null
+++ b/python-sentry-asgi.spec
@@ -0,0 +1,270 @@
+%global _empty_manifest_terminate_build 0
+Name: python-sentry-asgi
+Version: 0.2.0
+Release: 1
+Summary: Sentry integration for ASGI frameworks.
+License: BSD
+URL: https://github.com/encode/sentry-asgi
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/2b/94/7ea097693d638359ed91bb981438e6a0b4a26668660101a62683779ced4b/sentry-asgi-0.2.0.tar.gz
+BuildArch: noarch
+
+
+%description
+# sentry-asgi
+
+<a href="https://travis-ci.org/encode/sentry-asgi">
+ <img src="https://travis-ci.org/encode/sentry-asgi.svg?branch=master" alt="Build Status">
+</a>
+<a href="https://codecov.io/gh/encode/sentry-asgi">
+ <img src="https://codecov.io/gh/encode/sentry-asgi/branch/master/graph/badge.svg" alt="Coverage">
+</a>
+<a href="https://pypi.org/project/sentry-asgi/">
+ <img src="https://badge.fury.io/py/sentry-asgi.svg" alt="Package version">
+</a>
+
+Sentry integration for ASGI frameworks.
+
+Installation:
+
+```shell
+pip install sentry-asgi
+```
+
+Usage:
+
+```python
+from sentry_asgi import SentryMiddleware
+import sentry_sdk
+
+
+sentry_sdk.init(dsn=...)
+
+app = ...
+app = SentryMiddleware(app)
+```
+
+Here's a more complete example, using Starlette:
+
+```python
+import sentry_sdk
+from sentry_asgi import SentryMiddleware
+
+sentry_sdk.init(dsn=...)
+
+app = Starlette()
+
+@app.route("/")
+def homepage(request):
+ raise ValueError("nope")
+
+app.add_middleware(SentryMiddleware)
+```
+
+## Notes
+
+### Python version support
+
+The Sentry SDK requires Python 3.7's `contextvars` support in order to properly
+tie messages and logging back to the request context that is added SentryMiddleware.
+
+On 3.6 and below the SentryMiddleware will capture and log application exceptions just fine,
+but will not properly tie in logging, messages, or breadcrumbs for any code that
+runs within a threadpool executor or subtask.
+
+ASGI frameworks should ensure that any thread pool executors [preserve the `contextvar` context](https://github.com/django/asgiref/issues/71).
+
+### Endpoint information
+
+It is recommended that frameworks populate an "endpoint" key in the ASGI scope,
+to indicate which view function or class should be logged by the middleware.
+
+%package -n python3-sentry-asgi
+Summary: Sentry integration for ASGI frameworks.
+Provides: python-sentry-asgi
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-sentry-asgi
+# sentry-asgi
+
+<a href="https://travis-ci.org/encode/sentry-asgi">
+ <img src="https://travis-ci.org/encode/sentry-asgi.svg?branch=master" alt="Build Status">
+</a>
+<a href="https://codecov.io/gh/encode/sentry-asgi">
+ <img src="https://codecov.io/gh/encode/sentry-asgi/branch/master/graph/badge.svg" alt="Coverage">
+</a>
+<a href="https://pypi.org/project/sentry-asgi/">
+ <img src="https://badge.fury.io/py/sentry-asgi.svg" alt="Package version">
+</a>
+
+Sentry integration for ASGI frameworks.
+
+Installation:
+
+```shell
+pip install sentry-asgi
+```
+
+Usage:
+
+```python
+from sentry_asgi import SentryMiddleware
+import sentry_sdk
+
+
+sentry_sdk.init(dsn=...)
+
+app = ...
+app = SentryMiddleware(app)
+```
+
+Here's a more complete example, using Starlette:
+
+```python
+import sentry_sdk
+from sentry_asgi import SentryMiddleware
+
+sentry_sdk.init(dsn=...)
+
+app = Starlette()
+
+@app.route("/")
+def homepage(request):
+ raise ValueError("nope")
+
+app.add_middleware(SentryMiddleware)
+```
+
+## Notes
+
+### Python version support
+
+The Sentry SDK requires Python 3.7's `contextvars` support in order to properly
+tie messages and logging back to the request context that is added SentryMiddleware.
+
+On 3.6 and below the SentryMiddleware will capture and log application exceptions just fine,
+but will not properly tie in logging, messages, or breadcrumbs for any code that
+runs within a threadpool executor or subtask.
+
+ASGI frameworks should ensure that any thread pool executors [preserve the `contextvar` context](https://github.com/django/asgiref/issues/71).
+
+### Endpoint information
+
+It is recommended that frameworks populate an "endpoint" key in the ASGI scope,
+to indicate which view function or class should be logged by the middleware.
+
+%package help
+Summary: Development documents and examples for sentry-asgi
+Provides: python3-sentry-asgi-doc
+%description help
+# sentry-asgi
+
+<a href="https://travis-ci.org/encode/sentry-asgi">
+ <img src="https://travis-ci.org/encode/sentry-asgi.svg?branch=master" alt="Build Status">
+</a>
+<a href="https://codecov.io/gh/encode/sentry-asgi">
+ <img src="https://codecov.io/gh/encode/sentry-asgi/branch/master/graph/badge.svg" alt="Coverage">
+</a>
+<a href="https://pypi.org/project/sentry-asgi/">
+ <img src="https://badge.fury.io/py/sentry-asgi.svg" alt="Package version">
+</a>
+
+Sentry integration for ASGI frameworks.
+
+Installation:
+
+```shell
+pip install sentry-asgi
+```
+
+Usage:
+
+```python
+from sentry_asgi import SentryMiddleware
+import sentry_sdk
+
+
+sentry_sdk.init(dsn=...)
+
+app = ...
+app = SentryMiddleware(app)
+```
+
+Here's a more complete example, using Starlette:
+
+```python
+import sentry_sdk
+from sentry_asgi import SentryMiddleware
+
+sentry_sdk.init(dsn=...)
+
+app = Starlette()
+
+@app.route("/")
+def homepage(request):
+ raise ValueError("nope")
+
+app.add_middleware(SentryMiddleware)
+```
+
+## Notes
+
+### Python version support
+
+The Sentry SDK requires Python 3.7's `contextvars` support in order to properly
+tie messages and logging back to the request context that is added SentryMiddleware.
+
+On 3.6 and below the SentryMiddleware will capture and log application exceptions just fine,
+but will not properly tie in logging, messages, or breadcrumbs for any code that
+runs within a threadpool executor or subtask.
+
+ASGI frameworks should ensure that any thread pool executors [preserve the `contextvar` context](https://github.com/django/asgiref/issues/71).
+
+### Endpoint information
+
+It is recommended that frameworks populate an "endpoint" key in the ASGI scope,
+to indicate which view function or class should be logged by the middleware.
+
+%prep
+%autosetup -n sentry-asgi-0.2.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-sentry-asgi -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Wed Apr 12 2023 Python_Bot <Python_Bot@openeuler.org> - 0.2.0-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..358c781
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+39379ace72a98b4cd3d1c910a17d9546 sentry-asgi-0.2.0.tar.gz