Package: plone.versioncheck
plone.versioncheckContentsFeaturesUsageInstall with your buildoutcommandlineFiles createdOutput explainedLegend of states and colorsOrder of versionsExampleSource Code and ContributionsDevelopmentLicenseChangelog1.8.1 (2023-05-08)1.8.0 (2023-04-15)1.7.0 (2019-03-08)1.6.10 (2018-08-20)1.6.9 (2018-08-20)1.6.8 (2018-08-14)1.6.7 (2018-03-26)1.6.6 (2018-01-26)1.6.5 (2017-07-03)1.6.4 (2017-05-08)1.6.3 (2017-05-05)1.6.2 (2017-04-12)1.6.1 (2017-04-07)1.6.0 (2017-04-07)1.5.1 (2017-01-23)1.5.0 (2016-10-15)1.4 (2016-09-30)1.3 (2016-05-19)1.2.1 (2016-01-26)1.1.2 (2016-01-21)1.1.1 (2016-01-20)1.1 (2016-01-19)1.0 (2016-01-13)FeaturesChecks buildouts ``[versions]`` sectionswhile stepping through the cascadedextendscommand line script collects the inherited version pins, remembers where a version pin comes from.It displays the result in order to enable a human to check that pins and overrides are OK.Output is colored; this helps to identify packages which have newer versions available.Machine readable output as JSON on demand.Checks Python Package Index (PyPI)for newer versions.Detects if a newer major, minor or bugfix (or a prerelease) is available.Buildout extensionrecords thecurrent versions stateandrequirementsversions state and requirements are written to a file,versions from the file will be consumed by the command line toolorphaned version pins are detected,it shows which package pulled in another package as dependency.It works best withsemanticallyand only withsyntacticallycorrect version numbers!UsageInstall with your buildoutAdd a section to install it as a script and add it as an extension to your builodut:[buildout]
...
extensions =
    plone.versioncheck

parts =
    ...
    ploneversioncheck
    ...

...

[ploneversioncheck]
recipe = zc.recipe.egg
eggs = plone.versioncheck

...Run buildout as usual.Now a file.plone.versioncheck.tracked.jsonwas generated in the buildout-directory.This file will be used bybin/versioncheckto figure out which packages were finally used.Run buildout again to regenerate this file.commandlineusage: versioncheck [-h] [-p] [-n] [-N] [-r] [-d] [-i] [-e EXCLUDE_CFG] [-m]
                    [--no-cache] [-b] [-o [OUTPUT]] [--no-colors]
                    [--debug-limit DEBUG_LIMIT]
                    [buildout]

Fetch information about pinned versions and its overrides in simple and complex/cascaded buildouts.

positional arguments:
  buildout              path to buildout.cfg or other *.cfg file

optional arguments:
  -h, --help            show this help message and exit
  -p, --pypi            check PyPI for newer versions
  -n, --newer           display only packages with newer version than active
  -N, --newer-orphaned  display orphaned packages only when newer versions
                        available
  -r, --required-by     show information about requirements (only if tracking
                        file is available)
  -d, --show-release-dates
                        show information about release dates (only for package
                        lookup from PyPI)
  -i, --ignore-tracking
                        ignore tracking file (if present)
  -e EXCLUDE_CFG, --exclude-cfg EXCLUDE_CFG
                        exclude in listing when cfg-filename pattern matches
                        (fnmatch) the given expression
  -m, --machine         show as machine readable output (json)
  --no-cache            do not use a cache for PyPI
  -b, --browser         show as html for webbrowser
  -o [OUTPUT], --output [OUTPUT]
                        safe output to output-file
  --no-colors           do not show colors
  --debug-limit DEBUG_LIMIT
                        Limit the number of PyPI versions fetched for
                        debugging

States and color codes:
  [A]ctive (white)
  [D]evelop (green)
  [O]rphaned (magenta)
  [I]nherited (older or same versions are gray, newer are yellow)
  [U]pdate of final release on PyPI available (cyan)
  [P]rerelease update on PyPI available (blue)
  [X] unpinned (red)
  [r] Requirement (gray)
  [a] Annotation (gray)

