Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move version from pyproject.toml to __init__ #132

Merged
merged 2 commits into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions molpipeline/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@
SetDefaultPickleProperties(PropertyPickleOptions.AllProps)

__all__ = [
"__version__",
"Pipeline",
"ErrorFilter",
"FilterReinserter",
"PostPredictionWrapper",
]

__version__ = "0.9.2"
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
dynamic = ["dependencies", "optional-dependencies"]
dynamic = ["dependencies", "optional-dependencies", "version"]
name = "molpipeline"
authors = [
{name = "Christian W. Feldmann"},
{name = "Jennifer Hemmerich"},
{name = "Jochen Sieg"}
]
description = "Integration of rdkit functionality into sklearn pipelines."
version = "0.9.2"
readme = "README.md"

[tool.setuptools.dynamic]
dependencies = {file = "requirements.txt"}
version = {attr = "molpipeline.__version__"}

[tool.setuptools.dynamic.optional-dependencies]
all = {file = ["requirements_chemprop.txt", "requirements_notebooks.txt"]}
Expand Down
19 changes: 19 additions & 0 deletions tests/test_init.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""Test functionality set at package init."""

import unittest

from molpipeline import __version__


class TestInit(unittest.TestCase):
"""Test functionality set at package init."""

def test_version(self) -> None:
"""Test that the package has a version."""
self.assertIsInstance(__version__, str)
splitted = __version__.split(".")
self.assertEqual(len(splitted), 3)
major, minor, patch = splitted
self.assertTrue(major.isdigit())
self.assertTrue(minor.isdigit())
self.assertTrue(patch.isdigit())