Skip to content

Commit

Permalink
Merge pull request #31 from codex-team/feat/decrease-python-vesrion
Browse files Browse the repository at this point in the history
slaveeks authored Jan 10, 2025
2 parents ba5f581 + 10ea59c commit 09a3f19
Showing 4 changed files with 29 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -106,7 +106,7 @@ Parameters:

## Requirements

- Python \>= 3.12
- Python \>= 3.10
- requests

## Links
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -4,22 +4,22 @@ build-backend = "hatchling.build"
[project]
dynamic = ["version"]
dependencies = ["requests"]
name = "hawkcatcher"
name = "hawk_python_sdk"
authors = [{ name = "CodeX Team", email = "[email protected]" }]
description = "Python errors Catcher module for Hawk."
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.10"
classifiers = [
"Intended Audience :: Developers",
"Topic :: Software Development :: Bug Tracking",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.10",
"Environment :: Console",
"Environment :: Web Environment",
]
[project.optional-dependencies]
flask = ["flask"]
fastapi = ["starlette"]
fastapi = ["fastapi"]
[tool.hatch.version]
path = "src/hawkcatcher/__init__.py"
[project.urls]
2 changes: 1 addition & 1 deletion src/hawkcatcher/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "3.5.0"
__version__ = "3.5.1"

from .core import Hawk
from .types import HawkCatcherSettings
28 changes: 23 additions & 5 deletions src/hawkcatcher/types.py
Original file line number Diff line number Diff line change
@@ -12,16 +12,34 @@ class User(TypedDict):
image: str # User's public picture
url: str # URL for user's details page

class HawkCatcherSettings(TypedDict, Generic[T]):
"""Settings for Hawk catcher for errors tracking"""

class HawkCatcherSettings(Generic[T]):
"""Base settings for Hawk catcher for errors tracking"""
token: str # Hawk integration token
collector_endpoint: str # Collector endpoint for sending event to
release: str # Release name for Suspected Commits feature
before_send: Callable[[dict], None] # This hook allows you to filter any data you don't want sending to Hawk
context: dict # Additional context to be send with event
with_addons: bool = True # This parameter points if you want to send framework data with error (cookies, headers, params, form, json)
set_user: Callable[[T], User] # This hook allows you to set user information, this hook is useful for frameworks
with_addons: bool # This parameter points if you want to send framework data with error (cookies, headers, params, form, json)

def __init__(
self,
*,
token: str,
collector_endpoint: str,
release: str,
before_send: Callable[[dict], None],
context: dict,
with_addons: bool,
set_user: Callable[[T], User]
):
self.token = token
self.collector_endpoint = collector_endpoint
self.release = release
self.before_send = before_send
self.context = context
self.with_addons = with_addons
self.set_user = set_user


class Addons(TypedDict):
"""Additional data to be send with event due to frameworks"""

0 comments on commit 09a3f19

Please sign in to comment.