Skip to content

Commit

Permalink
Fix compatibility with setuptools 39.
Browse files Browse the repository at this point in the history
Fixes #8.
  • Loading branch information
Michael Howitz committed Apr 23, 2018
1 parent 9308978 commit b583be2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
7 changes: 5 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
Changelog
=========

0.5.1 (unreleased)
------------------
1.0 (unreleased)
----------------

- Fix compatibility with setuptools 39 by using an API introduced
in setuptools 8.

- Standardize namespace __init__

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
include_package_data=True,
zip_safe=False,
install_requires=[
'setuptools',
'setuptools >= 8',
],
extras_require={
'buildout': ['zc.buildout'],
Expand Down
12 changes: 3 additions & 9 deletions src/z3c/checkversions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@
from setuptools import package_index


_final_parts = '*final-', '*final'
def _final_version(parsed_version):
"""Function copied from zc.buildout.easy_install._final_version
"""
for part in parsed_version:
if (part[:1] == '*') and (part not in _final_parts):
return False
return True
return not parsed_version.is_prerelease


class Checker(object):
Expand Down Expand Up @@ -105,10 +101,8 @@ def check(self, level=0):
continue
# trunk the version tuple to the first `level` elements
# (and remove *final and pad both to the level length)
trunked_current = [x for x in parsed_version[:level]
if not x.startswith('*')]
trunked_candidate = [x for x in dist.parsed_version[:level]
if not x.startswith('*')]
trunked_current = parsed_version.base_version.split('.')[:level]
trunked_candidate = dist.parsed_version.base_version.split('.')[:level]
while len(trunked_candidate) < level:
trunked_candidate.append('00000000')
while len(trunked_current) < level:
Expand Down

0 comments on commit b583be2

Please sign in to comment.