Skip to content

Commit aa9ceec

Browse files
committed
Merge remote-tracking branch 'origin/master' into ref/no-boxed
2 parents 5107340 + 7f25928 commit aa9ceec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+4178
-621
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ venv
2121
.hypothesis
2222
semaphore
2323
pip-wheel-metadata
24+
.mypy_cache

.travis.yml

+16-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
language: python
2-
sudo: false
32

43
python:
54
- "2.7"
@@ -8,6 +7,9 @@ python:
87
- "3.5"
98
- "3.6"
109

10+
env:
11+
- SENTRY_PYTHON_TEST_POSTGRES_USER=postgres SENTRY_PYTHON_TEST_POSTGRES_NAME=travis_ci_test
12+
1113
cache:
1214
pip: true
1315
cargo: true
@@ -18,13 +20,14 @@ branches:
1820
- /^release\/.+$/
1921

2022
matrix:
23+
allow_failures:
24+
- os: osx
25+
2126
include:
2227
- python: "3.7"
2328
dist: xenial
24-
sudo: true
2529
- python: "3.8-dev"
2630
dist: xenial
27-
sudo: true
2831

2932
- name: Linting
3033
python: "3.6"
@@ -51,15 +54,22 @@ matrix:
5154
- source $HOME/osx-py/bin/activate
5255
- export TRAVIS_PYTHON_VERSION=2.7
5356

57+
before_script:
58+
- psql -c 'create database travis_ci_test;' -U postgres
59+
- psql -c 'create database test_travis_ci_test;' -U postgres
60+
61+
services:
62+
- postgresql
63+
5464
install:
5565
- pip install tox
5666
- pip install codecov
57-
- sh scripts/download-semaphore.sh
67+
- bash scripts/download-semaphore.sh
5868

5969
script:
6070
- coverage erase
61-
- ./scripts/runtox.sh '' --cov=sentry_sdk --cov-append --cov-report= --cov-branch
62-
- codecov
71+
- ./scripts/runtox.sh '' --cov=sentry_sdk --cov-report= --cov-branch
72+
- codecov --file .coverage*
6373

6474
notifications:
6575
webhooks:

CHANGES.md

+104
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,107 @@
1+
## 0.7.15
2+
3+
* Add the always_run option in excepthook integration.
4+
5+
## 0.7.14
6+
7+
* Fix crash when using Celery integration (`TypeError` when using
8+
`apply_async`).
9+
10+
## 0.7.13
11+
12+
* Fix a bug where `Ignore` raised in a Celery task would be reported to Sentry.
13+
* Add experimental support for tracing PoC.
14+
15+
## 0.7.12
16+
17+
* Read from `X-Real-IP` for user IP address.
18+
* Fix a bug that would not apply in-app rules for attached callstacks.
19+
* It's now possible to disable automatic proxy support by passing
20+
`http_proxy=""`. Thanks Marco Neumann!
21+
22+
## 0.7.11
23+
24+
* Fix a bug that would send `errno` in an invalid format to the server.
25+
* Fix import-time crash when running Python with `-O` flag.
26+
* Fix a bug that would prevent the logging integration from attaching `extra`
27+
keys called `data`.
28+
* Fix order in which exception chains are reported to match Raven behavior.
29+
* New integration for the Falcon web framework. Thanks to Jacob Magnusson!
30+
31+
## 0.7.10
32+
33+
* Add more event trimming.
34+
* Log Sentry's response body in debug mode.
35+
* Fix a few bad typehints causing issues in IDEs.
36+
* Fix a bug in the Bottle integration that would report HTTP exceptions (e.g.
37+
redirects) as errors.
38+
* Fix a bug that would prevent use of `in_app_exclude` without
39+
setting `in_app_include`.
40+
* Fix a bug where request bodies of Django Rest Framework apps were not captured.
41+
* Suppress errors during SQL breadcrumb capturing in Django
42+
integration. Also change order in which formatting strategies
43+
are tried.
44+
45+
## 0.7.9
46+
47+
* New integration for the Bottle web framework. Thanks to Stepan Henek!
48+
* Self-protect against broken mapping implementations and other broken reprs
49+
instead of dropping all local vars from a stacktrace. Thanks to Marco
50+
Neumann!
51+
52+
## 0.7.8
53+
54+
* Add support for Sanic versions 18 and 19.
55+
* Fix a bug that causes an SDK crash when using composed SQL from psycopg2.
56+
57+
## 0.7.7
58+
59+
* Fix a bug that would not capture request bodies if they were empty JSON
60+
arrays, objects or strings.
61+
* New GNU backtrace integration parses stacktraces from exception messages and
62+
appends them to existing stacktrace.
63+
* Capture Tornado formdata.
64+
* Support Python 3.6 in Sanic and AIOHTTP integration.
65+
* Clear breadcrumbs before starting a new request.
66+
* Fix a bug in the Celery integration that would drop pending events during
67+
worker shutdown (particularly an issue when running with `max_tasks_per_child
68+
= 1`)
69+
* Fix a bug with `repr`ing locals whose `__repr__` simultaneously changes the
70+
WSGI environment or other data that we're also trying to serialize at the
71+
same time.
72+
73+
## 0.7.6
74+
75+
* Fix a bug where artificial frames for Django templates would not be marked as
76+
in-app and would always appear as the innermost frame. Implement a heuristic
77+
to show template frame closer to `render` or `parse` invocation.
78+
79+
## 0.7.5
80+
81+
* Fix bug into Tornado integration that would send broken cookies to the server.
82+
* Fix a bug in the logging integration that would ignore the client
83+
option `with_locals`.
84+
85+
## 0.7.4
86+
87+
* Read release and environment from process environment like the Raven SDK
88+
does. The keys are called `SENTRY_RELEASE` and `SENTRY_ENVIRONMENT`.
89+
* Fix a bug in the `serverless` integration where it would not push a new scope
90+
for each function call (leaking tags and other things across calls).
91+
* Experimental support for type hints.
92+
93+
## 0.7.3
94+
95+
* Fix crash in AIOHTTP integration when integration was set up but disabled.
96+
* Flask integration now adds usernames, email addresses based on the protocol
97+
Flask-User defines on top of Flask-Login.
98+
* New threading integration catches exceptions from crashing threads.
99+
* New method `flush` on hubs and clients. New global `flush` function.
100+
* Add decorator for serverless functions to fix common problems in those
101+
environments.
102+
* Fix a bug in the logging integration where using explicit handlers required
103+
enabling the integration.
104+
1105
## 0.7.2
2106

