Skip to content

Commit

Permalink
Implemented the versioning information in terms of __version__;
Browse files Browse the repository at this point in the history
  • Loading branch information
trystyncote committed Jan 20, 2024
1 parent 9a68bac commit a162b31
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
7 changes: 4 additions & 3 deletions scrivid/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
create_image_reference, define_properties, FileReference, HideAdjustment, ImageFileReference, ImageReference,
MoveAdjustment, Properties, ShowAdjustment, VisibilityStatus
)
from ._version import __version__, __version_tuple__
from ._video_crafting import compile_video
from .metadata import Metadata


__all__ = [
"compile_video", "create_image_reference", "define_properties", "errors", "FileReference", "HideAdjustment",
"ImageFileReference", "ImageReference", "Metadata", "motion_tree", "MoveAdjustment", "Properties", "qualms",
"ShowAdjustment", "VisibilityStatus"
"__version__", "__version_tuple__", "compile_video", "create_image_reference", "define_properties", "errors",
"FileReference", "HideAdjustment", "ImageFileReference", "ImageReference", "Metadata", "motion_tree",
"MoveAdjustment", "Properties", "qualms", "ShowAdjustment", "VisibilityStatus"
]
2 changes: 2 additions & 0 deletions scrivid/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__version__ = "0.2.0"
__version_tuple__ = (0, 2, 0)
5 changes: 4 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[metadata]
name = scrivid
version = 0.2.0
version = attr: scrivid._version.__version__ # Instantiating it as
# `scrivid.__version__` results in so many shaky imports from the root-level
# `__init__.py`, that it's just easier to get directly, even though it's
# "protected".
description = A Python library to create instructions for a generated video.
author = Trystyn Coté
license = MIT
Expand Down
23 changes: 23 additions & 0 deletions tests/test_package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import scrivid

import importlib.metadata

import pytest


def convert_package_version_to_tuple(package_version):
return tuple(int(element) for element in package_version.split("."))


@pytest.fixture
def package_version():
yield importlib.metadata.version("scrivid")


def test_package_version(package_version):
assert scrivid.__version__ == package_version


def test_package_version_tuple(package_version):
package_version = convert_package_version_to_tuple(package_version)
assert scrivid.__version_tuple__ == package_version

0 comments on commit a162b31

Please sign in to comment.