Skip to content

Commit 28e5677

Browse files
committed
Release v0.1.20
#### Changed - Refactored `__init__.py` to use relative imports (`from .module import ...`) for cleaner packaging and better IDE compatibility. - Unified and simplified `__all__` so developers can import everything directly from `api_exception` (e.g. `from api_exception import ResponseModel, APIException`). #### Fixed - Resolved IDE red import warnings when using the library in external projects. - Improved top-level import resolution and consistency across modules.
1 parent 138a4be commit 28e5677

File tree

4 files changed

+35
-12
lines changed

4 files changed

+35
-12
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,20 @@ Benchmark scripts and raw Locust reports are available in the [benchmark](https:
410410

411411
## 📜 Changelog
412412

413-
**v0.1.19 - 2025-08-18**
413+
**v0.1.20 - 2025-08-18**
414414
**Initial stable and suggested version**
415415

416416

417+
#### Changed
418+
- Restructured `__init__.py` to use **relative imports** (`from .module import ...`) instead of absolute imports for cleaner packaging and IDE compatibility.
419+
- Unified all public exports under `__all__` so that consumers can simply `from api_exception import ...` without needing sub-module paths.
420+
421+
#### Fixed
422+
- Resolved IDE/PyCharm highlighting issues where imports appeared red even though they worked at runtime.
423+
- Improved import resolution when using the package in external projects by flattening top-level exports.
424+
425+
**v0.1.19 - 2025-08-18**
426+
417427
#### Added
418428
- Unified import interface: all core classes and functions can now be imported directly from `api_exception` (e.g. `from api_exception import ResponseModel, APIException`).
419429
- Cleaner `__init__.py` exports with `__all__`.

api_exception/__init__.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@
55
from fastapi.responses import JSONResponse
66
from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY
77

8-
from api_exception.rfc7807_model import RFC7807ResponseModel
8+
from .rfc7807_model import RFC7807ResponseModel
9+
from .enums import ExceptionCode, ExceptionStatus, BaseExceptionCode, ResponseFormat
10+
from .response_model import ResponseModel
911
from .logger import logger, add_file_handler
10-
from .exception import APIException, set_default_http_codes, DEFAULT_HTTP_CODES, set_global_log
11-
from api_exception.enums import ExceptionCode, ExceptionStatus, BaseExceptionCode, ResponseFormat
12-
from api_exception.response_model import ResponseModel
12+
from .exception import (
13+
APIException,
14+
set_default_http_codes,
15+
DEFAULT_HTTP_CODES,
16+
set_global_log,
17+
)
1318
from .response_utils import APIResponse
14-
import traceback
1519

1620
__all__ = [
1721
"DEFAULT_HTTP_CODES",
@@ -22,12 +26,12 @@
2226
"ResponseModel",
2327
"ResponseFormat",
2428
"RFC7807ResponseModel",
25-
"register_exception_handlers",
29+
"register_exception_handlers", # bu fonksiyon aşağıda tanımlı kalıyor
2630
"set_default_http_codes",
2731
"logger",
2832
"add_file_handler",
2933
"APIResponse",
30-
"set_global_log"
34+
"set_global_log",
3135
]
3236

3337

docs/changelog.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,20 @@
33
All notable changes to APIException will be documented here.
44
This project uses *Semantic Versioning*.
55

6+
## [0.1.20] - 2025-08-18
7+
✅ Stable release!
8+
**Initial stable and suggested version**
9+
10+
#### Changed
11+
- Refactored `__init__.py` to use relative imports (`from .module import ...`) for cleaner packaging and better IDE compatibility.
12+
- Unified and simplified `__all__` so developers can import everything directly from `api_exception` (e.g. `from api_exception import ResponseModel, APIException`).
13+
14+
#### Fixed
15+
- Resolved IDE red import warnings when using the library in external projects.
16+
- Improved top-level import resolution and consistency across modules.
17+
618

719
## [0.1.19] - 2025-08-18
8-
**Initial stable and suggested version**
920

1021
#### Added
1122
- Unified import interface: all core classes and functions can now be imported directly from `api_exception` (e.g. `from api_exception import ResponseModel, APIException`).
@@ -113,8 +124,6 @@ This project uses *Semantic Versioning*.
113124

114125
## [0.1.11] - 2025-07-13
115126

116-
✅ Stable release!
117-
118127
- Global exception handlers with fallback middleware
119128

120129
- APIResponse for clean Swagger documentation

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "apiexception"
3-
version = "0.1.19"
3+
version = "0.1.20"
44
description = "Consistent JSON response formatting and exception & error handling for FastAPI applications"
55
authors = ["Ahmet Kutay URAL <[email protected]>"]
66
readme = "README.md"

0 commit comments

Comments
 (0)