diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 2017331..1587410 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -55,7 +55,7 @@ jobs: run: uv run pre-commit run --all-files - name: Test with pytest - run: uv run pytest tests --cov=src + run: uv run pytest --cov=src - name: Minimize uv cache run: uv cache prune --ci diff --git a/.gitignore b/.gitignore index 0a19790..b7f3c34 100644 --- a/.gitignore +++ b/.gitignore @@ -172,3 +172,5 @@ cython_debug/ # PyPI configuration file .pypirc + +.idea diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 389c71b..441825f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -57,7 +57,6 @@ repos: --wrap-descriptions, "90", src, - tests, ] # bandit - find common security issues @@ -66,10 +65,8 @@ repos: hooks: - id: bandit name: bandit - exclude: ^tests/ - args: - - -r - - src + args: ["-r", "src", "-x", "*/tests/*"] + pass_filenames: false # prettier - formatting JS, CSS, JSON, Markdown, ... - repo: https://github.com/pre-commit/mirrors-prettier diff --git a/shared/utils/README.md b/shared/utils/README.md index e69de29..81995c2 100644 --- a/shared/utils/README.md +++ b/shared/utils/README.md @@ -0,0 +1,52 @@ +# Shared Utils + +Shared utilities and common functionality used across multiple modules in the project. + +## Structure + +``` +shared/utils/ +├── src/utils/ # Shared utilities source code +├── pyproject.toml # Package configuration +└── README.md # This file +``` + +## Overview + +This package contains reusable utility functions, helpers, and common code that can be shared between different modules of the application. It provides a centralized location for: + +- Common data structures and types +- Utility functions and helpers +- Shared configuration utilities +- Cross-module interfaces and contracts + +## Installation + +The shared utilities are installed as a local package dependency. To install in development mode: + +```bash +pip install -e shared/utils/ +``` + +## Usage + +Import utilities from the shared package: + +```python +from utils import your_utility_function +# or +from utils.module_name import specific_function +``` + +## Development + +When adding new shared utilities: + +1. Place them in the appropriate module under `src/utils/` +2. Update the package's `__init__.py` if needed +3. Add tests for new functionality +4. Update this README if adding major new features + +## Dependencies + +Check `pyproject.toml` for current dependencies and requirements. diff --git a/src/core/README.md b/src/core/README.md index 03cd839..c95182c 100644 --- a/src/core/README.md +++ b/src/core/README.md @@ -5,18 +5,18 @@ Core application module providing CLI interface and business logic functionality ## 📁 Structure ``` -src/ -├── clients/ # HTTP clients and external integrations -├── commands/ # CLI command implementations -├── config/ # Configuration management -│ ├── config.yaml # Application configuration -│ └── logger_config.py -├── exceptions/ # Custom exception classes -├── models/ # Data models and schemas -│ └── config.py # Settings and configuration models -├── services/ # Business logic services -├── utils/ # Core utilities -└── main.py # Application entry point + src/ + ├── core/ # Core module source code + │ ├── clients/ # HTTP clients and external integrations + │ ├── commands/ # CLI command implementations + │ ├── config/ # Configuration management + │ ├── core/ # Core functionality + │ ├── exceptions/ # Custom exception classes + │ ├── models/ # Data models and schemas + │ ├── services/ # Business logic services + │ ├── utils/ # Core utilities + │ └── main.py # Application entry point + └── tests/ # Core module tests ``` ## 🚀 Usage diff --git a/src/core/pyproject.toml b/src/core/pyproject.toml index 9d0d381..711610f 100644 --- a/src/core/pyproject.toml +++ b/src/core/pyproject.toml @@ -24,8 +24,5 @@ core = "core.main:entrypoint" requires = ["hatchling"] build-backend = "hatchling.build" -[tool.hatch.build.targets.wheel] -packages = ["core"] - [tool.uv.sources] utils = { workspace = true } diff --git a/src/core/core/__init__.py b/src/core/src/core/__init__.py similarity index 100% rename from src/core/core/__init__.py rename to src/core/src/core/__init__.py diff --git a/src/core/core/clients/__init__.py b/src/core/src/core/clients/__init__.py similarity index 100% rename from src/core/core/clients/__init__.py rename to src/core/src/core/clients/__init__.py diff --git a/src/core/core/clients/http_client.py b/src/core/src/core/clients/http_client.py similarity index 100% rename from src/core/core/clients/http_client.py rename to src/core/src/core/clients/http_client.py diff --git a/src/core/core/commands/__init__.py b/src/core/src/core/commands/__init__.py similarity index 100% rename from src/core/core/commands/__init__.py rename to src/core/src/core/commands/__init__.py diff --git a/src/core/core/commands/user_commands.py b/src/core/src/core/commands/user_commands.py similarity index 100% rename from src/core/core/commands/user_commands.py rename to src/core/src/core/commands/user_commands.py diff --git a/src/core/core/config/__init__.py b/src/core/src/core/config/__init__.py similarity index 100% rename from src/core/core/config/__init__.py rename to src/core/src/core/config/__init__.py diff --git a/src/core/core/config/config.yaml b/src/core/src/core/config/config.yaml similarity index 100% rename from src/core/core/config/config.yaml rename to src/core/src/core/config/config.yaml diff --git a/src/core/core/config/logger_config.py b/src/core/src/core/config/logger_config.py similarity index 100% rename from src/core/core/config/logger_config.py rename to src/core/src/core/config/logger_config.py diff --git a/src/core/core/config/registry.py b/src/core/src/core/config/registry.py similarity index 100% rename from src/core/core/config/registry.py rename to src/core/src/core/config/registry.py diff --git a/src/core/core/exceptions/__init__.py b/src/core/src/core/exceptions/__init__.py similarity index 100% rename from src/core/core/exceptions/__init__.py rename to src/core/src/core/exceptions/__init__.py diff --git a/src/core/core/main.py b/src/core/src/core/main.py similarity index 100% rename from src/core/core/main.py rename to src/core/src/core/main.py diff --git a/src/core/core/models/__init__.py b/src/core/src/core/models/__init__.py similarity index 100% rename from src/core/core/models/__init__.py rename to src/core/src/core/models/__init__.py diff --git a/src/core/core/models/config.py b/src/core/src/core/models/config.py similarity index 94% rename from src/core/core/models/config.py rename to src/core/src/core/models/config.py index bf307b3..63b3021 100644 --- a/src/core/core/models/config.py +++ b/src/core/src/core/models/config.py @@ -30,7 +30,7 @@ def __init__(self): path = Path(__file__).parent.parent config_path = path / "config" / "config.yaml" - load_dotenv(dotenv_path=path.parent / ".env") + load_dotenv(dotenv_path=path.parent.parent / ".env") if not config_path.exists(): raise FileNotFoundError(f"Config file not found: {config_path}") diff --git a/src/core/core/models/user.py b/src/core/src/core/models/user.py similarity index 100% rename from src/core/core/models/user.py rename to src/core/src/core/models/user.py diff --git a/src/core/core/services/__init__.py b/src/core/src/core/services/__init__.py similarity index 100% rename from src/core/core/services/__init__.py rename to src/core/src/core/services/__init__.py diff --git a/src/core/core/services/user_service.py b/src/core/src/core/services/user_service.py similarity index 100% rename from src/core/core/services/user_service.py rename to src/core/src/core/services/user_service.py diff --git a/src/core/core/utils/__init__.py b/src/core/src/core/utils/__init__.py similarity index 100% rename from src/core/core/utils/__init__.py rename to src/core/src/core/utils/__init__.py diff --git a/tests/shared/utils/test_return_one.py b/src/core/tests/test_return_one.py similarity index 100% rename from tests/shared/utils/test_return_one.py rename to src/core/tests/test_return_one.py diff --git a/tests/conftest.py b/tests/conftest.py deleted file mode 100644 index e69de29..0000000