Color of package name helps to indicate overall state of a package.Files createdIf the script was used with the--pypioption, a directory.plone.versioncheck.cachewill be created.
It contains the cache of the requests to PyPI or external buildout configuration files.
To clear the cache, remove the directory.
The caching library uses the expiration headers of the response from PyPI, so even with cache it starts fetching new records.If the extension was used, a file.plone.versioncheck.tracked.jsonwill be created.
It contains the information from last buildout run.Output explainedLegend of states and colors[D]evelopment EggA development egg is usually active.
Description shows location.
Color: Green[A]ctive PinPinned version. Package is used and recent, all seems fine.
Color: White[I]nherited PinUnused pin. If older than active, the pin color is gray; if newer, it is yellow.[O]rphanedIf tracked, it shows whether the package in the given configuration was used at all.
Be careful with this information!
I.e. in a development buildout file, other packages are used than in a live or continuous integration buildout!
Color: Magenta[X] UnpinnendTracked, but no pin in[versions]sections were found.
Color: Red[U]pdate final releaseAt PyPI there is a newer final version available (major, minor or bugfix).
Descriptions shows on which level.
Color: Cyan[P]rerelease updateAt PyPI there is a newer prerelease version available (major, minor or bugfix).
Descriptions shows on which level.
Only if there is no final release update available.
Color: Blue[r] Required byIf tracked and option--required-bywas given, show packages this package is required by.
Valid for current active/used version.
Keep in mind this is based on the declared requirements, missing or implicit requirements are not covered.[a] AnnotationIt is possible to annotate the reason why a version was chosen.
The information is parsed out of a section[versionannotations].
In this section  key is the name of the package and value the text annotations to be displayed.
The value can span more than one line using indent (as usal).Order of versionsOrder of versions is the buildout resolution order (how they are resolved by buildout in the extends chain/tree).
After that, the PyPI releases are shown (major, minor, pre, then the prereleases)Example, given in each a version ofmy.pkgwas declared:buildout.cfgwithmy.pkg=3.0.3buildout.cfgextendsfoo.cfgwithmy.pkg=3.0.1buildout.cfgextendsbar.cfgwithmy.pkg=2.0foo cfgextendsbaz.cfgwithmy.pkg=3.1found a newer versions at pypimajormy.pkg=4.0minormy.pkg=3.2majorprerelease my.pkg=5.1b2Output looks like so:my.pkg
    3.0.3............... A buildout.cfg
    2.0 ................ I bar.cfg
    3.0.1 .............. I foo.cfg
    3.1 ................ I baz.cfg
    4.0 ................ U Major
    3.2 ................ U Minor
    5.1b2............... P MajorpreExampleHere w/o colors, run onbuildout.coredev:$ ./bin/versioncheck -p buildout.cfg

accesscontrol
    3.0.12 .... A versions.cfg
    2.13.13 ... I http://dist.plone.org/versions/zope-2-13-23-versions.cfg
acquisition
    4.2.2 ..... A versions.cfg
    2.13.9 .... I http://dist.plone.org/versions/zope-2-13-23-versions.cfg
alabaster
    0.7.7 ..... X unpinned
archetypes.multilingual
    3.0.1 ..... A versions.cfg
archetypes.referencebrowserwidget
    2.5.6 ..... A versions.cfg
archetypes.schemaextender
    2.1.5 ..... A versions.cfg
argcomplete
    1.0.0 ..... A tests.cfg
argh
    0.26.1 .... A tests.cfg
argparse
    (unset) ... A versions.cfg
    1.1 ....... I http://dist.plone.org/versions/zopetoolkit-1-0-8-ztk-versions.cfg
    Can not check legacy version number.  U Error
autopep8
    1.2.1 ..... A tests.cfg

[... skipped a bunch ...]

coverage
    3.7.1 ..... A tests.cfg
    3.5.2 ..... I http://dist.plone.org/versions/zopetoolkit-1-0-8-ztk-versions.cfg
    4.0.3 ..... U Major
    4.1b1 ..... P Majorpre
cssmin
    0.2.0 ..... A versions.cfg
cssselect
    0.9.1 ..... A versions.cfg
datetime
    3.0.3 ..... A versions.cfg
    2.12.8 .... I http://dist.plone.org/versions/zope-2-13-23-versions.cfg
    4.0.1 ..... U Major
decorator
    4.0.6 ..... A versions.cfg

[... skipped a bunch ...]

plone.app.textfield
    1.2.6 ..... A versions.cfg
plone.app.theming
    1.2.17.dev0  D /home/workspacejensens/coredev5/src/plone.app.theming/src
    1.2.16 .... I versions.cfg
plone.app.tiles
    2.1.0 ..... A versions.cfg
    2.2.0 ..... U Minor

