mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-25 04:02:45 +01:00
setup: remove rolling package versions
This makes 'reload' after commit impossible, for example, because each version is installed in a separate folder. Also, versions from 'git describe' aren't compatible with PEP 440.
(cherry picked from commit bda39b4838
)
This commit is contained in:
parent
c8ec2d9600
commit
b9e00c7261
16
setup.py
16
setup.py
@ -9,20 +9,20 @@ import subprocess
|
||||
from os import path
|
||||
|
||||
# Get version from Git tags.
|
||||
try:
|
||||
version = subprocess.check_output(['git', 'describe', '--tags']).decode('utf-8').strip()
|
||||
except Exception as e:
|
||||
print('ERROR: Failed to get version from "git describe --tags": %s: %s' % (type(e).__name__, e))
|
||||
with open('VERSION', encoding='utf-8') as f:
|
||||
version = f.read().strip()
|
||||
|
||||
with open('VERSION') as f:
|
||||
fallback_version = f.read().strip()
|
||||
print('Using fallback version of %r.' % fallback_version)
|
||||
version = fallback_version
|
||||
try:
|
||||
real_version = subprocess.check_output(['git', 'describe', '--tags']).decode('utf-8').strip()
|
||||
except Exception as e:
|
||||
print('ERROR: Failed to get Git version from "git describe --tags": %s: %s' % (type(e).__name__, e))
|
||||
real_version = version + '-dirty'
|
||||
|
||||
# Write the version to disk.
|
||||
with open('__init__.py', 'w') as f:
|
||||
f.write('# Automatically generated by setup.py\n')
|
||||
f.write('__version__ = %r\n' % version)
|
||||
f.write('real_version = %r\n' % real_version)
|
||||
|
||||
curdir = path.abspath(path.dirname(__file__))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user