Skip to content

Commit

Permalink
python: package version is not dynamically taken from __version__
Browse files Browse the repository at this point in the history
Close #551.
  • Loading branch information
reyammer committed Sep 9, 2024
1 parent 66e1134 commit 6cf77a5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[project]
name = "magika"
version = "0.6.0-dev0"
description = "A tool to determine the content type of a file with deep learning"
authors = [
{author = "Magika Developers", email = "[email protected]"},
]
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.8"
dynamic = ["version"]

dependencies = [
"click>=8.1.7",
Expand All @@ -33,6 +33,9 @@ dev-dependencies = [
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.version]
path = "src/magika/__init__.py"

[tool.ruff.lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
Expand Down
3 changes: 3 additions & 0 deletions python/src/magika/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
# limitations under the License.


__version__ = "0.6.0-dev0"


import dotenv

from magika import magika
Expand Down
7 changes: 7 additions & 0 deletions python/tests/test_magika_python_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
from tests import utils


@pytest.mark.smoketest
def test_magika_module_check_version() -> None:
import magika as magika_module

assert isinstance(magika_module.__version__, str)


@pytest.mark.smoketest
def test_magika_module_one_basic_test() -> None:
model_dir = utils.get_default_model_dir()
Expand Down

0 comments on commit 6cf77a5

Please sign in to comment.