Skip to content

Commit

Permalink
Move version definition from setup.py to version.txt (#3202)
Browse files Browse the repository at this point in the history
  • Loading branch information
datumbox authored Dec 22, 2020
1 parent af5cb00 commit ca6fdd6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ def get_dist(pkgname):
return None


version = '0.9.0a0'
cwd = os.path.dirname(os.path.abspath(__file__))

version_txt = os.path.join(cwd, 'version.txt')
with open(version_txt, 'r') as f:
version = f.readline().strip()
sha = 'Unknown'
package_name = 'torchvision'

cwd = os.path.dirname(os.path.abspath(__file__))

try:
sha = subprocess.check_output(['git', 'rev-parse', 'HEAD'], cwd=cwd).decode('ascii').strip()
except Exception:
Expand Down
1 change: 1 addition & 0 deletions version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.9.0a0

0 comments on commit ca6fdd6

Please sign in to comment.