Skip to content

Commit 26d1a8a

Browse files
committed
Rename package and bump version
1 parent 97583ad commit 26d1a8a

20 files changed

+39
-38
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PIP=pip
2-
PYTHON=python
2+
PYTHON=python3
33

44
all: help
55

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ If you want to connect specific frameworks see [Flask integration](./docs/flask.
1010

1111
### Install module
1212

13-
Install `hawkcatcher` from PyPI.
13+
Install `hawk-catcher` from PyPI.
1414

1515
```shell
16-
$ pip install hawkcatcher
16+
$ pip install hawk-catcher
1717
```
1818

1919
Import Catcher module to your project.
2020

2121
```python
22-
from hawkcatcher import Hawk
22+
from hawk_catcher import Hawk
2323
```
2424

2525
Then enable Hawk Catcher with your token and domain.
@@ -115,6 +115,6 @@ Repository: <https://github.com/codex-team/hawk.python>
115115

116116
Report a bug: <https://github.com/codex-team/hawk.python/issues>
117117

118-
PyPI Package: <https://pypi.python.org/pypi/hawkcatcher>
118+
PyPI Package: <https://pypi.python.org/pypi/hawk-catcher>
119119

120120
CodeX Team: <https://codex.so/>

docs/fastapi.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ This extension adds support for the [FastAPI](https://fastapi.tiangolo.com/) web
55
## Installation
66

77
```bash
8-
pip install hawkcatcher[fastapi]
8+
pip install hawk-catcher[fastapi]
99
```
1010

1111
import Catcher module to your project.
1212

1313
```python
14-
from hawkcatcher.modules.fastapi import HawkFastapi
14+
from hawk_catcher.modules.fastapi import HawkFastapi
1515
```
1616

1717
```python

docs/flask.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ This extension adds support for the [Flask](http://flask.pocoo.org/) web framewo
55
## Installation
66

77
```bash
8-
pip install hawkcatcher[flask]
8+
pip install hawk-catcher[flask]
99
```
1010

1111
import Catcher module to your project.
1212

1313
```python
14-
from hawkcatcher.modules.flask import HawkFlask
14+
from hawk_catcher.modules.flask import HawkFlask
1515
```
1616

1717
```python

example/example.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import os
2-
from hawkcatcher import Hawk
2+
from hawk_catcher import Hawk
33
from dotenv import load_dotenv
44

55
load_dotenv() # take environment variables from .env.

example/example2.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import hawkcatcher
1+
import hawk_catcher
22
import os
33
from dotenv import load_dotenv
44

@@ -18,13 +18,13 @@ def test_method(self):
1818
self.divide_by_zero()
1919

2020
def mannual_sending(self):
21-
hawkcatcher.send(ValueError("lol"), {"ping": "pong", "number": 1})
21+
hawk_catcher.send(ValueError("lol"), {"ping": "pong", "number": 1})
2222

2323
def send_custom_error(self):
2424
raise InvalidToken()
2525

2626
def send_with_user(self):
27-
hawkcatcher.send(
27+
hawk_catcher.send(
2828
ValueError("USER"),
2929
None,
3030
{'id': 1, 'name': 'Alice'}
@@ -35,9 +35,9 @@ def main():
3535
token = os.getenv('HAWK_TOKEN')
3636

3737
if token is None or token == "":
38-
print('hawkcatcher token not provided. Please provide HAWK_TOKEN variable in .env file')
38+
print('hawk-catcher token not provided. Please provide HAWK_TOKEN variable in .env file')
3939
return
40-
hawkcatcher.init(token)
40+
hawk_catcher.init(token)
4141
test = Module()
4242
test.mannual_sending()
4343
test.send_with_user()

example/fill_events.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import random
22
import os
3-
import hawkcatcher
3+
import hawk_catcher
44
from faker import Faker
55

66
fake = Faker()
@@ -48,7 +48,7 @@ def random_exception():
4848
]
4949

5050
token = os.getenv('HAWK_TOKEN')
51-
hawkcatcher.init(token)
51+
hawk_catcher.init(token)
5252

5353
for _ in range(10):
5454
try:
@@ -57,12 +57,12 @@ def random_exception():
5757
except Exception as e:
5858
random_username = fake.user_name()
5959
random_email = fake.email()
60-
hawkcatcher.send(e, {'username': random_username, 'value': random_email})
60+
hawk_catcher.send(e, {'username': random_username, 'value': random_email})
6161

6262
for _ in range(2):
6363
try:
6464
random_exception()
6565
except Exception as e:
6666
random_username = fake.user_name()
6767
random_email = fake.email()
68-
hawkcatcher.send(e, {'username': random_username, 'value': random_email})
68+
hawk_catcher.send(e, {'username': random_username, 'value': random_email})

example/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
hawkcatcher
1+
hawk-catcher
22
faker

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44
[project]
55
dynamic = ["version"]
66
dependencies = ["requests"]
7-
name = "hawkcatcher"
7+
name = "hawk-catcher"
88
authors = [{ name = "CodeX Team", email = "[email protected]" }]
99
description = "Python errors Catcher module for Hawk."
1010
readme = "README.md"
@@ -21,7 +21,7 @@ classifiers = [
2121
flask = ["flask"]
2222
fastapi = ["starlette"]
2323
[tool.hatch.version]
24-
path = "src/hawkcatcher/__init__.py"
24+
path = "src/hawk_catcher/__init__.py"
2525
[project.urls]
2626
Homepage = "https://github.com/codex-team/hawk.python"
2727
Issues = "https://github.com/codex-team/hawk.python/issues"

src/hawkcatcher/__init__.py renamed to src/hawk_catcher/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "3.5.0"
1+
__version__ = "3.5.1"
22

33
from .core import Hawk
44
from .types import HawkCatcherSettings

src/hawkcatcher/core.py renamed to src/hawk_catcher/core.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
from base64 import b64decode
88
import json
99

10-
import hawkcatcher
11-
from hawkcatcher.errors import InvalidHawkToken
12-
from hawkcatcher.types import HawkCatcherSettings, Addons, User
10+
import hawk_catcher
11+
from hawk_catcher.errors import InvalidHawkToken
12+
from hawk_catcher.types import HawkCatcherSettings, Addons, User
1313

1414

1515
class Hawk:
@@ -89,7 +89,7 @@ def handler(self, exc_cls: type, exc: Exception, tb: traceback, context=None, us
8989
'backtrace': backtrace,
9090
'release': self.params['release'],
9191
'context': context,
92-
'catcherVersion': hawkcatcher.__version__,
92+
'catcherVersion': hawk_catcher.__version__,
9393
'user': user,
9494
'addons': addons
9595
}
File renamed without changes.

src/hawkcatcher/modules/fastapi/fastapi.py renamed to src/hawk_catcher/modules/fastapi/fastapi.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
from hawkcatcher.types import HawkCatcherSettings
1+
from hawk_catcher.types import HawkCatcherSettings
22
from ...core import Hawk
3-
from hawkcatcher.modules.fastapi.types import FastapiSettings, FastapiAddons
3+
from hawk_catcher.modules.fastapi.types import FastapiSettings, FastapiAddons
44
from starlette.types import ASGIApp, Receive, Scope, Send
55
from starlette.requests import Request
66
from starlette.middleware.base import BaseHTTPMiddleware
77
from typing import Union
8-
from hawkcatcher.errors import ModuleError
8+
from hawk_catcher.errors import ModuleError
99
import asyncio
1010
from contextvars import ContextVar
1111
from fastapi import Request

src/hawkcatcher/modules/fastapi/types.py renamed to src/hawk_catcher/modules/fastapi/types.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from hawkcatcher.types import HawkCatcherSettings, User, Addons
1+
from hawk_catcher.types import HawkCatcherSettings, User, Addons
22
from typing import Callable, TypedDict
33
from starlette.applications import Starlette
44
from fastapi import Request

src/hawkcatcher/modules/flask/flask.py renamed to src/hawk_catcher/modules/flask/flask.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from ...core import Hawk
22
from typing import Union
3-
from hawkcatcher.modules.flask.types import FlaskSettings, Addons
4-
from hawkcatcher.errors import ModuleError
3+
from hawk_catcher.modules.flask.types import FlaskSettings, Addons
4+
from hawk_catcher.errors import ModuleError
55

66
try:
77
from flask.signals import got_request_exception

src/hawkcatcher/modules/flask/types.py renamed to src/hawk_catcher/modules/flask/types.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from hawkcatcher.types import HawkCatcherSettings, User, Addons
1+
from hawk_catcher.types import HawkCatcherSettings, User, Addons
22
from typing import Callable, TypedDict
33
from flask import Request
44

File renamed without changes.

tests/test_cather.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
import pytest
44

5-
from hawkcatcher import __version__
6-
from hawkcatcher import Hawk
7-
from hawkcatcher.errors import InvalidHawkToken
5+
from hawk_catcher import __version__
6+
from hawk_catcher import Hawk
7+
from hawk_catcher.errors import InvalidHawkToken
88

99
sample_token = "eyJpbnRlZ3JhdGlvbklkIjoiZGRjZmY4OTItODMzMy00YjVlLWIyYWQtZWM1MDQ5MDVjMjFlIiwic2VjcmV0IjoiZmJjYzIwMTEtMTY5My00NDIyLThiNDItZDRlMzdlYmI4NWIwIn0="
1010
sample_token_collector_endpoint = "https://ddcff892-8333-4b5e-b2ad-ec504905c21e.k1.hawk.so"
@@ -40,7 +40,8 @@ def test_settings_parsing():
4040
'token': sample_token,
4141
'collector_endpoint': sample_token_collector_endpoint,
4242
'release': None,
43-
'before_send': None
43+
'before_send': None,
44+
'context': None
4445
}
4546

4647
assert settings == right_settings

0 commit comments

Comments
 (0)