Skip to content

Commit e59151a

Browse files
authored
Release 0.4.1 (#25)
# Why This pull request releases the backtrace-python library. In order to create a valid release, I'm also updating the package description that will be visible in pypi: https://pypi.org/project/backtracepython/#description
1 parent eb05a6e commit e59151a

File tree

6 files changed

+50
-15
lines changed

6 files changed

+50
-15
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Version 0.4.1
2+
3+
- Added support for annotations in the client API (#23),
4+
- Dropped environment variable as a default annotation (#23),
5+
- Added an exit_timeout parameter, that allows to wait until events are processed before exit (#24).
6+
17
# Version 0.4.0
28

39
- Changed a submission flow - from spawning and sending data from a process to background thread(#19).

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2016 Backtrace I/O, Inc.
1+
Copyright (c) 2024 Backtrace I/O, Inc.
22

33
Permission is hereby granted, free of charge, to any person obtaining
44
a copy of this software and associated documentation files (the "Software"),

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include README.md

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,21 @@
44

55
## Documentation
66

7-
https://support.backtrace.io/hc/en-us/articles/360040105992-Python-Integration-Guide
7+
https://docs.saucelabs.com/error-reporting/language-integrations/python/
88

99
## Installation
1010

1111
### Requirements
1212

1313
This module supports Python 2, Python 3, and PyPy.
1414

15-
```
15+
```bash
1616
python -m pip install backtracepython
1717
```
1818

1919
## Basic Usage
2020

21-
```python
21+
```bash
2222
import backtracepython as bt
2323
bt.initialize(
2424
    endpoint="https://submit.backtrace.io/{universe}/{token}/json"
@@ -57,47 +57,48 @@ except:
5757
- context_line_count  - Defaults to 200 . When an error is reported, this many lines above and below each stack function are included in the report.
5858
- tab_width  - Defaults to 8.  If there are any hard tabs in the source code, it is unclear how many spaces they should be indented to correctly display the source code. Therefore the error report can override this number to specify how many spaces a hard tab should be represented by when viewing source code.
5959
- collect_source_code - Default to True. By default Backtrace client collects corresponded source code and send it with the report. If set to False, the source code will not be collected.
60+
- exit_timeout - Default to 4. Backtrace sends data asynchronously in the background thread. The exit_timeout describes how many time the thread has to finish working before application exit.
6061

6162
### bt.BacktraceReport
6263

6364
Create a report object that you can later choose whether or not to send. This may be useful to track something like a request.
6465

65-
`report.set_attribute(key, value) `
66+
`report.set_attribute(key, value)`
6667
Adds an attribute to a specific report. Valid types for value are str, float, int, and bool.
6768
Attributes are indexed and searchable. See also `addAnnotation`
6869

6970
`report.set_dict_attributes(dict)`
7071

7172
Adds all key-value pairs of dict into the report recursively.
7273

73-
`report.get_attributes() `
74+
`report.get_attributes()`
7475

7576
Returns all report attributes.
7677

77-
`report.set_annotation(key, value) `
78+
`report.set_annotation(key, value)`
7879

7980
Adds an annotation to a specific report. Annotations, unlike attributes, are not indexed and searchable. However, they are available for inspection when you view a specific report.
8081

8182
key - String which is the name of the annotation.
8283
value - Any type which is JSON-serializable.
8384

84-
`report.set_dict_annotations(dict) `
85+
`report.set_dict_annotations(dict)`
8586

8687
Adds all key-value pairs of dict into the report.
8788

88-
`report.add_attachment(attachment_path) `
89+
`report.add_attachment(attachment_path)`
8990

9091
Adds an attachment to the report.
9192

92-
`report.get_attachments() `
93+
`report.get_attachments()`
9394

9495
Returns a list of attachment paths.
9596

9697
`report.set_exception(ExceptionType, exception, traceback)`
9798

9899
error  is an Error object. Backtrace will extract information from this object such as the error message and stack trace and send this information along with the report.
99100

100-
`report.capture_last_exception() `
101+
`report.capture_last_exception()`
101102

102103
This is the same as report.set_exception(\*sys.exc_info())
103104

@@ -118,7 +119,7 @@ Sends the error report to the endpoint specified in initialize.
118119

119120
To run the test suite:
120121

121-
```
122+
```bash
122123
pytest
123124
```
124125

@@ -135,7 +136,7 @@ test suite with all of them:
135136
2. Update version number in backtracepython module.
136137
3. Tag the version in git.
137138

138-
```
139+
```bash
139140
python3 setup.py bdist_wheel --universal
140141
twine upload dist/*
141142
```

backtracepython/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class version:
22
major = 0
33
minor = 4
4-
patch = 0
4+
patch = 1
55

66

77
version_string = "{}.{}.{}".format(version.major, version.minor, version.patch)

setup.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,50 @@
11
#!/usr/bin/env python
22

3+
import os
4+
35
from setuptools import find_packages, setup
46

7+
current_directory = os.path.abspath(os.path.dirname(__file__))
8+
with open(os.path.join(current_directory, "README.md"), encoding="utf-8") as f:
9+
long_description = f.read()
10+
11+
512
setup(
613
name="backtracepython",
7-
version="0.4.0",
14+
version="0.4.1",
815
description="Backtrace.io error reporting tool for Python",
916
author="Backtrace.io",
1017
author_email="[email protected]",
1118
packages=find_packages(),
19+
long_description=long_description,
20+
long_description_content_type="text/markdown",
21+
include_package_data=True,
22+
license="MIT",
1223
test_suite="tests",
1324
url="https://github.com/backtrace-labs/backtrace-python",
1425
install_requires=["six", "simplejson", "requests"],
1526
extras_require={
1627
"test": ["pytest"],
1728
},
29+
project_urls={
30+
"Homepage": "https://backtrace.io",
31+
"Source": "https://github.com/backtrace-labs/backtrace-python",
32+
"Changelog": "https://github.com/backtrace-labs/backtrace-python/blob/master/CHANGELOG.md",
33+
"Documentation": "https://docs.saucelabs.com/error-reporting/language-integrations/python/",
34+
},
1835
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4",
1936
classifiers=[
37+
"Intended Audience :: Developers",
38+
"Intended Audience :: System Administrators",
39+
"License :: OSI Approved :: MIT License",
40+
"Operating System :: OS Independent",
41+
"Topic :: Software Development :: Libraries :: Python Modules",
42+
"Topic :: Software Development :: Bug Tracking",
43+
"Topic :: System :: Monitoring",
44+
"Environment :: Console",
45+
"Environment :: Web Environment",
2046
"Programming Language :: Python :: 2.7",
47+
"Programming Language :: Python :: 3",
2148
"Programming Language :: Python :: 3.7",
2249
"Programming Language :: Python :: 3.8",
2350
"Programming Language :: Python :: 3.9",

0 commit comments

Comments
 (0)