From 26d1a8a36533709e017099ead86122748a8ca8e1 Mon Sep 17 00:00:00 2001 From: n0str Date: Sat, 21 Dec 2024 20:45:36 +0300 Subject: [PATCH 1/2] Rename package and bump version --- Makefile | 2 +- README.md | 8 ++++---- docs/fastapi.md | 4 ++-- docs/flask.md | 4 ++-- example/example.py | 2 +- example/example2.py | 10 +++++----- example/fill_events.py | 8 ++++---- example/requirements.txt | 2 +- pyproject.toml | 4 ++-- src/{hawkcatcher => hawk_catcher}/__init__.py | 2 +- src/{hawkcatcher => hawk_catcher}/core.py | 8 ++++---- src/{hawkcatcher => hawk_catcher}/errors.py | 0 .../modules/fastapi/__init__.py | 0 .../modules/fastapi/fastapi.py | 6 +++--- .../modules/fastapi/types.py | 2 +- .../modules/flask/__init__.py | 0 .../modules/flask/flask.py | 4 ++-- .../modules/flask/types.py | 2 +- src/{hawkcatcher => hawk_catcher}/types.py | 0 tests/test_cather.py | 9 +++++---- 20 files changed, 39 insertions(+), 38 deletions(-) rename src/{hawkcatcher => hawk_catcher}/__init__.py (90%) rename src/{hawkcatcher => hawk_catcher}/core.py (94%) rename src/{hawkcatcher => hawk_catcher}/errors.py (100%) rename src/{hawkcatcher => hawk_catcher}/modules/fastapi/__init__.py (100%) rename src/{hawkcatcher => hawk_catcher}/modules/fastapi/fastapi.py (94%) rename src/{hawkcatcher => hawk_catcher}/modules/fastapi/types.py (89%) rename src/{hawkcatcher => hawk_catcher}/modules/flask/__init__.py (100%) rename src/{hawkcatcher => hawk_catcher}/modules/flask/flask.py (95%) rename src/{hawkcatcher => hawk_catcher}/modules/flask/types.py (88%) rename src/{hawkcatcher => hawk_catcher}/types.py (100%) diff --git a/Makefile b/Makefile index a0951a8..43b4298 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ PIP=pip -PYTHON=python +PYTHON=python3 all: help diff --git a/README.md b/README.md index 25d7280..9753256 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,16 @@ If you want to connect specific frameworks see [Flask integration](./docs/flask. ### Install module -Install `hawkcatcher` from PyPI. +Install `hawk-catcher` from PyPI. ```shell -$ pip install hawkcatcher +$ pip install hawk-catcher ``` Import Catcher module to your project. ```python -from hawkcatcher import Hawk +from hawk_catcher import Hawk ``` Then enable Hawk Catcher with your token and domain. @@ -115,6 +115,6 @@ Repository: Report a bug: -PyPI Package: +PyPI Package: CodeX Team: diff --git a/docs/fastapi.md b/docs/fastapi.md index 5cd9804..b38d11f 100644 --- a/docs/fastapi.md +++ b/docs/fastapi.md @@ -5,13 +5,13 @@ This extension adds support for the [FastAPI](https://fastapi.tiangolo.com/) web ## Installation ```bash -pip install hawkcatcher[fastapi] +pip install hawk-catcher[fastapi] ``` import Catcher module to your project. ```python -from hawkcatcher.modules.fastapi import HawkFastapi +from hawk_catcher.modules.fastapi import HawkFastapi ``` ```python diff --git a/docs/flask.md b/docs/flask.md index 3b3dfd0..ce2e890 100644 --- a/docs/flask.md +++ b/docs/flask.md @@ -5,13 +5,13 @@ This extension adds support for the [Flask](http://flask.pocoo.org/) web framewo ## Installation ```bash -pip install hawkcatcher[flask] +pip install hawk-catcher[flask] ``` import Catcher module to your project. ```python -from hawkcatcher.modules.flask import HawkFlask +from hawk_catcher.modules.flask import HawkFlask ``` ```python diff --git a/example/example.py b/example/example.py index 15b4eb1..b83802f 100644 --- a/example/example.py +++ b/example/example.py @@ -1,5 +1,5 @@ import os -from hawkcatcher import Hawk +from hawk_catcher import Hawk from dotenv import load_dotenv load_dotenv() # take environment variables from .env. diff --git a/example/example2.py b/example/example2.py index 171d311..e230795 100644 --- a/example/example2.py +++ b/example/example2.py @@ -1,4 +1,4 @@ -import hawkcatcher +import hawk_catcher import os from dotenv import load_dotenv @@ -18,13 +18,13 @@ def test_method(self): self.divide_by_zero() def mannual_sending(self): - hawkcatcher.send(ValueError("lol"), {"ping": "pong", "number": 1}) + hawk_catcher.send(ValueError("lol"), {"ping": "pong", "number": 1}) def send_custom_error(self): raise InvalidToken() def send_with_user(self): - hawkcatcher.send( + hawk_catcher.send( ValueError("USER"), None, {'id': 1, 'name': 'Alice'} @@ -35,9 +35,9 @@ def main(): token = os.getenv('HAWK_TOKEN') if token is None or token == "": - print('hawkcatcher token not provided. Please provide HAWK_TOKEN variable in .env file') + print('hawk-catcher token not provided. Please provide HAWK_TOKEN variable in .env file') return - hawkcatcher.init(token) + hawk_catcher.init(token) test = Module() test.mannual_sending() test.send_with_user() diff --git a/example/fill_events.py b/example/fill_events.py index 2915630..417dfe2 100644 --- a/example/fill_events.py +++ b/example/fill_events.py @@ -1,6 +1,6 @@ import random import os -import hawkcatcher +import hawk_catcher from faker import Faker fake = Faker() @@ -48,7 +48,7 @@ def random_exception(): ] token = os.getenv('HAWK_TOKEN') -hawkcatcher.init(token) +hawk_catcher.init(token) for _ in range(10): try: @@ -57,7 +57,7 @@ def random_exception(): except Exception as e: random_username = fake.user_name() random_email = fake.email() - hawkcatcher.send(e, {'username': random_username, 'value': random_email}) + hawk_catcher.send(e, {'username': random_username, 'value': random_email}) for _ in range(2): try: @@ -65,4 +65,4 @@ def random_exception(): except Exception as e: random_username = fake.user_name() random_email = fake.email() - hawkcatcher.send(e, {'username': random_username, 'value': random_email}) \ No newline at end of file + hawk_catcher.send(e, {'username': random_username, 'value': random_email}) \ No newline at end of file diff --git a/example/requirements.txt b/example/requirements.txt index e345682..a13faa6 100644 --- a/example/requirements.txt +++ b/example/requirements.txt @@ -1,2 +1,2 @@ -hawkcatcher +hawk-catcher faker \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 06dbb00..ab71662 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] dynamic = ["version"] dependencies = ["requests"] -name = "hawkcatcher" +name = "hawk-catcher" authors = [{ name = "CodeX Team", email = "team@codex.so" }] description = "Python errors Catcher module for Hawk." readme = "README.md" @@ -21,7 +21,7 @@ classifiers = [ flask = ["flask"] fastapi = ["starlette"] [tool.hatch.version] -path = "src/hawkcatcher/__init__.py" +path = "src/hawk_catcher/__init__.py" [project.urls] Homepage = "https://github.com/codex-team/hawk.python" Issues = "https://github.com/codex-team/hawk.python/issues" diff --git a/src/hawkcatcher/__init__.py b/src/hawk_catcher/__init__.py similarity index 90% rename from src/hawkcatcher/__init__.py rename to src/hawk_catcher/__init__.py index a721427..de78df7 100644 --- a/src/hawkcatcher/__init__.py +++ b/src/hawk_catcher/__init__.py @@ -1,4 +1,4 @@ -__version__ = "3.5.0" +__version__ = "3.5.1" from .core import Hawk from .types import HawkCatcherSettings diff --git a/src/hawkcatcher/core.py b/src/hawk_catcher/core.py similarity index 94% rename from src/hawkcatcher/core.py rename to src/hawk_catcher/core.py index 095cc4a..02c48b4 100644 --- a/src/hawkcatcher/core.py +++ b/src/hawk_catcher/core.py @@ -7,9 +7,9 @@ from base64 import b64decode import json -import hawkcatcher -from hawkcatcher.errors import InvalidHawkToken -from hawkcatcher.types import HawkCatcherSettings, Addons, User +import hawk_catcher +from hawk_catcher.errors import InvalidHawkToken +from hawk_catcher.types import HawkCatcherSettings, Addons, User class Hawk: @@ -89,7 +89,7 @@ def handler(self, exc_cls: type, exc: Exception, tb: traceback, context=None, us 'backtrace': backtrace, 'release': self.params['release'], 'context': context, - 'catcherVersion': hawkcatcher.__version__, + 'catcherVersion': hawk_catcher.__version__, 'user': user, 'addons': addons } diff --git a/src/hawkcatcher/errors.py b/src/hawk_catcher/errors.py similarity index 100% rename from src/hawkcatcher/errors.py rename to src/hawk_catcher/errors.py diff --git a/src/hawkcatcher/modules/fastapi/__init__.py b/src/hawk_catcher/modules/fastapi/__init__.py similarity index 100% rename from src/hawkcatcher/modules/fastapi/__init__.py rename to src/hawk_catcher/modules/fastapi/__init__.py diff --git a/src/hawkcatcher/modules/fastapi/fastapi.py b/src/hawk_catcher/modules/fastapi/fastapi.py similarity index 94% rename from src/hawkcatcher/modules/fastapi/fastapi.py rename to src/hawk_catcher/modules/fastapi/fastapi.py index a8e0502..7084e03 100644 --- a/src/hawkcatcher/modules/fastapi/fastapi.py +++ b/src/hawk_catcher/modules/fastapi/fastapi.py @@ -1,11 +1,11 @@ -from hawkcatcher.types import HawkCatcherSettings +from hawk_catcher.types import HawkCatcherSettings from ...core import Hawk -from hawkcatcher.modules.fastapi.types import FastapiSettings, FastapiAddons +from hawk_catcher.modules.fastapi.types import FastapiSettings, FastapiAddons from starlette.types import ASGIApp, Receive, Scope, Send from starlette.requests import Request from starlette.middleware.base import BaseHTTPMiddleware from typing import Union -from hawkcatcher.errors import ModuleError +from hawk_catcher.errors import ModuleError import asyncio from contextvars import ContextVar from fastapi import Request diff --git a/src/hawkcatcher/modules/fastapi/types.py b/src/hawk_catcher/modules/fastapi/types.py similarity index 89% rename from src/hawkcatcher/modules/fastapi/types.py rename to src/hawk_catcher/modules/fastapi/types.py index b2d8ea1..1fab3aa 100644 --- a/src/hawkcatcher/modules/fastapi/types.py +++ b/src/hawk_catcher/modules/fastapi/types.py @@ -1,4 +1,4 @@ -from hawkcatcher.types import HawkCatcherSettings, User, Addons +from hawk_catcher.types import HawkCatcherSettings, User, Addons from typing import Callable, TypedDict from starlette.applications import Starlette from fastapi import Request diff --git a/src/hawkcatcher/modules/flask/__init__.py b/src/hawk_catcher/modules/flask/__init__.py similarity index 100% rename from src/hawkcatcher/modules/flask/__init__.py rename to src/hawk_catcher/modules/flask/__init__.py diff --git a/src/hawkcatcher/modules/flask/flask.py b/src/hawk_catcher/modules/flask/flask.py similarity index 95% rename from src/hawkcatcher/modules/flask/flask.py rename to src/hawk_catcher/modules/flask/flask.py index 27dc419..e0b1ee2 100644 --- a/src/hawkcatcher/modules/flask/flask.py +++ b/src/hawk_catcher/modules/flask/flask.py @@ -1,7 +1,7 @@ from ...core import Hawk from typing import Union -from hawkcatcher.modules.flask.types import FlaskSettings, Addons -from hawkcatcher.errors import ModuleError +from hawk_catcher.modules.flask.types import FlaskSettings, Addons +from hawk_catcher.errors import ModuleError try: from flask.signals import got_request_exception diff --git a/src/hawkcatcher/modules/flask/types.py b/src/hawk_catcher/modules/flask/types.py similarity index 88% rename from src/hawkcatcher/modules/flask/types.py rename to src/hawk_catcher/modules/flask/types.py index 354ee05..93e93fd 100644 --- a/src/hawkcatcher/modules/flask/types.py +++ b/src/hawk_catcher/modules/flask/types.py @@ -1,4 +1,4 @@ -from hawkcatcher.types import HawkCatcherSettings, User, Addons +from hawk_catcher.types import HawkCatcherSettings, User, Addons from typing import Callable, TypedDict from flask import Request diff --git a/src/hawkcatcher/types.py b/src/hawk_catcher/types.py similarity index 100% rename from src/hawkcatcher/types.py rename to src/hawk_catcher/types.py diff --git a/tests/test_cather.py b/tests/test_cather.py index 8daa0ba..ddc9d70 100644 --- a/tests/test_cather.py +++ b/tests/test_cather.py @@ -2,9 +2,9 @@ import pytest -from hawkcatcher import __version__ -from hawkcatcher import Hawk -from hawkcatcher.errors import InvalidHawkToken +from hawk_catcher import __version__ +from hawk_catcher import Hawk +from hawk_catcher.errors import InvalidHawkToken sample_token = "eyJpbnRlZ3JhdGlvbklkIjoiZGRjZmY4OTItODMzMy00YjVlLWIyYWQtZWM1MDQ5MDVjMjFlIiwic2VjcmV0IjoiZmJjYzIwMTEtMTY5My00NDIyLThiNDItZDRlMzdlYmI4NWIwIn0=" sample_token_collector_endpoint = "https://ddcff892-8333-4b5e-b2ad-ec504905c21e.k1.hawk.so" @@ -40,7 +40,8 @@ def test_settings_parsing(): 'token': sample_token, 'collector_endpoint': sample_token_collector_endpoint, 'release': None, - 'before_send': None + 'before_send': None, + 'context': None } assert settings == right_settings From c2e0d67571a9c7808ef598ec5498742927ce1d8d Mon Sep 17 00:00:00 2001 From: n0str Date: Sun, 22 Dec 2024 15:36:02 +0300 Subject: [PATCH 2/2] Finally hawk-python-sdk --- README.md | 8 ++++---- docs/fastapi.md | 4 ++-- docs/flask.md | 4 ++-- example/example.py | 2 +- example/example2.py | 10 +++++----- example/fill_events.py | 8 ++++---- example/requirements.txt | 2 +- pyproject.toml | 4 ++-- src/{hawk_catcher => hawk_python_sdk}/__init__.py | 0 src/{hawk_catcher => hawk_python_sdk}/core.py | 8 ++++---- src/{hawk_catcher => hawk_python_sdk}/errors.py | 0 .../modules/fastapi/__init__.py | 0 .../modules/fastapi/fastapi.py | 6 +++--- .../modules/fastapi/types.py | 2 +- .../modules/flask/__init__.py | 0 .../modules/flask/flask.py | 4 ++-- .../modules/flask/types.py | 2 +- src/{hawk_catcher => hawk_python_sdk}/types.py | 0 tests/test_cather.py | 6 +++--- 19 files changed, 35 insertions(+), 35 deletions(-) rename src/{hawk_catcher => hawk_python_sdk}/__init__.py (100%) rename src/{hawk_catcher => hawk_python_sdk}/core.py (94%) rename src/{hawk_catcher => hawk_python_sdk}/errors.py (100%) rename src/{hawk_catcher => hawk_python_sdk}/modules/fastapi/__init__.py (100%) rename src/{hawk_catcher => hawk_python_sdk}/modules/fastapi/fastapi.py (94%) rename src/{hawk_catcher => hawk_python_sdk}/modules/fastapi/types.py (89%) rename src/{hawk_catcher => hawk_python_sdk}/modules/flask/__init__.py (100%) rename src/{hawk_catcher => hawk_python_sdk}/modules/flask/flask.py (95%) rename src/{hawk_catcher => hawk_python_sdk}/modules/flask/types.py (88%) rename src/{hawk_catcher => hawk_python_sdk}/types.py (100%) diff --git a/README.md b/README.md index 9753256..1bcbda0 100644 --- a/README.md +++ b/README.md @@ -10,16 +10,16 @@ If you want to connect specific frameworks see [Flask integration](./docs/flask. ### Install module -Install `hawk-catcher` from PyPI. +Install `hawk-python-sdk` from PyPI. ```shell -$ pip install hawk-catcher +$ pip install hawk-python-sdk ``` Import Catcher module to your project. ```python -from hawk_catcher import Hawk +from hawk_python_sdk import Hawk ``` Then enable Hawk Catcher with your token and domain. @@ -115,6 +115,6 @@ Repository: Report a bug: -PyPI Package: +PyPI Package: CodeX Team: diff --git a/docs/fastapi.md b/docs/fastapi.md index b38d11f..2184fcd 100644 --- a/docs/fastapi.md +++ b/docs/fastapi.md @@ -5,13 +5,13 @@ This extension adds support for the [FastAPI](https://fastapi.tiangolo.com/) web ## Installation ```bash -pip install hawk-catcher[fastapi] +pip install hawk-python-sdk[fastapi] ``` import Catcher module to your project. ```python -from hawk_catcher.modules.fastapi import HawkFastapi +from hawk_python_sdk.modules.fastapi import HawkFastapi ``` ```python diff --git a/docs/flask.md b/docs/flask.md index ce2e890..581e19d 100644 --- a/docs/flask.md +++ b/docs/flask.md @@ -5,13 +5,13 @@ This extension adds support for the [Flask](http://flask.pocoo.org/) web framewo ## Installation ```bash -pip install hawk-catcher[flask] +pip install hawk-python-sdk[flask] ``` import Catcher module to your project. ```python -from hawk_catcher.modules.flask import HawkFlask +from hawk_python_sdk.modules.flask import HawkFlask ``` ```python diff --git a/example/example.py b/example/example.py index b83802f..9aebd9d 100644 --- a/example/example.py +++ b/example/example.py @@ -1,5 +1,5 @@ import os -from hawk_catcher import Hawk +from hawk_python_sdk import Hawk from dotenv import load_dotenv load_dotenv() # take environment variables from .env. diff --git a/example/example2.py b/example/example2.py index e230795..b581d5a 100644 --- a/example/example2.py +++ b/example/example2.py @@ -1,4 +1,4 @@ -import hawk_catcher +import hawk_python_sdk import os from dotenv import load_dotenv @@ -18,13 +18,13 @@ def test_method(self): self.divide_by_zero() def mannual_sending(self): - hawk_catcher.send(ValueError("lol"), {"ping": "pong", "number": 1}) + hawk_python_sdk.send(ValueError("lol"), {"ping": "pong", "number": 1}) def send_custom_error(self): raise InvalidToken() def send_with_user(self): - hawk_catcher.send( + hawk_python_sdk.send( ValueError("USER"), None, {'id': 1, 'name': 'Alice'} @@ -35,9 +35,9 @@ def main(): token = os.getenv('HAWK_TOKEN') if token is None or token == "": - print('hawk-catcher token not provided. Please provide HAWK_TOKEN variable in .env file') + print('hawk-python-sdk token not provided. Please provide HAWK_TOKEN variable in .env file') return - hawk_catcher.init(token) + hawk_python_sdk.init(token) test = Module() test.mannual_sending() test.send_with_user() diff --git a/example/fill_events.py b/example/fill_events.py index 417dfe2..33c4147 100644 --- a/example/fill_events.py +++ b/example/fill_events.py @@ -1,6 +1,6 @@ import random import os -import hawk_catcher +import hawk_python_sdk from faker import Faker fake = Faker() @@ -48,7 +48,7 @@ def random_exception(): ] token = os.getenv('HAWK_TOKEN') -hawk_catcher.init(token) +hawk_python_sdk.init(token) for _ in range(10): try: @@ -57,7 +57,7 @@ def random_exception(): except Exception as e: random_username = fake.user_name() random_email = fake.email() - hawk_catcher.send(e, {'username': random_username, 'value': random_email}) + hawk_python_sdk.send(e, {'username': random_username, 'value': random_email}) for _ in range(2): try: @@ -65,4 +65,4 @@ def random_exception(): except Exception as e: random_username = fake.user_name() random_email = fake.email() - hawk_catcher.send(e, {'username': random_username, 'value': random_email}) \ No newline at end of file + hawk_python_sdk.send(e, {'username': random_username, 'value': random_email}) \ No newline at end of file diff --git a/example/requirements.txt b/example/requirements.txt index a13faa6..142da53 100644 --- a/example/requirements.txt +++ b/example/requirements.txt @@ -1,2 +1,2 @@ -hawk-catcher +hawk-python-sdk faker \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index ab71662..0ba254a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] dynamic = ["version"] dependencies = ["requests"] -name = "hawk-catcher" +name = "hawk-python-sdk" authors = [{ name = "CodeX Team", email = "team@codex.so" }] description = "Python errors Catcher module for Hawk." readme = "README.md" @@ -21,7 +21,7 @@ classifiers = [ flask = ["flask"] fastapi = ["starlette"] [tool.hatch.version] -path = "src/hawk_catcher/__init__.py" +path = "src/hawk_python_sdk/__init__.py" [project.urls] Homepage = "https://github.com/codex-team/hawk.python" Issues = "https://github.com/codex-team/hawk.python/issues" diff --git a/src/hawk_catcher/__init__.py b/src/hawk_python_sdk/__init__.py similarity index 100% rename from src/hawk_catcher/__init__.py rename to src/hawk_python_sdk/__init__.py diff --git a/src/hawk_catcher/core.py b/src/hawk_python_sdk/core.py similarity index 94% rename from src/hawk_catcher/core.py rename to src/hawk_python_sdk/core.py index 02c48b4..28d5f54 100644 --- a/src/hawk_catcher/core.py +++ b/src/hawk_python_sdk/core.py @@ -7,9 +7,9 @@ from base64 import b64decode import json -import hawk_catcher -from hawk_catcher.errors import InvalidHawkToken -from hawk_catcher.types import HawkCatcherSettings, Addons, User +import hawk_python_sdk +from hawk_python_sdk.errors import InvalidHawkToken +from hawk_python_sdk.types import HawkCatcherSettings, Addons, User class Hawk: @@ -89,7 +89,7 @@ def handler(self, exc_cls: type, exc: Exception, tb: traceback, context=None, us 'backtrace': backtrace, 'release': self.params['release'], 'context': context, - 'catcherVersion': hawk_catcher.__version__, + 'catcherVersion': hawk_python_sdk.__version__, 'user': user, 'addons': addons } diff --git a/src/hawk_catcher/errors.py b/src/hawk_python_sdk/errors.py similarity index 100% rename from src/hawk_catcher/errors.py rename to src/hawk_python_sdk/errors.py diff --git a/src/hawk_catcher/modules/fastapi/__init__.py b/src/hawk_python_sdk/modules/fastapi/__init__.py similarity index 100% rename from src/hawk_catcher/modules/fastapi/__init__.py rename to src/hawk_python_sdk/modules/fastapi/__init__.py diff --git a/src/hawk_catcher/modules/fastapi/fastapi.py b/src/hawk_python_sdk/modules/fastapi/fastapi.py similarity index 94% rename from src/hawk_catcher/modules/fastapi/fastapi.py rename to src/hawk_python_sdk/modules/fastapi/fastapi.py index 7084e03..eebaca8 100644 --- a/src/hawk_catcher/modules/fastapi/fastapi.py +++ b/src/hawk_python_sdk/modules/fastapi/fastapi.py @@ -1,11 +1,11 @@ -from hawk_catcher.types import HawkCatcherSettings +from hawk_python_sdk.types import HawkCatcherSettings from ...core import Hawk -from hawk_catcher.modules.fastapi.types import FastapiSettings, FastapiAddons +from hawk_python_sdk.modules.fastapi.types import FastapiSettings, FastapiAddons from starlette.types import ASGIApp, Receive, Scope, Send from starlette.requests import Request from starlette.middleware.base import BaseHTTPMiddleware from typing import Union -from hawk_catcher.errors import ModuleError +from hawk_python_sdk.errors import ModuleError import asyncio from contextvars import ContextVar from fastapi import Request diff --git a/src/hawk_catcher/modules/fastapi/types.py b/src/hawk_python_sdk/modules/fastapi/types.py similarity index 89% rename from src/hawk_catcher/modules/fastapi/types.py rename to src/hawk_python_sdk/modules/fastapi/types.py index 1fab3aa..77fd733 100644 --- a/src/hawk_catcher/modules/fastapi/types.py +++ b/src/hawk_python_sdk/modules/fastapi/types.py @@ -1,4 +1,4 @@ -from hawk_catcher.types import HawkCatcherSettings, User, Addons +from hawk_python_sdk.types import HawkCatcherSettings, User, Addons from typing import Callable, TypedDict from starlette.applications import Starlette from fastapi import Request diff --git a/src/hawk_catcher/modules/flask/__init__.py b/src/hawk_python_sdk/modules/flask/__init__.py similarity index 100% rename from src/hawk_catcher/modules/flask/__init__.py rename to src/hawk_python_sdk/modules/flask/__init__.py diff --git a/src/hawk_catcher/modules/flask/flask.py b/src/hawk_python_sdk/modules/flask/flask.py similarity index 95% rename from src/hawk_catcher/modules/flask/flask.py rename to src/hawk_python_sdk/modules/flask/flask.py index e0b1ee2..23394a7 100644 --- a/src/hawk_catcher/modules/flask/flask.py +++ b/src/hawk_python_sdk/modules/flask/flask.py @@ -1,7 +1,7 @@ from ...core import Hawk from typing import Union -from hawk_catcher.modules.flask.types import FlaskSettings, Addons -from hawk_catcher.errors import ModuleError +from hawk_python_sdk.modules.flask.types import FlaskSettings, Addons +from hawk_python_sdk.errors import ModuleError try: from flask.signals import got_request_exception diff --git a/src/hawk_catcher/modules/flask/types.py b/src/hawk_python_sdk/modules/flask/types.py similarity index 88% rename from src/hawk_catcher/modules/flask/types.py rename to src/hawk_python_sdk/modules/flask/types.py index 93e93fd..c588697 100644 --- a/src/hawk_catcher/modules/flask/types.py +++ b/src/hawk_python_sdk/modules/flask/types.py @@ -1,4 +1,4 @@ -from hawk_catcher.types import HawkCatcherSettings, User, Addons +from hawk_python_sdk.types import HawkCatcherSettings, User, Addons from typing import Callable, TypedDict from flask import Request diff --git a/src/hawk_catcher/types.py b/src/hawk_python_sdk/types.py similarity index 100% rename from src/hawk_catcher/types.py rename to src/hawk_python_sdk/types.py diff --git a/tests/test_cather.py b/tests/test_cather.py index ddc9d70..d0b6d2b 100644 --- a/tests/test_cather.py +++ b/tests/test_cather.py @@ -2,9 +2,9 @@ import pytest -from hawk_catcher import __version__ -from hawk_catcher import Hawk -from hawk_catcher.errors import InvalidHawkToken +from hawk_python_sdk import __version__ +from hawk_python_sdk import Hawk +from hawk_python_sdk.errors import InvalidHawkToken sample_token = "eyJpbnRlZ3JhdGlvbklkIjoiZGRjZmY4OTItODMzMy00YjVlLWIyYWQtZWM1MDQ5MDVjMjFlIiwic2VjcmV0IjoiZmJjYzIwMTEtMTY5My00NDIyLThiNDItZDRlMzdlYmI4NWIwIn0=" sample_token_collector_endpoint = "https://ddcff892-8333-4b5e-b2ad-ec504905c21e.k1.hawk.so"