Skip to content

Commit 4dfcef8

Browse files
committed
Updated CI and packaging configuration and removed typeguard dependency
1 parent c42cfa6 commit 4dfcef8

File tree

8 files changed

+42
-45
lines changed

8 files changed

+42
-45
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,14 @@ jobs:
1212
publish:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v3
1616
- name: Set up Python
17-
uses: actions/setup-python@v2
17+
uses: actions/setup-python@v4
1818
with:
1919
python-version: 3.x
2020
- name: Install dependencies
2121
run: pip install build
2222
- name: Create packages
23-
run: python -m build -s -w .
23+
run: python -m build
2424
- name: Upload packages
25-
uses: pypa/gh-action-pypi-publish@master
26-
with:
27-
user: __token__
28-
password: ${{ secrets.pypi_password }}
25+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/test.yml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,32 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
os: [ubuntu-latest]
14-
python-version: ["3.7", "3.10", "3.11-dev", "pypy-3.8"]
14+
python-version: ["3.7", "3.10", "3.11", "3.12", "pypy-3.9"]
1515
runs-on: ${{ matrix.os }}
1616
steps:
17-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1818
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v4
2020
with:
2121
python-version: ${{ matrix.python-version }}
22-
- uses: actions/cache@v2
23-
with:
24-
path: ~/.cache/pip
25-
key: pip-test-${{ matrix.python-version }}-${{ matrix.os }}
22+
allow-prereleases: true
23+
cache: pip
24+
cache-dependency-path: pyproject.toml
2625
- name: Install dependencies
27-
run: pip install .[test,sentry,raygun] coveralls
26+
run: pip install -e .[test,sentry,raygun] coveralls
2827
- name: Test with pytest
2928
run: coverage run -m pytest
3029
- name: Upload Coverage
31-
run: coveralls --service=github
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34-
COVERALLS_FLAG_NAME: ${{ matrix.test-name }}
35-
COVERALLS_PARALLEL: true
30+
uses: coverallsapp/github-action@v2
31+
with:
32+
parallel: true
3633

3734
coveralls:
3835
name: Finish Coveralls
3936
needs: test
4037
runs-on: ubuntu-latest
41-
container: python:3-slim
4238
steps:
4339
- name: Finished
44-
run: |
45-
pip install coveralls
46-
coveralls --service=github --finish
47-
env:
48-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
uses: coverallsapp/github-action@v2
41+
with:
42+
parallel-finished: true

.readthedocs.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
version: 2
2-
formats: [htmlzip, pdf]
2+
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.8"
7+
8+
sphinx:
9+
configuration: docs/conf.py
10+
311
python:
4-
version: "3.8"
512
install:
613
- method: pip
714
path: .

docs/versionhistory.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ Version history
33

44
This library adheres to `Semantic Versioning 2.0 <http://semver.org/>`_.
55

6+
**UNRELEASED**
7+
8+
- Removed explicit run-time argument type checks and the ``typeguard`` dependency
9+
610
**2.0.0** (2022-03-29)
711

812
- **BACKWARDS INCOMPATIBLE** Switched Sentry reporter to use sentry-sdk instead of raven

pyproject.toml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
[build-system]
22
requires = [
3-
"setuptools >= 61",
4-
"wheel >= 0.29.0",
5-
"setuptools_scm[toml] >= 3.4"
3+
"setuptools >= 64",
4+
"setuptools_scm >= 6.4"
65
]
76
build-backend = "setuptools.build_meta"
87

@@ -17,17 +16,19 @@ classifiers = [
1716
"Intended Audience :: Developers",
1817
"License :: OSI Approved :: Apache Software License",
1918
"Topic :: Software Development :: Libraries :: Application Frameworks",
19+
"Typing :: Typed",
2020
"Programming Language :: Python",
2121
"Programming Language :: Python :: 3 :: Only",
2222
"Programming Language :: Python :: 3.7",
2323
"Programming Language :: Python :: 3.8",
2424
"Programming Language :: Python :: 3.9",
2525
"Programming Language :: Python :: 3.10",
2626
"Programming Language :: Python :: 3.11",
27+
"Programming Language :: Python :: 3.12",
2728
]
29+
requires-python = ">=3.7"
2830
dependencies = [
2931
"asphalt ~= 4.6",
30-
"typeguard ~= 2.0",
3132
]
3233
dynamic = ["version"]
3334

@@ -36,11 +37,13 @@ Homepage = "https://github.com/asphalt-framework/asphalt-exceptions"
3637

3738
[project.optional-dependencies]
3839
test = [
40+
"asphalt-exceptions[sentry,raygun]",
3941
"pytest",
4042
"pytest-asyncio",
4143
"pytest-cov",
4244
]
4345
doc = [
46+
"asphalt-exceptions[sentry,raygun]",
4447
"Sphinx >= 1.5",
4548
"sphinx_rtd_theme",
4649
"sphinx-autodoc-typehints >= 1.2.0",
@@ -93,19 +96,15 @@ show_missing = true
9396
[tool.tox]
9497
legacy_tox_ini = """
9598
[tox]
96-
envlist = py37, py38, py39, py310, py311, pypy3
99+
envlist = py37, py38, py39, py310, py311, py312, pypy3
97100
skip_missing_interpreters = true
98-
isolated_build = true
101+
minversion = 4.4.3
99102
100103
[testenv]
101104
extras = test
102-
sentry
103-
raygun
104105
commands = python -m pytest {posargs}
105106
106107
[testenv:docs]
107108
extras = doc
108-
sentry
109-
raygun
110109
commands = sphinx-build docs build/sphinx
111110
"""

setup.cfg

Whitespace-only changes.

src/asphalt/exceptions/component.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

33
import logging
4-
from asyncio import AbstractEventLoop
4+
from asyncio import AbstractEventLoop, get_running_loop
55
from functools import partial
66
from typing import Any, AsyncIterator
77

@@ -13,7 +13,6 @@
1313
merge_config,
1414
qualified_name,
1515
)
16-
from typeguard import check_argument_types
1716

1817
from asphalt.exceptions import report_exception
1918
from asphalt.exceptions.api import ExceptionReporter
@@ -66,7 +65,6 @@ def __init__(
6665
install_default_handler: bool = True,
6766
**default_args,
6867
) -> None:
69-
check_argument_types()
7068
self.install_default_handler = install_default_handler
7169
if not reporters:
7270
reporters = {"default": default_args}
@@ -91,10 +89,10 @@ async def start(self, ctx: Context) -> AsyncIterator[None]:
9189

9290
if self.install_default_handler:
9391
handler = partial(default_exception_handler, ctx=ctx)
94-
ctx.loop.set_exception_handler(handler)
92+
get_running_loop().set_exception_handler(handler)
9593
logger.info("Installed default event loop exception handler")
9694

9795
yield
9896

99-
ctx.loop.set_exception_handler(None)
97+
get_running_loop().set_exception_handler(None)
10098
logger.info("Uninstalled default event loop exception handler")

src/asphalt/exceptions/reporters/sentry.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import sentry_sdk
77
from asphalt.core import Context, resolve_reference
88
from sentry_sdk.integrations import Integration
9-
from typeguard import check_argument_types
109

1110
from asphalt.exceptions.api import ExceptionReporter
1211

@@ -43,7 +42,6 @@ class SentryExceptionReporter(ExceptionReporter):
4342
def __init__(
4443
self, integrations: Sequence[Integration | dict[str, Any]] = (), **options
4544
) -> None:
46-
check_argument_types()
4745
options.setdefault("environment", "development" if __debug__ else "production")
4846

4947
integrations_: list[Integration] = []

0 commit comments

Comments
 (0)