3107
* Fix `celery.exceptions.Retry` spamming in Celery integration.

CONTRIBUTING.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# How to contribute to the Sentry Python SDK
2+
3+
`sentry-sdk` is an ordinary Python package. You can install it with `pip
4+
install -e .` into some virtualenv, edit the sourcecode and test out your
5+
changes manually.
6+
7+
## Running tests and linters
8+
9+
Make sure you have `virtualenv` installed, and the Python versions you care
10+
about. You should have Python 2.7 and the latest Python 3 installed.
11+
12+
You don't need to `workon` or `activate` anything, the `Makefile` will create
13+
one for you. Run `make` or `make help` to list commands.
14+
15+
## Releasing a new version
16+
17+
We use [craft](https://github.com/getsentry/craft#python-package-index-pypi) to
18+
release new versions. You need credentials for the `getsentry` PyPI user, and
19+
must have `twine` installed globally.
20+
21+
The usual release process goes like this:
22+
23+
1. Go through git log and write new entry into `CHANGELOG.md`, commit to master
24+
2. `craft p a.b.c`
25+
3. `craft pp a.b.c`

Makefile

+42-24
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,70 @@
11
SHELL = /bin/bash
22

3-
dist:
3+
VENV_PATH = .venv
4+
5+
help:
6+
@echo "Thanks for your interest in the Sentry Python SDK!"
7+
@echo
8+
@echo "make lint: Run linters"
9+
@echo "make test: Run basic tests (not testing most integrations)"
10+
@echo "make test-all: Run ALL tests (slow, closest to CI)"
11+
@echo "make format: Run code formatters (destructive)"
12+
@echo
13+
@echo "Also make sure to read ./CONTRIBUTING.md"
14+
@false
15+
16+
.venv:
17+
virtualenv $(VENV_PATH)
18+
$(VENV_PATH)/bin/pip install tox
19+
20+
dist: .venv
421
rm -rf dist build
5-
python setup.py sdist bdist_wheel
22+
$(VENV_PATH)/bin/python setup.py sdist bdist_wheel
623

724
.PHONY: dist
825

9-
.venv:
10-
@virtualenv .venv
26+
format: .venv
27+
$(VENV_PATH)/bin/tox -e linters --notest
28+
.tox/linters/bin/black .
29+
.PHONY: format
1130

1231
test: .venv
13-
@pip install -r test-requirements.txt
14-
@pip install --editable .
15-
@pytest tests
32+
@$(VENV_PATH)/bin/tox -e py2.7,py3.7
1633
.PHONY: test
1734

18-
format:
19-
@black sentry_sdk tests
20-
.PHONY: format
35+
test-all: .venv
36+
@TOXPATH=$(VENV_PATH)/bin/tox sh ./scripts/runtox.sh
37+
.PHONY: test-all
38+
39+
check: lint test
40+
.PHONY: check
2141

22-
tox-test:
23-
@sh ./scripts/runtox.sh
24-
.PHONY: tox-test
42+
lint: .venv
43+
@set -e && $(VENV_PATH)/bin/tox -e linters || ( \
44+
echo "================================"; \
45+
echo "Bad formatting? Run: make format"; \
46+
echo "================================"; \
47+
false)
2548

26-
lint:
27-
@tox -e linters
2849
.PHONY: lint
2950

30-
apidocs:
31-
@pip install pdoc pygments
32-
@pdoc --overwrite --html --html-dir build/apidocs sentry_sdk
51+
apidocs: .venv
52+
@$(VENV_PATH)/bin/pip install --editable .
53+
@$(VENV_PATH)/bin/pip install pdoc==0.3.2 pygments
54+
@$(VENV_PATH)/bin/pdoc --overwrite --html --html-dir build/apidocs sentry_sdk
3355
.PHONY: apidocs
3456

3557
install-zeus-cli:
3658
npm install -g @zeus-ci/cli
3759
.PHONY: install-zeus-cli
3860

39-
travis-upload-docs:
40-
@pip install --editable .
41-
$(MAKE) apidocs
61+
travis-upload-docs: apidocs install-zeus-cli
4262
cd build/apidocs && zip -r gh-pages ./sentry_sdk
43-
$(MAKE) install-zeus-cli
4463
zeus upload -t "application/zip+docs" build/apidocs/gh-pages.zip \
4564
|| [[ ! "$(TRAVIS_BRANCH)" =~ ^release/ ]]
4665
.PHONY: travis-upload-docs
4766

48-
travis-upload-dist: dist
49-
$(MAKE) install-zeus-cli
67+
travis-upload-dist: dist install-zeus-cli
5068
zeus upload -t "application/zip+wheel" dist/* \
5169
|| [[ ! "$(TRAVIS_BRANCH)" =~ ^release/ ]]
5270
.PHONY: travis-upload-dist

README.md

+28-2
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,35 @@
77
# sentry-python - Sentry SDK for Python
88

99
[![Build Status](https://travis-ci.com/getsentry/sentry-python.svg?branch=master)](https://travis-ci.com/getsentry/sentry-python)
10+
[![PyPi page link -- version](https://img.shields.io/pypi/v/sentry-sdk.svg)](https://pypi.python.org/pypi/sentry-sdk)
1011

11-
- [Documentation](https://docs.sentry.io/quickstart/?platform=python)
12-
- [API Reference](https://getsentry.github.io/sentry-python/)
12+
This is the next line of the Python SDK for [Sentry](http://sentry.io/), intended to replace the `raven` package on PyPI.
13+
14+
```python
15+
from sentry_sdk import init, capture_message
16+
17+
init("mydsn@sentry.io/123")
18+
19+
capture_message("Hello World") # Will create an event.
20+
21+
raise ValueError() # Will also create an event.
22+
```
23+
24+
To learn more about how to use the SDK:
25+
26+
- [Getting started with the new SDK](https://docs.sentry.io/quickstart/?platform=python)
27+
- [Configuration options](https://docs.sentry.io/error-reporting/configuration/?platform=python)
28+
- [Setting context (tags, user, extra information)](https://docs.sentry.io/enriching-error-data/context/?platform=python)
29+
- [Integrations](https://docs.sentry.io/platforms/python/)
30+
31+
Are you coming from raven-python?
32+
33+
- [Cheatsheet: Migrating to the new SDK from Raven](https://forum.sentry.io/t/switching-to-sentry-python/4733)
34+
35+
To learn about internals:
36+
37+
- [API Reference (using pdoc)](https://getsentry.github.io/sentry-python/)
38+
- [API Reference (using sphinx)](https://www.pydoc.io/search/?package=sentry-sdk)
1339

1440
# License
1541

0 commit comments

Comments
 (0)