Skip to content

Commit ca6fdd6

Browse files
authored
Move version definition from setup.py to version.txt (#3202)
1 parent af5cb00 commit ca6fdd6

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

setup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ def get_dist(pkgname):
2929
return None
3030

3131

32-
version = '0.9.0a0'
32+
cwd = os.path.dirname(os.path.abspath(__file__))
33+
34+
version_txt = os.path.join(cwd, 'version.txt')
35+
with open(version_txt, 'r') as f:
36+
version = f.readline().strip()
3337
sha = 'Unknown'
3438
package_name = 'torchvision'
3539

36-
cwd = os.path.dirname(os.path.abspath(__file__))
37-
3840
try:
3941
sha = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=cwd).decode('ascii').strip()
4042
except Exception:

version.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.9.0a0

0 commit comments

Comments
 (0)