Skip to content

Commit b5fe22b

Browse files
authored
Merge pull request #494 from rollbar/added/typehints
Added initial typehints
2 parents c01b721 + 982f9c4 commit b5fe22b

43 files changed

Lines changed: 738 additions & 586 deletions

Some content is hidden

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

.github/workflows/ci.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
python-version: [3.9, '3.10', 3.11, 3.12, 3.13, 3.14]
15+
python-version: ['3.10', 3.11, 3.12, 3.13, 3.14]
1616
framework:
1717
- NONE
1818
- FLASK_VERSION=2.3.3
@@ -23,12 +23,6 @@ jobs:
2323
- PYRAMID_VERSION=2.0.2
2424
- FASTAPI_VERSION=0.115.1 httpx==0.27.2 python-multipart==0.0.12
2525
- FASTAPI_VERSION=0.118.3 httpx==0.28.1 python-multipart==0.0.20
26-
exclude:
27-
# Test frameworks on the python versions they support, according to pypi registry
28-
29-
# Django
30-
- framework: DJANGO_VERSION=5.2.7
31-
python-version: 3.9
3226

3327
steps:
3428
- uses: actions/checkout@v2
@@ -73,3 +67,28 @@ jobs:
7367

7468
- name: Run tests
7569
run: pytest
70+
71+
types:
72+
runs-on: ubuntu-latest
73+
strategy:
74+
matrix:
75+
python-version: ['3.10', 3.11, 3.12, 3.13, 3.14]
76+
77+
steps:
78+
- uses: actions/checkout@v2
79+
with:
80+
submodules: recursive
81+
82+
- name: Setup Python
83+
uses: actions/setup-python@v4
84+
with:
85+
python-version: ${{ matrix.python-version }}
86+
87+
- name: Install Dependencies
88+
run: |
89+
pip install --group test .
90+
pip install --group type .
91+
92+
93+
- name: Check Types
94+
run: mypy

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Python notifier for reporting exceptions, errors, and log messages to [Rollbar](
2424

2525
| PyRollbar Version | Python Version Compatibility | Support Level |
2626
|-------------------|-----------------------------------------------|---------------------|
27-
| 1.4.0 | 3.9, 3.10, 3.11, 3.12, 3.13, 3.14 | Full |
27+
| 1.4.0 | 3.10, 3.11, 3.12, 3.13, 3.14 | Full |
2828
| 0.16.3 | 2.7, 3.4, 3.5, 3.6, 3.7. 3.8, 3.9, 3.10, 3.11 | Security Fixes Only |
2929

3030
#### Support Level Definitions

pyproject.toml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ maintainers = [{name = "Rollbar, Inc.", email = "support@rollbar.com"}]
1212
classifiers = [
1313
"Programming Language :: Python",
1414
"Programming Language :: Python :: 3",
15-
"Programming Language :: Python :: 3.9",
1615
"Programming Language :: Python :: 3.10",
1716
"Programming Language :: Python :: 3.11",
1817
"Programming Language :: Python :: 3.12",
@@ -39,19 +38,37 @@ classifiers = [
3938
"Topic :: System :: Logging",
4039
"Topic :: System :: Monitoring",
4140
]
42-
requires-python = ">=3.9"
41+
requires-python = ">=3.10"
4342
dependencies = [
4443
"requests>=0.12.1",
44+
"typing_extensions; python_version < \"3.11\""
4545
]
4646

4747
[dependency-groups]
4848
test = [
4949
"blinker",
5050
"httpx",
51+
"packaging",
5152
"pytest",
53+
"python-multipart",
5254
"webob",
5355
]
5456

57+
type = [
58+
"bottle",
59+
"djangorestframework-stubs[compatible-mypy]",
60+
"django-stubs",
61+
"fastapi",
62+
"mypy ~= 1.20.2",
63+
"pyramid",
64+
"quart",
65+
"sanic",
66+
"starlette",
67+
"tornado",
68+
"twisted",
69+
"uvicorn",
70+
]
71+
5572
[project.urls]
5673
Homepage = "https://rollbar.com/"
5774
Documentation = "https://docs.rollbar.com/docs/python"
@@ -64,6 +81,9 @@ rollbar = "rollbar.cli:main"
6481
[project.entry-points."paste.filter_app_factory"]
6582
pyramid = "rollbar.contrib.pyramid:create_rollbar_middleware"
6683

84+
[tool.mypy]
85+
packages = ["rollbar"]
86+
6787
[tool.pytest]
6888
testpaths = [
6989
"rollbar/test",
@@ -72,6 +92,9 @@ testpaths = [
7292
[tool.setuptools.dynamic]
7393
version = {attr = "rollbar.__version__"}
7494

95+
[tool.setuptools.package-data]
96+
rollbar = ["py.typed"]
97+
7598
[tool.tox]
7699
requires = ["tox>=4.22"]
77100

0 commit comments

Comments
 (0)