Skip to content

Commit

Permalink
refactor: Better, more automated versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasbenb committed Nov 23, 2024
1 parent 40f89ca commit e2425a5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "TorBox"
version = "0.1.0"
version = "0.1.0-alpha.0"
description = "Python wrapper for the TorBox API"
readme = "README.md"
authors = [
Expand Down
3 changes: 1 addition & 2 deletions torbox/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
__all__ = ["__version__", "TorBox"]
__all__ = ["TorBox"]

from .version import __version__ as __version__ # noqa: I001
from .client import TorBox as TorBox
5 changes: 3 additions & 2 deletions torbox/services/base.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import importlib.metadata
import time
from typing import Any, Dict

import requests
from typing_extensions import Optional

from torbox.version import __version__
_VERSION = importlib.metadata.version("torbox")


class TorBoxError(Exception):
Expand Down Expand Up @@ -43,7 +44,7 @@ def __init__(
self._session.headers.update(
{
"Authorization": f"Bearer {self._api_key}",
"User-Agent": f"TorBox.py/{__version__}",
"User-Agent": f"TorBox.py/{_VERSION}",
}
)

Expand Down
1 change: 0 additions & 1 deletion torbox/version.py

This file was deleted.

0 comments on commit e2425a5

Please sign in to comment.