[... skipped a bunch ...]Source Code and ContributionsIf you want to help with the development (improvement, update, bug-fixing, …) ofplone.versioncheckthis is a great idea!Please follow thecontribution guidelines.Source code at GithubIssue tracker at GithubMaintainer ofplone.versioncheckis Jens Klein and the Plone contributors.
We appreciate any contribution and if a release is needed to be done on PyPI, please just contact one of us (best by open an issue).DevelopmentThere must bepythonwithvirtualenvandpipavailable in system path pointing to Python >=2.7.x
Clone the project. Then:$ bootstrap.shFor non-unix systems please read the contents of bootstrap.py and execute the steps manually adapted to your OS.LicenseThe project is licensed under the GPLv2.Changelog1.8.1 (2023-05-08)Bug fixes:Catch empty version and ignore invalid versions in more places.
Needed when a package is explicitly unpinned, for exampleZope =.
[maurits]1.8.0 (2023-04-15)Ignore invalid versions.
Needed forsetuptools66 and higher when checking a package that has invalid versions on PyPI.
Fixesissue 52.
[maurits]1.7.0 (2019-03-08)Feature: Offers exclude pattern matching for cfg-files.
[jensens]Use pure black as code style.
[jensens]Test on Python 3.7
[jensens]Fix PyPI url and add output of URL in case of a problem.
[jensens]1.6.10 (2018-08-20)Fixes another bug infind_relative.
[jensens]1.6.9 (2018-08-20)Fixes bug infind_relativeintroducued in last release.
[jensens]1.6.8 (2018-08-14)Bug fixes:Better handling of relative paths as entry, likeproject/foo/dev.cfg.
[jensens]If a file does not extend any other file,
the return statement was returning only one parameter,
while callers expected 2.
[gforcada]1.6.7 (2018-03-26)Bug fixes:Fix: Do not trust on setuptools internals.
Works now with newest setuptools.
[jensens]1.6.6 (2018-01-26)Fixed: Inherited extends with same name showed up as same.
Now show relative to basedir if possible, else full.
[jensens]Fixed: Relative extends in urls were broken.
[jensens]1.6.5 (2017-07-03)Bug fixes:Relative Paths should work now, tested with subdirectories.
[loechel]1.6.4 (2017-05-08)Fix: Default versions section nameversionswas not respected.
[jensens]1.6.3 (2017-05-05)Fixes #17: Requirements were missing.
[jensens]Optimization: Reduce load on PyPI when fetching release dates.
[jensens]Feature: Change package and version fields in html output to links so that you could open pypi page for each package.
[loechel]1.6.2 (2017-04-12)Fix: Regressions with version-annotations and stdout messages from buildout parser.
[loechel]Add more Tests
[loechel]1.6.1 (2017-04-07)Fix: #36 New buildout parser does not work with buildout.coredev
[loechel]1.6.0 (2017-04-07)Fix:IndexError: string index out of rangeerror with empty states in the formatter.
[thet]Development: Added basic tests to package.
[loechel]Fix: Changed parser.py to use functions from zc.buildout to get versions and versionannotations section names.
[loechel]Feature: Add function to extract date information from PyPI to analyze package age.
[loechel]Feature: Add new CLI options for an output file and show release dates.
[loechel]1.5.1 (2017-01-23)Fix Version Compare.
[loechel]1.5.0 (2016-10-15)Development: Use code analysis for QA (and fix issues with pep8 et al.)
[jensens]Fix: Manifest (jinja file was missing).
[jensens]Feature: Implement #25: Annotate versions used.
[jensens]1.4 (2016-09-30)Feature:
New option ‘-N’: feature to hide orphaned without updates.
This reduces the noise in a environment where orphaned are used by intend.
[jensens]1.3 (2016-05-19)Development: Add .editorconfig File to maintain code convetions following Plone API
[loechel]Feature: Add Support for Python 3
[loechel]Fix: Various documentation typos.
[jean]1.2.1 (2016-01-26)Feature: Cache buildout cfg files fetched over the network.
[jensens]Feature: It caches now responses from PyPI.
[jensens]1.1.2 (2016-01-21)Fix: Resolution order buildout extends chain was wrong. Also documented the
resolution order and included in own builodut a small example.
[jensens]Fix: Formatter printed a newline to much afterrequired by.
[jensens]Fix: Do not complain about missing track file.  If it is not there,
the buildout is simply not using the buildout extension.  [maurits]Fix #13: Added missingzc.buildoutrequirement.  [maurits]1.1.1 (2016-01-20)Fix: Orphan detection failed when no tracking file was present.
[jensens]Fix: Exception raised when no tracking file was present.
[jensens]Fix: Color of requirements was not set explicitly.
[jensens]1.1 (2016-01-19)Enhancement: show requirements
[jensens]Enhancement: machine readable output (json)
[jensens]Enhancement: write pure processing-info output to sys.stderr
[jensens]Fix #5 - Require setuptools>=12
[jensens]Fix #7 - Available update from ‘lazy’ 1.0 to 1.2 is not found.
[jensens]Enhancement: Rethink colors and document them, fixes #2 and #3.
[jensens]Enhancement: display output and show tracked info
[jensens]Feature: Add buildout extension to optional track required by and if its use at all
[jensens]1.0 (2016-01-13)Initial work.
[jensens]