diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index df62af4..f6aa589 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -20,6 +20,7 @@ "mosapride.zenkaku", "ms-azuretools.vscode-docker", "ms-python.python", + "ms-python.vscode-pylance", "njpwerner.autodocstring", "redhat.vscode-yaml", "shardulm94.trailing-spaces", diff --git a/.vscode/extensions.json b/.vscode/extensions.json index a4ca668..e45d391 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -8,6 +8,7 @@ "mosapride.zenkaku", "ms-azuretools.vscode-docker", "ms-python.python", + "ms-python.vscode-pylance", "ms-vscode-remote.remote-containers", "njpwerner.autodocstring", "oderwat.indent-rainbow", diff --git a/README.md b/README.md index 8355bfc..59d1bdf 100644 --- a/README.md +++ b/README.md @@ -189,7 +189,7 @@ uv add {libraries} │ │ └── type.py │ ├── trace/ │ │ ├── __init__.py -│ │ └── time.py +│ │ └── timer.py │ └── __init__.py ├── .dockerignore ├── .env.local diff --git a/docs/guides/tools/logger.md b/docs/guides/tools/logger.md index 081e83f..9ba5f56 100644 --- a/docs/guides/tools/logger.md +++ b/docs/guides/tools/logger.md @@ -1,5 +1,5 @@ ```python -from tools.logger import Logger +from tools import Logger def main() -> None: diff --git a/docs/index.md b/docs/index.md index 76d0367..2597768 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,7 +1,8 @@ # Welcome to python-uv ## What is python-uv? -This repository contains configurations to set up a Python development environment using VSCode's Dev Container feature. The environment includes uv and Ruff. +This repository contains configurations to set up a Python development environment using VSCode's Dev Container feature. +The environment includes uv and Ruff. @@ -45,7 +46,7 @@ This repository contains configurations to set up a Python development environme │ │ └── type.py │ ├── trace/ │ │ ├── __init__.py - │ │ └── time.py + │ │ └── timer.py │ └── __init__.py ├── .dockerignore ├── .env.local diff --git a/pyproject.toml b/pyproject.toml index 6f7b192..1c6edf4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,3 +25,10 @@ dev-dependencies = [ "pytest-cov>=6.0.0", "ruff>=0.9.2", ] + +[tool.hatch.build.targets.wheel] +packages = ["tools"] + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" diff --git a/tools/__init__.py b/tools/__init__.py index 688ed87..2dbd3da 100644 --- a/tools/__init__.py +++ b/tools/__init__.py @@ -1 +1,7 @@ """Tools.""" + +from tools.logger import Logger + +__all__ = [ + "Logger", +] diff --git a/tools/trace/timer.py b/tools/trace/timer.py index 2ab220c..50ad710 100644 --- a/tools/trace/timer.py +++ b/tools/trace/timer.py @@ -45,7 +45,7 @@ def __exit__(self, *exc: object) -> None: """Run when exit ContextManager or Decoraotr.""" self.end = time.time() - from tools.logger import Logger + from tools import Logger logger = Logger(self.name) logger.debug("executed in %f ms", self._duration * 1_000) diff --git a/uv.lock b/uv.lock index 52359da..882bd84 100644 --- a/uv.lock +++ b/uv.lock @@ -245,7 +245,7 @@ toml = [ [[package]] name = "default" version = "0.1.0" -source = { virtual = "." } +source = { editable = "." } dependencies = [ { name = "google-cloud-logging" }, { name = "pydantic" },