/usr/lib/python2.7/dist-packages/setuptools_scm/integration.py is in python-setuptools-scm 1.15.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | import os
from .version import _warn_if_setuptools_outdated
from .utils import do
from .discover import find_matching_entrypoint
from . import get_version
def version_keyword(dist, keyword, value):
_warn_if_setuptools_outdated()
if not value:
return
if value is True:
value = {}
if getattr(value, '__call__', None):
value = value()
if os.path.exists('PKG-INFO'):
value.pop('root', None)
dist.metadata.version = get_version(**value)
def find_files(path='.'):
if not path:
path = '.'
abs = os.path.abspath(path)
ep = find_matching_entrypoint(abs, 'setuptools_scm.files_command')
if ep:
command = ep.load()
try:
if isinstance(command, str):
return do(ep.load(), path).splitlines()
else:
return command(path)
except Exception:
import traceback
print("File Finder Failed for %s" % ep)
traceback.print_exc()
return []
else:
return []
|