plugin that provides a custom version scheme using UTC timestamps for development versions.
Project description
hatch-timestamp-version
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-YYYYMMDDlong-YYYYMMDDHHMMSS(default)- Custom strftime formats like
%Y%m%d%H%M
$ hatch version
2.0.4.dev20250526231209
🧾 Changelog
See CHANGELOG.md
🙏 Credits
- Inspired by Simon Willison's work.
📄 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hatch_timestamp_version-0.0.8.tar.gz.
File metadata
- Download URL: hatch_timestamp_version-0.0.8.tar.gz
- Upload date:
- Size: 72.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78df438a1310ed9f786e66a455a040fb2909d4d20ce30d1d42f12b0230790752
|
|
| MD5 |
9869bd834054ab8331859c4d3040d753
|
|
| BLAKE2b-256 |
b499c4b4540ad216ca2bb86aaa837d79f426eaf1dec82105884b834cd6bcec52
|
File details
Details for the file hatch_timestamp_version-0.0.8-py3-none-any.whl.
File metadata
- Download URL: hatch_timestamp_version-0.0.8-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c05f5d73be686eebe1da8ba691626123a1a81267a591cc92235b186a20ea1efa
|
|
| MD5 |
f80bb6c36f548fddbd07a961054df4bc
|
|
| BLAKE2b-256 |
0418d211eab27d55efe2fda49c2686c456f828abc9dd82fbde0cfec928f4d566
|