Skip to content
Open
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
6 changes: 3 additions & 3 deletions .github/scripts/update_version.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
version_file="assets/version.txt"
init_file="torchtitan/__init__.py"
pyproject_file="pyproject.toml"
if [[ -n "$BUILD_VERSION" ]]; then
# Update the version in version.txt
echo "$BUILD_VERSION" > "$version_file"
# Create a variable named __version__ at the end of __init__.py
echo "__version__ = \"$BUILD_VERSION\"" >> "$init_file"
# Replace dynamic version with fixed version in pyproject.toml
sed -i '' 's/dynamic = \["version"\]/version = "'"$BUILD_VERSION"'"/' "$pyproject_file"
else
echo "Error: BUILD_VERSION environment variable is not set or empty."
exit 1
Expand Down
1 change: 0 additions & 1 deletion assets/version.txt

This file was deleted.

2 changes: 1 addition & 1 deletion docs/release.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Stable Releases
Currently we follow a lightweight release process.
- Update the version number in `assets/version.txt` with a PR. The version numbering should follow https://semver.org/.
- Pick a version for the release. The version numbering should follow https://semver.org/.
- E.g. for a pre-release `0.y.z`
- if major features are added, increment `y`
- if minor fixes are added, increment `z`
Expand Down
13 changes: 9 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,27 @@ dev = [
"expecttest", # test_tokenizer
]

[tool.setuptools.dynamic]
version = {file = "assets/version.txt"}

[tool.codespell]
skip = ["*.json"]
ignore-words-list = ["assertin", "datas" ,"indx", "inpt", "nd", "socio-economic"]

# ---- Explicit project build information ---- #
[build-system]
requires = ["setuptools>=61.0"]
requires = ["setuptools>=61.0", "versioningit>=3.3"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
where = [""]
include = ["torchtitan*"]

[tool.versioningit.tag2version]
rmprefix = "v"

[tool.versioningit.format]
distance = "{base_version}+git{rev}"
dirty = "{base_version}+git{rev}.dirty"
distance-dirty = "{base_version}+git{rev}.dirty"

[tool.pytest.ini_options]
addopts = ["--showlocals"] # show local variables in tracebacks
testpaths = ["tests"]
Loading