Skip to content

Commit e2425a5

Browse files
committed
refactor: Better, more automated versioning
1 parent 40f89ca commit e2425a5

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "TorBox"
7-
version = "0.1.0"
7+
version = "0.1.0-alpha.0"
88
description = "Python wrapper for the TorBox API"
99
readme = "README.md"
1010
authors = [

torbox/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
__all__ = ["__version__", "TorBox"]
1+
__all__ = ["TorBox"]
22

3-
from .version import __version__ as __version__ # noqa: I001
43
from .client import TorBox as TorBox

torbox/services/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
import importlib.metadata
12
import time
23
from typing import Any, Dict
34

45
import requests
56
from typing_extensions import Optional
67

7-
from torbox.version import __version__
8+
_VERSION = importlib.metadata.version("torbox")
89

910

1011
class TorBoxError(Exception):
@@ -43,7 +44,7 @@ def __init__(
4344
self._session.headers.update(
4445
{
4546
"Authorization": f"Bearer {self._api_key}",
46-
"User-Agent": f"TorBox.py/{__version__}",
47+
"User-Agent": f"TorBox.py/{_VERSION}",
4748
}
4849
)
4950

torbox/version.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)