Skip to main content

plugin that provides a custom version scheme using UTC timestamps for development versions.

Project description

hatch-timestamp-version

PyPI version Python versions CI Coverage License: MIT Code Style: Black Lint: Ruff Typing: mypy

A hatch plugin that provides a custom version scheme using UTC timestamps for development versions. It is based on top of hatch-vcs.

🚀 Why this project exists

I have CI continuously deploy to 'Test PyPI' and I want packages to have the datetime as dev versions.

Eg: reelname-2.0.4.dev20250526231209-py3-none-any.whl

📐 Requirements

  • Python >= 3.9

📦 Installation

pip install hatch-timestamp-version

🧪 Usage

In your pyproject.toml:

[build-system]
requires = ["hatchling", "hatch-timestamp-version>=0.0.5"]
build-backend = "hatchling.build"

[tool.hatch.version]
path = "yourpkg/_version.py"
source = "vcs-dev-timestamp"
validate-bump = true

[tool.hatch.version.raw-options]
local_scheme = "no-local-version"
timestamp_format = "short"  # or "long" for full datetime or any strftime string like "%Y%m%d%H%M"

🛠️ Features

  • Uses datetime for the dev versions, when used with hatch-vcs
  • Supports three options for timestamp format:
    • short - YYYYMMDD
    • long - YYYYMMDDHHMMSS (default)
    • Custom strftime formats like %Y%m%d%H%M
$ hatch version
2.0.4.dev20250526231209

🧾 Changelog

See CHANGELOG.md

🙏 Credits

📄 License

MIT © Visesh Prasad

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hatch_timestamp_version-0.0.8.tar.gz (72.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hatch_timestamp_version-0.0.8-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file hatch_timestamp_version-0.0.8.tar.gz.

File metadata

File hashes

Hashes for hatch_timestamp_version-0.0.8.tar.gz
Algorithm Hash digest
SHA256 78df438a1310ed9f786e66a455a040fb2909d4d20ce30d1d42f12b0230790752
MD5 9869bd834054ab8331859c4d3040d753
BLAKE2b-256 b499c4b4540ad216ca2bb86aaa837d79f426eaf1dec82105884b834cd6bcec52

See more details on using hashes here.

File details

Details for the file hatch_timestamp_version-0.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for hatch_timestamp_version-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c05f5d73be686eebe1da8ba691626123a1a81267a591cc92235b186a20ea1efa
MD5 f80bb6c36f548fddbd07a961054df4bc
BLAKE2b-256 0418d211eab27d55efe2fda49c2686c456f828abc9dd82fbde0cfec928f4d566

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page