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
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@


def get_version():
# get version string from version.py
# TODO: ideally the version.py should be generated when setup is run
version_file = os.path.join(os.path.dirname(__file__), "torchx/version.py")
version_regex = r"__version__ = ['\"]([^'\"]*)['\"]"
# get version string from _version.py
version_file = os.path.join(os.path.dirname(__file__), "torchx/_version.py")
version_regex = r"BASE_VERSION = ['\"]([^'\"]*)['\"]"
with open(version_file, "r") as f:
version = re.search(version_regex, f.read(), re.M).group(1)
return version
Expand Down
8 changes: 8 additions & 0 deletions torchx/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

# pyre-strict
BASE_VERSION = "0.8.0dev0"
4 changes: 2 additions & 2 deletions torchx/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
Expand All @@ -7,6 +6,7 @@

# pyre-strict

from torchx._version import BASE_VERSION
from torchx.util.entrypoints import load

# Follows PEP-0440 version scheme guidelines
Expand All @@ -18,7 +18,7 @@
# 0.1.0bN # Beta release
# 0.1.0rcN # Release Candidate
# 0.1.0 # Final release
__version__ = "0.8.0dev0"
__version__: str = BASE_VERSION


# Use the github container registry images corresponding to the current package
Expand Down
Loading