Skip to content

Commit

Permalink
Merge pull request #18 from zopefoundation/fix-index-url-installed-pa…
Browse files Browse the repository at this point in the history
…ckages

Pass the index url to both the 'installed' and 'buildout' checkers.
  • Loading branch information
janjaapdriessen committed Apr 13, 2020
2 parents be59ba7 + 05e1a53 commit 7bec500
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 18 deletions.
6 changes: 3 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ Changelog
1.2 (unreleased)
----------------

- Add support for Python 3.8.

- Drop support for Python 3.4.
- Add support for Python 3.8, drop support for Python 3.4.

- Improve error message in case zc.buildout is not installed.

- Improve installation instruction.

- Pass the index url to both the 'installed' and 'buildout' checkers.


1.1 (2018-11-03)
----------------
Expand Down
9 changes: 9 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Programming Language :: Python :: Implementation :: PyPy3',
'Natural Language :: English',
'Operating System :: OS Independent',
'Topic :: Software Development :: Quality Assurance',
Expand All @@ -55,6 +56,14 @@
install_requires=[
'setuptools >= 8',
],
python_requires=', '.join([
'>=2.7',
'!=3.0.*',
'!=3.1.*',
'!=3.2.*',
'!=3.3.*',
'!=3.4.*',
]),
extras_require={
'buildout': ['zc.buildout'],
},
Expand Down
25 changes: 25 additions & 0 deletions src/z3c/checkversions/buildout.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,31 @@ We are using it directly here:
>>> output.lower().startswith(b'usage: ')
True

The default behavior is to inspect the installed versions

>>> output = subprocess.check_output([sys.executable, main.__file__],
... stderr=subprocess.STDOUT)

>>> '# Checking your installed distributions' in output.decode('ascii')
True

If you pass in a buildout config file, this will be used.

>>> buildout_path = write_temp_file("""
... [buildout]
... index = %s
... versions = versions
... [versions]
... zope.interface = 3.4.1
... zope.component = 3.0.3
... """ % testindex)
>>> output = subprocess.check_output(
... [sys.executable, main.__file__, buildout_path],
... stderr=subprocess.STDOUT)
>>> '# Checking buildout file' in output.decode('ascii')
True
>>> os.remove(buildout_path)


explicitly unpinned versions
----------------------------
Expand Down
25 changes: 10 additions & 15 deletions src/z3c/checkversions/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,27 +72,22 @@ def main():
parser.error(
'The blacklist file "%s" does not exist!' % options.blacklist)

buildoutcfg = False
if len(args) == 1:
buildoutcfg = args[0]

kw = {}
if options.index is not None:
kw['index_url'] = options.index

if buildoutcfg:
from . import buildout
checker = buildout.Checker(filename=buildoutcfg,
blacklist=options.blacklist,
incremental=options.incremental,
verbose=options.verbose,
**kw)
if len(args) == 1:
from z3c.checkversions import buildout
kw['filename'] = args[0]
factory = buildout.Checker
else:
from . import installed
checker = installed.Checker(blacklist=options.blacklist,
incremental=options.incremental,
verbose=options.verbose)
from z3c.checkversions import installed
factory = installed.Checker

checker = factory(blacklist=options.blacklist,
incremental=options.incremental,
verbose=options.verbose,
**kw)
checker.check(level=options.level)


Expand Down

0 comments on commit 7bec500

Please sign in to comment.