Skip to content
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
2 changes: 1 addition & 1 deletion cccv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
SOFTWARE.
"""

__version__ = "0.0.3"
__version__ = "0.0.4"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To avoid potential inconsistencies between pyproject.toml and this file, it's a good practice to define the version number in a single place. pyproject.toml is a good candidate for this single source of truth.

You can dynamically read the version from the installed package metadata in __init__.py. This way, you only need to update the version in pyproject.toml for future releases.

Since your project requires Python >= 3.9, you can use the standard importlib.metadata library. Here's an example of how you could implement this:

# In cccv/__init__.py, instead of the hardcoded __version__
from importlib.metadata import PackageNotFoundError, version

try:
    __version__ = version("cccv")
except PackageNotFoundError:
    # The package is not installed, which can happen in development.
    # Fallback to a development version.
    __version__ = "0.0.0-dev"

Adopting this pattern will make your release process more robust and less error-prone.


from cccv.arch import ARCH_REGISTRY
from cccv.auto import AutoConfig, AutoModel
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ license = "MIT"
name = "cccv"
readme = "README.md"
requires-python = ">=3.9, <4"
version = "0.0.3"
version = "0.0.4"

[project.urls]
Homepage = "https://github.com/EutropicAI/cccv"
Expand Down
Loading