commit python-setuptools_scm for openSUSE:Factory
Hello community, here is the log from the commit of package python-setuptools_scm for openSUSE:Factory checked in at 2018-03-29 11:48:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-setuptools_scm (Old) and /work/SRC/openSUSE:Factory/.python-setuptools_scm.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-setuptools_scm" Thu Mar 29 11:48:14 2018 rev:12 rq:590817 version:1.17.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-setuptools_scm/python-setuptools_scm.changes 2018-03-12 12:05:36.808589878 +0100 +++ /work/SRC/openSUSE:Factory/.python-setuptools_scm.new/python-setuptools_scm.changes 2018-03-29 11:48:15.834265812 +0200 @@ -1,0 +2,28 @@ +Fri Mar 23 23:59:40 UTC 2018 - arun@gmx.de + +- update to version 1.17.0: + * fix regression in git support - use a function to ensure it works + in egg isntalled mode + * actually fail if file finding fails in order to see broken setups + instead of generating broken dists (thanks Mehdi ABAAKOUK for both) + +- changes from version 1.16.2: + * fix regression in handling git export ignores (thanks Mehdi + ABAAKOUK) + +- changes from version 1.16.1: + * fix regression in support for old setuptools versions (thanks + Marco Clemencic) + +- changes from version 1.16.0: + * drop support for eol python versions + * #214 - fix missuse in surogate-escape api + * add the node-and-timestamp local version sheme + * respect git export ignores + * avoid shlex.split on windows + * fix #218 - better handling of mercurial edge-cases with tag + commits being considered as the tagged commit + * fix #223 - remove the dependency on the interal SetupttoolsVersion + as it was removed after long-standing deprecation + +------------------------------------------------------------------- @@ -9,0 +38,11 @@ + +------------------------------------------------------------------- +Sun Jan 28 18:50:36 UTC 2018 - arun@gmx.de + +- specfile: + * update copyright year + +- update to version 1.15.7: + * Fix #174 with #207: Re-use samefile backport as developed in + jaraco.windows, and only use the backport where samefile is not + available. Old: ---- setuptools_scm-1.15.6.tar.gz New: ---- setuptools_scm-1.17.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-setuptools_scm.spec ++++++ --- /var/tmp/diff_new_pack.Pbz7LN/_old 2018-03-29 11:48:16.378246213 +0200 +++ /var/tmp/diff_new_pack.Pbz7LN/_new 2018-03-29 11:48:16.378246213 +0200 @@ -19,7 +19,7 @@ %bcond_with test %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-setuptools_scm -Version: 1.15.6 +Version: 1.17.0 Release: 0 Summary: Manage your versions by scm tags License: MIT ++++++ setuptools_scm-1.15.6.tar.gz -> setuptools_scm-1.17.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/.gitignore new/setuptools_scm-1.17.0/.gitignore --- old/setuptools_scm-1.15.6/.gitignore 2017-06-15 21:24:23.000000000 +0200 +++ new/setuptools_scm-1.17.0/.gitignore 2018-03-20 11:15:19.000000000 +0100 @@ -6,6 +6,9 @@ ## Directory-based project format: .idea/ +### Other editors +.*.swp + ### Python template # Byte-compiled / optimized diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/.travis.yml new/setuptools_scm-1.17.0/.travis.yml --- old/setuptools_scm-1.15.6/.travis.yml 2017-06-15 21:24:23.000000000 +0200 +++ new/setuptools_scm-1.17.0/.travis.yml 2018-03-20 11:15:19.000000000 +0100 @@ -1,21 +1,20 @@ language: python sudo: false python: -- '2.6' - '2.7' -- '3.3' - '3.4' - '3.5' - '3.6' +#- '3.7' env: - TOXENV=py-test matrix: include: - - python: '2.7' - env: TOXENV=flake8 - python: '3.5' env: TOXENV=flake8 + - python: '3.5' + env: TOXENV=check_readme - python: '2.7' env: SELFINSTALL=1 - python: '3.5' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/CHANGELOG.rst new/setuptools_scm-1.17.0/CHANGELOG.rst --- old/setuptools_scm-1.15.6/CHANGELOG.rst 2017-06-15 21:24:23.000000000 +0200 +++ new/setuptools_scm-1.17.0/CHANGELOG.rst 2018-03-20 11:15:19.000000000 +0100 @@ -1,3 +1,44 @@ +v1.17.0 +======== + +* fix regression in git support - use a function to ensure it works in egg isntalled mode +* actually fail if file finding fails in order to see broken setups instead of generating broken dists + + (thanks Mehdi ABAAKOUK for both) + + +v1.16.2 +======== + +* fix regression in handling git export ignores + (thanks Mehdi ABAAKOUK) + +v1.16.1 +======= + +* fix regression in support for old setuptools versions + (thanks Marco Clemencic) + + +v1.16.0 +======= + +* drop support for eol python versions +* #214 - fix missuse in surogate-escape api +* add the node-and-timestamp local version sheme +* respect git export ignores +* avoid shlex.split on windows +* fix #218 - better handling of mercurial edge-cases with tag commits + being considered as the tagged commit +* fix #223 - remove the dependency on the interal SetupttoolsVersion + as it was removed after long-standing deprecation + +v1.15.7 +====== + +* Fix #174 with #207: Re-use samefile backport as developed in + jaraco.windows, and only use the backport where samefile is + not available. v1.15.6 ======= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/PKG-INFO new/setuptools_scm-1.17.0/PKG-INFO --- old/setuptools_scm-1.15.6/PKG-INFO 2017-06-15 21:24:45.000000000 +0200 +++ new/setuptools_scm-1.17.0/PKG-INFO 2018-03-20 11:15:44.000000000 +0100 @@ -1,6 +1,6 @@ -Metadata-Version: 1.1 +Metadata-Version: 1.2 Name: setuptools_scm -Version: 1.15.6 +Version: 1.17.0 Summary: the blessed package to manage your versions by scm tags Home-page: https://github.com/pypa/setuptools_scm/ Author: Ronny Pfannschmidt @@ -62,14 +62,14 @@ try: __version__ = get_distribution(__name__).version except DistributionNotFound: - # package is not installed - pass + # package is not installed + pass Programmatic usage ------------------ - In order to use ``setuptools_scm`` from code that one directory deeper + In order to use ``setuptools_scm`` from code that is one directory deeper than the project's root, you can use: .. code:: python @@ -314,10 +314,9 @@ Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 @@ -325,3 +324,4 @@ Classifier: Topic :: Software Development :: Version Control Classifier: Topic :: System :: Software Distribution Classifier: Topic :: Utilities +Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/README.rst new/setuptools_scm-1.17.0/README.rst --- old/setuptools_scm-1.15.6/README.rst 2017-06-15 21:24:23.000000000 +0200 +++ new/setuptools_scm-1.17.0/README.rst 2018-03-20 11:15:19.000000000 +0100 @@ -54,14 +54,14 @@ try: __version__ = get_distribution(__name__).version except DistributionNotFound: - # package is not installed - pass + # package is not installed + pass Programmatic usage ------------------ -In order to use ``setuptools_scm`` from code that one directory deeper +In order to use ``setuptools_scm`` from code that is one directory deeper than the project's root, you can use: .. code:: python diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/appveyor.yml new/setuptools_scm-1.17.0/appveyor.yml --- old/setuptools_scm-1.15.6/appveyor.yml 2017-06-15 21:24:23.000000000 +0200 +++ new/setuptools_scm-1.17.0/appveyor.yml 2018-03-20 11:15:19.000000000 +0100 @@ -6,12 +6,6 @@ - PYTHON: "C:\\Python27-x64" TOX_ENV: "py-test" - - PYTHON: "C:\\Python33" - TOX_ENV: "py-test" - - - PYTHON: "C:\\Python33-x64" - TOX_ENV: "py-test" - - PYTHON: "C:\\Python34" TOX_ENV: "py-test" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/setup.cfg new/setuptools_scm-1.17.0/setup.cfg --- old/setuptools_scm-1.15.6/setup.cfg 2017-06-15 21:24:45.000000000 +0200 +++ new/setuptools_scm-1.17.0/setup.cfg 2018-03-20 11:15:44.000000000 +0100 @@ -13,5 +13,4 @@ [egg_info] tag_build = tag_date = 0 -tag_svn_revision = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/setup.py new/setuptools_scm-1.17.0/setup.py --- old/setuptools_scm-1.15.6/setup.py 2017-06-15 21:24:23.000000000 +0200 +++ new/setuptools_scm-1.17.0/setup.py 2018-03-20 11:15:19.000000000 +0100 @@ -82,7 +82,7 @@ [setuptools_scm.files_command] .hg = setuptools_scm.hg:FILES_COMMAND - .git = setuptools_scm.git:FILES_COMMAND + .git = setuptools_scm.git:list_files_in_archive [setuptools_scm.version_scheme] guess-next-dev = setuptools_scm.version:guess_next_dev_version @@ -90,6 +90,8 @@ [setuptools_scm.local_scheme] node-and-date = setuptools_scm.version:get_local_node_and_date + node-and-timestamp = \ + setuptools_scm.version:get_local_node_and_timestamp dirty-tag = setuptools_scm.version:get_local_dirty_tag """, classifiers=[ @@ -97,10 +99,9 @@ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python', + 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', @@ -109,6 +110,7 @@ 'Topic :: System :: Software Distribution', 'Topic :: Utilities', ], + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*', ) if __name__ == '__main__': diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/setuptools_scm/git.py new/setuptools_scm-1.17.0/setuptools_scm/git.py --- old/setuptools_scm-1.15.6/setuptools_scm/git.py 2017-06-15 21:24:23.000000000 +0200 +++ new/setuptools_scm-1.17.0/setuptools_scm/git.py 2018-03-20 11:15:19.000000000 +0100 @@ -1,14 +1,19 @@ from .utils import do_ex, trace, has_command from .version import meta -from os.path import abspath, normcase, realpath, isfile, join + +from os.path import isfile, join +import subprocess +import tarfile import warnings -FILES_COMMAND = 'git ls-files' -DEFAULT_DESCRIBE = 'git describe --dirty --tags --long --match *.*' +try: + from os.path import samefile +except ImportError: + from .win_py31_compat import samefile -def _normalized(path): - return normcase(abspath(realpath(path))) + +DEFAULT_DESCRIBE = 'git describe --dirty --tags --long --match *.*' class GitWorkdir(object): @@ -25,7 +30,7 @@ if ret: return trace('real root', real_wd) - if _normalized(real_wd) != _normalized(wd): + if not samefile(real_wd, wd): return return cls(real_wd) @@ -114,3 +119,13 @@ return meta(tag, distance=number, node=node, dirty=dirty) else: return meta(tag, node=node, dirty=dirty) + + +def list_files_in_archive(path): + """List the files that 'git archive' generates. + """ + cmd = ['git', 'archive', 'HEAD'] + proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, cwd=path) + tf = tarfile.open(fileobj=proc.stdout, mode='r|*') + return [member.name for member in tf.getmembers() + if member.type != tarfile.DIRTYPE] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/setuptools_scm/hg.py new/setuptools_scm-1.17.0/setuptools_scm/hg.py --- old/setuptools_scm-1.15.6/setuptools_scm/hg.py 2017-06-15 21:24:23.000000000 +0200 +++ new/setuptools_scm-1.17.0/setuptools_scm/hg.py 2018-03-20 11:15:19.000000000 +0100 @@ -8,8 +8,14 @@ def _hg_tagdist_normalize_tagcommit(root, tag, dist, node): dirty = node.endswith('+') node = 'h' + node.strip('+') - revset = ("(branch(.) and tag({tag!r})::. and file('re:^(?!\.hgtags).*$')" - " - tag({tag!r}))").format(tag=tag) + + # Detect changes since the specified tag + revset = ("(branch(.)" # look for revisions in this branch only + " and tag({tag!r})::." # after the last tag + # ignore commits that only modify .hgtags and nothing else: + " and (merge() or file('re:^(?!\.hgtags).*$'))" + " and not tag({tag!r}))" # ignore the tagged commit itself + ).format(tag=tag) if tag != '0.0': commits = do(['hg', 'log', '-r', revset, '--template', '{node|short}'], root) @@ -25,11 +31,11 @@ def parse(root): if not has_command('hg'): return - l = do('hg id -i -t', root).split() - if not l: + identity_data = do('hg id -i -t', root).split() + if not identity_data: return - node = l.pop(0) - tags = tags_to_versions(l) + node = identity_data.pop(0) + tags = tags_to_versions(identity_data) # filter tip in degraded mode on old setuptools tags = [x for x in tags if x != 'tip'] dirty = node[-1] == '+' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/setuptools_scm/integration.py new/setuptools_scm-1.17.0/setuptools_scm/integration.py --- old/setuptools_scm-1.15.6/setuptools_scm/integration.py 2017-06-15 21:24:23.000000000 +0200 +++ new/setuptools_scm-1.17.0/setuptools_scm/integration.py 2018-03-20 11:15:19.000000000 +0100 @@ -36,10 +36,8 @@ else: return command(path) except Exception: - import traceback print("File Finder Failed for %s" % ep) - traceback.print_exc() - return [] + raise else: return [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/setuptools_scm/utils.py new/setuptools_scm-1.17.0/setuptools_scm/utils.py --- old/setuptools_scm-1.15.6/setuptools_scm/utils.py 2017-06-15 21:24:23.000000000 +0200 +++ new/setuptools_scm-1.17.0/setuptools_scm/utils.py 2018-03-20 11:15:19.000000000 +0100 @@ -12,6 +12,8 @@ DEBUG = bool(os.environ.get("SETUPTOOLS_SCM_DEBUG")) +IS_WINDOWS = platform.system() == 'Windows' +PY2 = sys.version_info < (3,) def trace(*k): @@ -24,7 +26,7 @@ if isinstance(str_or_bytes, str): return str_or_bytes.strip() else: - return str_or_bytes.decode('utf-8', 'surogate_escape').strip() + return str_or_bytes.decode('utf-8', 'surrogateescape').strip() def _always_strings(env_dict): @@ -32,9 +34,7 @@ On Windows and Python 2, environment dictionaries must be strings and not unicode. """ - is_windows = platform.system == 'Windows' - PY2 = sys.version_info < (3,) - if is_windows or PY2: + if IS_WINDOWS or PY2: env_dict.update( (key, str(value)) for (key, value) in env_dict.items() @@ -61,7 +61,7 @@ def do_ex(cmd, cwd='.'): trace('cmd', repr(cmd)) - if not isinstance(cmd, (list, tuple)): + if os.name == "posix" and not isinstance(cmd, (list, tuple)): cmd = shlex.split(cmd) p = _popen_pipes(cmd, cwd) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/setuptools_scm/version.py new/setuptools_scm-1.17.0/setuptools_scm/version.py --- old/setuptools_scm-1.15.6/setuptools_scm/version.py 2017-06-15 21:24:23.000000000 +0200 +++ new/setuptools_scm-1.17.0/setuptools_scm/version.py 2018-03-20 11:15:19.000000000 +0100 @@ -7,28 +7,36 @@ from pkg_resources import iter_entry_points from distutils import log +from pkg_resources import parse_version -try: - from pkg_resources import parse_version, SetuptoolsVersion -except ImportError as e: - parse_version = SetuptoolsVersion = None + +def _get_version_class(): + modern_version = parse_version("1.0") + if isinstance(modern_version, tuple): + return None + else: + return type(modern_version) + + +VERSION_CLASS = _get_version_class() def _warn_if_setuptools_outdated(): - if parse_version is None: + if VERSION_CLASS is None: log.warn("your setuptools is too old (<12)") log.warn("setuptools_scm functionality is degraded") def callable_or_entrypoint(group, callable_or_name): trace('ep', (group, callable_or_name)) - if isinstance(callable_or_name, str): - for ep in iter_entry_points(group, callable_or_name): - trace("ep found:", ep.name) - return ep.load() - else: + + if callable(callable_or_name): return callable_or_name + for ep in iter_entry_points(group, callable_or_name): + trace("ep found:", ep.name) + return ep.load() + def tag_to_version(tag): trace('tag', tag) @@ -39,11 +47,11 @@ # also required for old versions of setuptools version = tag.rsplit('-', 1)[-1].lstrip('v') - if parse_version is None: + if VERSION_CLASS is None: return version version = parse_version(version) trace('version', repr(version)) - if isinstance(version, SetuptoolsVersion): + if isinstance(version, VERSION_CLASS): return version @@ -91,7 +99,7 @@ def _parse_tag(tag, preformatted): if preformatted: return tag - if SetuptoolsVersion is None or not isinstance(tag, SetuptoolsVersion): + if VERSION_CLASS is None or not isinstance(tag, VERSION_CLASS): tag = tag_to_version(tag) return tag @@ -143,6 +151,20 @@ return version.format_choice("+{node}", "+{node}.d{time:%Y%m%d}") +def get_local_node_and_timestamp(version, fmt='%Y%m%d%H%M%S'): + if version.exact or version.node is None: + return version.format_choice("", + "+d{time:" + + "{fmt}".format(fmt=fmt) + + "}") + else: + return version.format_choice("+{node}", + "+{node}" + + ".d{time:" + + "{fmt}".format(fmt=fmt) + + "}") + + def get_local_dirty_tag(version): return version.format_choice('', '+dirty') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/setuptools_scm/win_py31_compat.py new/setuptools_scm-1.17.0/setuptools_scm/win_py31_compat.py --- old/setuptools_scm-1.15.6/setuptools_scm/win_py31_compat.py 1970-01-01 01:00:00.000000000 +0100 +++ new/setuptools_scm-1.17.0/setuptools_scm/win_py31_compat.py 2018-03-20 11:15:19.000000000 +0100 @@ -0,0 +1,214 @@ +""" +Backport of os.path.samefile for Python prior to 3.2 +on Windows from jaraco.windows 3.8. + +DON'T EDIT THIS FILE! + +Instead, file tickets and PR's with `jaraco.windows +<https://github.com/jaraco/jaraco.windows>`_ and request +a port to setuptools_scm. +""" + +import os +import nt +import posixpath +import ctypes.wintypes +import sys +import __builtin__ as builtins + + +## +# From jaraco.windows.error + +def format_system_message(errno): + """ + Call FormatMessage with a system error number to retrieve + the descriptive error message. + """ + # first some flags used by FormatMessageW + ALLOCATE_BUFFER = 0x100 + FROM_SYSTEM = 0x1000 + + # Let FormatMessageW allocate the buffer (we'll free it below) + # Also, let it know we want a system error message. + flags = ALLOCATE_BUFFER | FROM_SYSTEM + source = None + message_id = errno + language_id = 0 + result_buffer = ctypes.wintypes.LPWSTR() + buffer_size = 0 + arguments = None + bytes = ctypes.windll.kernel32.FormatMessageW( + flags, + source, + message_id, + language_id, + ctypes.byref(result_buffer), + buffer_size, + arguments, + ) + # note the following will cause an infinite loop if GetLastError + # repeatedly returns an error that cannot be formatted, although + # this should not happen. + handle_nonzero_success(bytes) + message = result_buffer.value + ctypes.windll.kernel32.LocalFree(result_buffer) + return message + + +class WindowsError(builtins.WindowsError): + """ + More info about errors at + http://msdn.microsoft.com/en-us/library/ms681381(VS.85).aspx + """ + + def __init__(self, value=None): + if value is None: + value = ctypes.windll.kernel32.GetLastError() + strerror = format_system_message(value) + if sys.version_info > (3, 3): + args = 0, strerror, None, value + else: + args = value, strerror + super(WindowsError, self).__init__(*args) + + @property + def message(self): + return self.strerror + + @property + def code(self): + return self.winerror + + def __str__(self): + return self.message + + def __repr__(self): + return '{self.__class__.__name__}({self.winerror})'.format(**vars()) + + +def handle_nonzero_success(result): + if result == 0: + raise WindowsError() + + +## +# From jaraco.windows.api.filesystem + +FILE_FLAG_OPEN_REPARSE_POINT = 0x00200000 +FILE_FLAG_BACKUP_SEMANTICS = 0x2000000 +OPEN_EXISTING = 3 +FILE_ATTRIBUTE_NORMAL = 0x80 +FILE_READ_ATTRIBUTES = 0x80 +INVALID_HANDLE_VALUE = ctypes.wintypes.HANDLE(-1).value + + +class BY_HANDLE_FILE_INFORMATION(ctypes.Structure): + _fields_ = [ + ('file_attributes', ctypes.wintypes.DWORD), + ('creation_time', ctypes.wintypes.FILETIME), + ('last_access_time', ctypes.wintypes.FILETIME), + ('last_write_time', ctypes.wintypes.FILETIME), + ('volume_serial_number', ctypes.wintypes.DWORD), + ('file_size_high', ctypes.wintypes.DWORD), + ('file_size_low', ctypes.wintypes.DWORD), + ('number_of_links', ctypes.wintypes.DWORD), + ('file_index_high', ctypes.wintypes.DWORD), + ('file_index_low', ctypes.wintypes.DWORD), + ] + + @property + def file_size(self): + return (self.file_size_high << 32) + self.file_size_low + + @property + def file_index(self): + return (self.file_index_high << 32) + self.file_index_low + + +class SECURITY_ATTRIBUTES(ctypes.Structure): + _fields_ = ( + ('length', ctypes.wintypes.DWORD), + ('p_security_descriptor', ctypes.wintypes.LPVOID), + ('inherit_handle', ctypes.wintypes.BOOLEAN), + ) + + +LPSECURITY_ATTRIBUTES = ctypes.POINTER(SECURITY_ATTRIBUTES) + + +CreateFile = ctypes.windll.kernel32.CreateFileW +CreateFile.argtypes = ( + ctypes.wintypes.LPWSTR, + ctypes.wintypes.DWORD, + ctypes.wintypes.DWORD, + LPSECURITY_ATTRIBUTES, + ctypes.wintypes.DWORD, + ctypes.wintypes.DWORD, + ctypes.wintypes.HANDLE, +) +CreateFile.restype = ctypes.wintypes.HANDLE + +GetFileInformationByHandle = ctypes.windll.kernel32.GetFileInformationByHandle +GetFileInformationByHandle.restype = ctypes.wintypes.BOOL +GetFileInformationByHandle.argtypes = ( + ctypes.wintypes.HANDLE, + ctypes.POINTER(BY_HANDLE_FILE_INFORMATION), +) + + +## +# From jaraco.windows.filesystem + +def compat_stat(path): + """ + Generate stat as found on Python 3.2 and later. + """ + stat = os.stat(path) + info = get_file_info(path) + # rewrite st_ino, st_dev, and st_nlink based on file info + return nt.stat_result( + (stat.st_mode,) + + (info.file_index, info.volume_serial_number, info.number_of_links) + + stat[4:] + ) + + +def samefile(f1, f2): + """ + Backport of samefile from Python 3.2 with support for Windows. + """ + return posixpath.samestat(compat_stat(f1), compat_stat(f2)) + + +def get_file_info(path): + # open the file the same way CPython does in posixmodule.c + desired_access = FILE_READ_ATTRIBUTES + share_mode = 0 + security_attributes = None + creation_disposition = OPEN_EXISTING + flags_and_attributes = ( + FILE_ATTRIBUTE_NORMAL | + FILE_FLAG_BACKUP_SEMANTICS | + FILE_FLAG_OPEN_REPARSE_POINT + ) + template_file = None + + handle = CreateFile( + path, + desired_access, + share_mode, + security_attributes, + creation_disposition, + flags_and_attributes, + template_file, + ) + + if handle == INVALID_HANDLE_VALUE: + raise WindowsError() + + info = BY_HANDLE_FILE_INFORMATION() + res = GetFileInformationByHandle(handle, info) + handle_nonzero_success(res) + + return info diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/setuptools_scm.egg-info/PKG-INFO new/setuptools_scm-1.17.0/setuptools_scm.egg-info/PKG-INFO --- old/setuptools_scm-1.15.6/setuptools_scm.egg-info/PKG-INFO 2017-06-15 21:24:45.000000000 +0200 +++ new/setuptools_scm-1.17.0/setuptools_scm.egg-info/PKG-INFO 2018-03-20 11:15:44.000000000 +0100 @@ -1,6 +1,6 @@ -Metadata-Version: 1.1 +Metadata-Version: 1.2 Name: setuptools-scm -Version: 1.15.6 +Version: 1.17.0 Summary: the blessed package to manage your versions by scm tags Home-page: https://github.com/pypa/setuptools_scm/ Author: Ronny Pfannschmidt @@ -62,14 +62,14 @@ try: __version__ = get_distribution(__name__).version except DistributionNotFound: - # package is not installed - pass + # package is not installed + pass Programmatic usage ------------------ - In order to use ``setuptools_scm`` from code that one directory deeper + In order to use ``setuptools_scm`` from code that is one directory deeper than the project's root, you can use: .. code:: python @@ -314,10 +314,9 @@ Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 @@ -325,3 +324,4 @@ Classifier: Topic :: Software Development :: Version Control Classifier: Topic :: System :: Software Distribution Classifier: Topic :: Utilities +Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/setuptools_scm.egg-info/SOURCES.txt new/setuptools_scm-1.17.0/setuptools_scm.egg-info/SOURCES.txt --- old/setuptools_scm-1.15.6/setuptools_scm.egg-info/SOURCES.txt 2017-06-15 21:24:45.000000000 +0200 +++ new/setuptools_scm-1.17.0/setuptools_scm.egg-info/SOURCES.txt 2018-03-20 11:15:44.000000000 +0100 @@ -17,6 +17,7 @@ setuptools_scm/integration.py setuptools_scm/utils.py setuptools_scm/version.py +setuptools_scm/win_py31_compat.py setuptools_scm.egg-info/PKG-INFO setuptools_scm.egg-info/SOURCES.txt setuptools_scm.egg-info/dependency_links.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/setuptools_scm.egg-info/entry_points.txt new/setuptools_scm-1.17.0/setuptools_scm.egg-info/entry_points.txt --- old/setuptools_scm-1.15.6/setuptools_scm.egg-info/entry_points.txt 2017-06-15 21:24:45.000000000 +0200 +++ new/setuptools_scm-1.17.0/setuptools_scm.egg-info/entry_points.txt 2018-03-20 11:15:44.000000000 +0100 @@ -16,7 +16,7 @@ [setuptools_scm.files_command] .hg = setuptools_scm.hg:FILES_COMMAND - .git = setuptools_scm.git:FILES_COMMAND + .git = setuptools_scm.git:list_files_in_archive [setuptools_scm.version_scheme] guess-next-dev = setuptools_scm.version:guess_next_dev_version @@ -24,5 +24,6 @@ [setuptools_scm.local_scheme] node-and-date = setuptools_scm.version:get_local_node_and_date + node-and-timestamp = setuptools_scm.version:get_local_node_and_timestamp dirty-tag = setuptools_scm.version:get_local_dirty_tag \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/testing/test_functions.py new/setuptools_scm-1.17.0/testing/test_functions.py --- old/setuptools_scm-1.15.6/testing/test_functions.py 2017-06-15 21:24:23.000000000 +0200 +++ new/setuptools_scm-1.17.0/testing/test_functions.py 2018-03-20 11:15:19.000000000 +0100 @@ -1,9 +1,12 @@ import pytest +import sys import pkg_resources from setuptools_scm import dump_version, get_version, PRETEND_KEY from setuptools_scm.version import guess_next_version, meta, format_version from setuptools_scm.utils import has_command +PY3 = sys.version_info > (2,) + class MockTime(object): def __format__(self, *k): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/testing/test_git.py new/setuptools_scm-1.17.0/testing/test_git.py --- old/setuptools_scm-1.15.6/testing/test_git.py 2017-06-15 21:24:23.000000000 +0200 +++ new/setuptools_scm-1.17.0/testing/test_git.py 2018-03-20 11:15:19.000000000 +0100 @@ -39,6 +39,12 @@ assert wd.version.startswith('0.2') +@pytest.mark.issue(179) +def test_unicode_version_scheme(wd): + scheme = b'guess-next-dev'.decode('ascii') + assert wd.get_version(version_scheme=scheme) + + @pytest.mark.issue(108) @pytest.mark.issue(109) def test_git_worktree(wd): @@ -106,3 +112,24 @@ wd.commit_testfile() wd('git tag newstyle-development-started') assert wd.version.startswith('0.1.dev1+g') + + +def test_git_archive_export_ignore(wd): + wd.write('test1.txt', 'test') + wd.write('test2.txt', 'test') + wd.write('.git/info/attributes', + # Explicitly include test1.txt so that the test is not affected by + # a potentially global gitattributes file on the test machine. + '/test1.txt -export-ignore\n/test2.txt export-ignore') + wd('git add test1.txt test2.txt') + wd.commit() + assert integration.find_files(str(wd.cwd)) == ['test1.txt'] + + +@pytest.mark.issue(228) +def test_git_archive_subdirectory(wd): + wd('mkdir foobar') + wd.write('foobar/test1.txt', 'test') + wd('git add foobar') + wd.commit() + assert integration.find_files(str(wd.cwd)) == ['foobar/test1.txt'] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/testing/test_mercurial.py new/setuptools_scm-1.17.0/testing/test_mercurial.py --- old/setuptools_scm-1.15.6/testing/test_mercurial.py 2017-06-15 21:24:23.000000000 +0200 +++ new/setuptools_scm-1.17.0/testing/test_mercurial.py 2018-03-20 11:15:19.000000000 +0100 @@ -108,3 +108,47 @@ def test_parse_no_worktree(tmpdir): ret = parse(str(tmpdir)) assert ret is None + + +@pytest.fixture +def version_1_0(wd): + wd('hg branch default') + wd.commit_testfile() + wd('hg tag 1.0 -u test -d "0 0"') + return wd + + +@pytest.fixture +def pre_merge_commit_after_tag(wd, version_1_0): + wd('hg branch testbranch') + wd.write('branchfile', 'branchtext') + wd(wd.add_command) + wd.commit() + wd('hg update default') + wd('hg merge testbranch') + return wd + + +@pytest.mark.usefixtures("pre_merge_commit_after_tag") +def test_version_bump_before_merge_commit(wd): + assert wd.version.startswith('1.1.dev1+') + + +@pytest.mark.issue(219) +@pytest.mark.usefixtures("pre_merge_commit_after_tag") +def test_version_bump_from_merge_commit(wd): + wd.commit() + assert wd.version.startswith('1.1.dev3+') # issue 219 + + +@pytest.mark.usefixtures("version_1_0") +def test_version_bump_from_commit_including_hgtag_mods(wd): + """ Test the case where a commit includes changes to .hgtags and other files + """ + with wd.cwd.join('.hgtags').open('a') as tagfile: + tagfile.write('0 0\n') + wd.write('branchfile', 'branchtext') + wd(wd.add_command) + assert wd.version.startswith('1.1.dev1+') # bump from dirty version + wd.commit() # commits both the testfile _and_ .hgtags + assert wd.version.startswith('1.1.dev2+') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/setuptools_scm-1.15.6/tox.ini new/setuptools_scm-1.17.0/tox.ini --- old/setuptools_scm-1.15.6/tox.ini 2017-06-15 21:24:23.000000000 +0200 +++ new/setuptools_scm-1.17.0/tox.ini 2018-03-20 11:15:19.000000000 +0100 @@ -1,5 +1,5 @@ [tox] -envlist=py{27,34}-test,flake8 +envlist=py{27,34,35,36,37}-test,flake8,check_readme [flake8] max-complexity = 10 @@ -18,7 +18,7 @@ flake8 mccabe commands = - flake8 setuptools_scm/ testing/ setup.py + flake8 setuptools_scm/ testing/ setup.py --exclude=setuptools_scm/win_py31_compat.py [testenv:check_readme] skip_install=True
participants (1)
-
root@hilbert.suse.de