Skip to content

Commit

Permalink
fix: remove _version.py
Browse files Browse the repository at this point in the history
  • Loading branch information
phi-friday committed Feb 23, 2024
1 parent 36437b6 commit 2a1dd91
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
- name: Install dependencies
run: |
VERSION=$(dunamai from any --no-metadata --style pep440)
poetry version $VERSION
poetry install --with=docs
- name: Create docs
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ jobs:
run: |
VERSION=$(dunamai from any --no-metadata --style pep440)
poetry version $VERSION
echo "from __future__ import annotations
__version__: str = \"$VERSION\"" > \
src/async_wrapper/_version.py
poetry build
- name: Release to PyPI
Expand Down
15 changes: 14 additions & 1 deletion src/async_wrapper/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

from ._version import __version__ # noqa: F401
from typing import Any

from .convert import async_to_sync, sync_to_async, toggle_func
from .queue import Queue, create_queue
from .task_group import TaskGroupWrapper, create_task_group_wrapper
Expand All @@ -18,3 +19,15 @@
"create_queue",
"wait_for",
]

__version__: str


def __getattr__(name: str) -> Any: # pragma: no cover
from importlib.metadata import version

if name == "__version__":
return version("async_wrapper")

error_msg = f"The attribute named {name!r} is undefined."
raise AttributeError(error_msg)
3 changes: 0 additions & 3 deletions src/async_wrapper/_version.py

This file was deleted.

0 comments on commit 2a1dd91

Please sign in to comment.