Skip to content

Commit c71bfb4

Browse files
authored
fix and modernize packaging (#211)
1 parent eccace6 commit c71bfb4

File tree

5 files changed

+97
-65
lines changed

5 files changed

+97
-65
lines changed

.github/workflows/publish-to-test-pypi.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,18 @@ jobs:
1010
runs-on: ubuntu-22.04
1111
steps:
1212
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
1315
- name: Set up Python 3.x
1416
uses: actions/setup-python@v5
1517
with:
1618
python-version: '3.x'
17-
- name: Install pypa/build
19+
- name: Install dependencies
1820
run: >-
1921
python -m
2022
pip install
2123
build
24+
setuptools_scm
2225
--user
2326
- name: Build a binary wheel and a source tarball
2427
run: >-

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,42 @@ my_uuid = uuid.UUID(hex="C232AB00-9414-11EC-B3C8-9E6BDECED846")
3838
assert uuid6.uuid1_to_uuid6(my_uuid) == uuid.UUID(hex="1EC9414C-232A-6B00-B3C8-9E6BDECED846")
3939
```
4040

41+
# Versioning
42+
43+
> **Important Notice:** Starting with version `2025.0.0`, this project will transition from Calendar Versioning (YYYY.MM.DD) to Semantic Versioning (MAJOR.MINOR.PATCH).
44+
45+
### Version Scheme
46+
47+
- **Before 2025.0.0**: Calendar Versioning (e.g., `2024.07.10`)
48+
- **2025.0.0 and after**: Semantic Versioning where:
49+
- **MAJOR**: Breaking changes
50+
- **MINOR**: New features (backward compatible)
51+
- **PATCH**: Bug fixes (backward compatible)
52+
53+
### For Dependency Management
54+
55+
- Requirements like `>=2024.07.10` will continue to work with newer versions
56+
- For the latest features, specify `>=2025.0.0`
57+
58+
### Release Process
59+
60+
Version numbers are managed automatically via Git tags.
61+
62+
1. Maintainers create a new tag following the version scheme:
63+
```bash
64+
git tag <version>
65+
git tag 2025.0.0 # First SemVer release
66+
git tag 2025.1.0 # Feature release
67+
git tag 2025.0.1 # Bug fix release
68+
```
69+
70+
2. Push the tag to GitHub
71+
```bash
72+
git push origin <version>
73+
```
74+
75+
3. GitHub Actions will build and publish the package to PyPI
76+
4177
## Which UUID version should I use?
4278

4379
> Implementations SHOULD utilize UUID version 7 over UUID version 1 and 6 if possible.

pyproject.toml

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,58 @@
11
[build-system]
2-
requires = ["setuptools", "wheel"]
2+
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2", "wheel"]
3+
build-backend = "setuptools.build_meta"
34

45
[tool.coverage.run]
56
branch = true
67
source = ["src/"]
78

89
[tool.mypy]
910
files = ["*.py", "test/", "src/"]
11+
12+
[project]
13+
name = "uuid6"
14+
dynamic = ["version"]
15+
description = "New time-based UUID formats which are suited for use as a database key"
16+
readme = "README.md"
17+
authors = [
18+
{name = "Oittaa"}
19+
]
20+
requires-python = ">=3.9"
21+
license = {text = "MIT"}
22+
classifiers = [
23+
"Development Status :: 4 - Beta",
24+
"Intended Audience :: Developers",
25+
"License :: OSI Approved :: MIT License",
26+
"Operating System :: OS Independent",
27+
"Programming Language :: Python",
28+
"Programming Language :: Python :: 3",
29+
"Programming Language :: Python :: 3.9",
30+
"Programming Language :: Python :: 3.10",
31+
"Programming Language :: Python :: 3.11",
32+
"Programming Language :: Python :: 3.12",
33+
"Programming Language :: Python :: 3.13",
34+
]
35+
keywords = [
36+
"uuid",
37+
"uuid6",
38+
"uuid7",
39+
"uuid8",
40+
"uuidv6",
41+
"uuidv7",
42+
"uuidv8",
43+
]
44+
45+
[project.urls]
46+
"Homepage" = "https://github.com/oittaa/uuid6-python"
47+
"Bug Tracker" = "https://github.com/oittaa/uuid6-python/issues"
48+
49+
[tool.setuptools]
50+
package-dir = {"" = "src"}
51+
52+
[tool.setuptools.packages.find]
53+
where = ["src"]
54+
55+
[tool.setuptools.package-data]
56+
"*" = ["py.typed"]
57+
58+
[tool.setuptools_scm]

setup.py

Lines changed: 0 additions & 63 deletions
This file was deleted.

src/uuid6/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44
generating version 6, 7, and 8 UUIDs as specified in RFC 9562.
55
"""
66

7+
# Get version
8+
try:
9+
from ._version import version as __version__
10+
except ImportError:
11+
__version__ = "0.0.0.dev0"
12+
13+
714
import secrets
815
import time
916
import uuid

0 commit comments

Comments
 (0)