Skip to content

Commit

Permalink
Merge pull request #9 from zopefoundation/fix-8
Browse files Browse the repository at this point in the history
Fix compatibility with setuptools 39 and support current Python versions.
  • Loading branch information
Michael Howitz committed May 3, 2018
2 parents 9308978 + afddd85 commit a767d6b
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 22 deletions.
5 changes: 5 additions & 0 deletions .coveragerc
@@ -1,4 +1,9 @@
[run]
branch = True
source = src

[report]
precision = 2
exclude_lines =
pragma: nocover
except ImportError:
Expand Down
5 changes: 3 additions & 2 deletions .travis.yml
@@ -1,11 +1,12 @@
language: python
sudo: false
python:
- 2.6
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6
- pypy
- pypy3
install:
- pip install tox-travis
script:
Expand Down
11 changes: 9 additions & 2 deletions CHANGES.rst
@@ -1,8 +1,15 @@
Changelog
=========

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

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

- Add support for Python 3.5, 3.6 and PyPy3.

- Drop support for Python 2.6 and 3.3.

- Standardize namespace __init__

Expand Down
15 changes: 9 additions & 6 deletions setup.py
Expand Up @@ -16,28 +16,31 @@

setup(
name='z3c.checkversions',
version='0.5.1.dev0',
version='1.0.dev0',
description="Find newer package versions on PyPI",
long_description=(open("README.rst").read() + "\n" +
open("CHANGES.rst").read()),
classifiers=[
"Programming Language :: Python",
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: Zope Public License',
'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',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Natural Language :: English',
'Operating System :: OS Independent',
'Topic :: Software Development :: Quality Assurance',
'Topic :: Software Development :: Libraries :: Python Modules',
'Framework :: Buildout',
'Framework :: Zope :: 2',
'Framework :: Zope :: 3',
'Framework :: Zope :: 4',
'Framework :: Zope2',
'Framework :: Zope3',
'Framework :: Buildout',
],
keywords='version, buildout, packages, upgrade, zope, ztk',
author='Zope Foundation and Contributors',
Expand All @@ -50,7 +53,7 @@
include_package_data=True,
zip_safe=False,
install_requires=[
'setuptools',
'setuptools >= 8',
],
extras_require={
'buildout': ['zc.buildout'],
Expand Down
13 changes: 3 additions & 10 deletions src/z3c/checkversions/base.py
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 @@ -104,11 +100,8 @@ def check(self, level=0):
#only skip non-final releases if the current release is a final one
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
6 changes: 4 additions & 2 deletions tox.ini
@@ -1,17 +1,19 @@
[tox]
envlist =
py26,py27,py33,py34,pypy
py27,py34,py35,py36,pypy,pypy3,coverage

[testenv]
use_develop = true
deps =
zc.buildout
commands =
python setup.py -q test

[testenv:coverage]
basepython = python3.6
deps =
{[testenv]deps}
coverage
commands =
coverage run --source=z3c.checkversions setup.py -q test
coverage report -m
coverage report -m --fail-under=77

0 comments on commit a767d6b

Please sign in to comment.