Skip to content

Commit

Permalink
Use setuptools_scm for versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
rmartin16 committed Nov 6, 2023
1 parent 20505eb commit 2182303
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
14 changes: 5 additions & 9 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,20 @@
#
import os
import sys
from configparser import ConfigParser
from datetime import datetime
from importlib.metadata import version as metadata_version

base_path = os.path.abspath("../..")
sys.path.insert(0, os.path.join(base_path, "src"))

setup_cfg = ConfigParser()
setup_cfg.read(os.path.join(base_path, "setup.cfg"))


# -- Project information -----------------------------------------------------
project = setup_cfg["metadata"]["name"]
copyright = "{}, {}".format(datetime.today().year, setup_cfg["metadata"]["author"])
author = setup_cfg["metadata"]["author"]
project = "qbittorrent-api"
author = "Russell Martin"
copyright = f"{datetime.today().year}, {author}"

# The full version, including alpha/beta/rc tags
version = release = "v" + setup_cfg["metadata"]["version"]

release = metadata_version("qbittorrent-api")

# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be extensions coming
Expand Down
8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[build-system]
requires = ["setuptools >=61"]
requires = ["setuptools >=64", "setuptools-scm >=8"]
build-backend = "setuptools.build_meta"

[project]
name = "qbittorrent-api"
version = "2023.10.54"
requires-python = ">=3.8"
description = "Python client for qBittorrent v4.1+ Web API."
authors = [{name = "Russell Martin"}]
Expand All @@ -28,7 +27,7 @@ classifiers = [
"Topic :: Utilities",
"Topic :: Communications :: File Sharing",
]
dynamic = ["readme"]
dynamic = ["readme", "version"]
dependencies = [
"requests >= 2.16.0",
"urllib3 >= 1.24.2",
Expand Down Expand Up @@ -63,6 +62,9 @@ dev = [
[tool.setuptools.dynamic]
readme = {file = ["README.md", "CHANGELOG.md", "LICENSE"], content-type = "text/markdown"}

[tool.setuptools_scm]
# section must be present to trigger its use

[tool.isort]
profile = "black"
skip_glob = ["venv*"]
Expand Down

0 comments on commit 2182303

Please sign in to comment.