From 3d989d43800dbf17057bdc7240a30d8ddfc98c1f Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Tue, 30 Jul 2024 09:50:28 -0700 Subject: [PATCH 1/2] Expose torchcodec.__version__ attribute --- docs/source/conf.py | 4 ++-- pyproject.toml | 5 ++++- src/torchcodec/__init__.py | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 1524563a1..306e95bb4 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -30,6 +30,7 @@ import sys import pytorch_sphinx_theme +import torchcodec sys.path.append(os.path.abspath(".")) @@ -97,8 +98,7 @@ # source_suffix = [".rst"] -# TODO_BEFORE_RELEASE: Indicate version number here -html_title = "TorchCodec Documentation" +html_title = f"TorchCodec {torchcodec.__version__} Documentation" # The master toctree document. master_doc = "index" diff --git a/pyproject.toml b/pyproject.toml index 9871a54ed..96a275684 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,5 @@ [project] name = "TorchCodec" -version = "0.0.1.dev" description = "A video decoder for PyTorch" readme = "README.md" requires-python = ">=3.8" @@ -8,11 +7,15 @@ license = {file = "LICENSE"} authors = [ { name = "PyTorch Team", email = "packages@pytorch.org" }, ] +dynamic = ["version"] [project.urls] GitHub = "https://github.com/pytorch/torchcodec" Documentation = "https://pytorch.org/torchcodec/stable/index.html" +[tool.setuptools.dynamic] +version = {attr = "package.__version__"} + [build-system] requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" diff --git a/src/torchcodec/__init__.py b/src/torchcodec/__init__.py index 292e5d164..ff3f048d0 100644 --- a/src/torchcodec/__init__.py +++ b/src/torchcodec/__init__.py @@ -5,3 +5,5 @@ # LICENSE file in the root directory of this source tree. from . import decoders # noqa + +__version__ = "0.0.1.dev" From 710615a2c7204615d234a74e5a3ef87c21b263a0 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Tue, 30 Jul 2024 09:53:36 -0700 Subject: [PATCH 2/2] fix? --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 96a275684..be9d9461f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ GitHub = "https://github.com/pytorch/torchcodec" Documentation = "https://pytorch.org/torchcodec/stable/index.html" [tool.setuptools.dynamic] -version = {attr = "package.__version__"} +version = {attr = "torchcodec.__version__"} [build-system] requires = ["setuptools>=61.0"]