Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compatibility with setuptools 39. #9

Merged
merged 5 commits into from
May 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the docstring still accurate now that you've replaced the implementation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is, I copied the implementation from the current version of zc.buildout.

"""
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]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment needs some updating -- the "remove *final" bit is no longer true.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

while len(trunked_candidate) < level:
trunked_candidate.append('00000000')
while len(trunked_current) < level:
Expand Down
6 changes: 4 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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