Skip to content

Commit

Permalink
Merge pull request #1708 from nexB/111-new-version-notification
Browse files Browse the repository at this point in the history
New version notification #111 #1688

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
  • Loading branch information
pombredanne authored Sep 3, 2019
2 parents 7466489 + 6bb9822 commit 1af5ac8
Show file tree
Hide file tree
Showing 7 changed files with 617 additions and 9 deletions.
26 changes: 20 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,39 @@ jobs:
bin/py.test -n 2 -vvs --reruns=3 --test-suite=all \
--ignore=tests/scancode \
--ignore=tests/cluecode \
--ignore=tests/licensedcode
--ignore=tests/licensedcode \
--cov=src --cov-report=term --cov-report=xml
bin/codecov --token "$CODECOV_TOKEN"
scancode: bin/py.test --reruns=3 -vvs --test-suite=all tests/scancode
scancode: |
bin/py.test --reruns=3 -vvs --test-suite=all tests/scancode \
--cov=src --cov-report=term --cov-report=xml
bin/codecov --token "$CODECOV_TOKEN"
cluecode: bin/py.test -n 2 --reruns=3 -vvs --test-suite=all tests/cluecode
cluecode: |
bin/py.test -n 2 --reruns=3 -vvs --test-suite=all tests/cluecode \
--cov=src --cov-report=term --cov-report=xml
bin/codecov --token "$CODECOV_TOKEN"
license_base: |
bin/py.test -n 2 --reruns=3 -vvs --test-suite=all \
--ignore=tests/licensedcode/test_zzzz_cache.py \
--ignore=tests/licensedcode/test_detection_datadriven1.py \
tests/licensedcode
tests/licensedcode \
--cov=src --cov-report=term --cov-report=xml
bin/codecov --token "$CODECOV_TOKEN"
license_main: |
bin/py.test -n 2 --reruns=3 -vvs --test-suite=all \
tests/licensedcode/test_detection_datadriven1.py
tests/licensedcode/test_detection_datadriven1.py \
--cov=src --cov-report=term --cov-report=xml
bin/codecov --token "$CODECOV_TOKEN"
license_cache: |
bin/py.test -n 2 --reruns=3 -vvs --test-suite=all \
tests/licensedcode/test_zzzz_cache.py
tests/licensedcode/test_zzzz_cache.py \
--cov=src --cov-report=term --cov-report=xml
bin/codecov --token "$CODECOV_TOKEN"
- template: etc/ci/azure-win.yml
parameters:
Expand Down
11 changes: 8 additions & 3 deletions src/scancode/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@ def scancode(ctx, input, # NOQA
Other **kwargs are passed down to plugins as CommandOption indirectly
through Click context machinery.
"""

success = False
try:
# Validate CLI UI options dependencies and other CLI-specific inits
Expand Down Expand Up @@ -513,6 +512,12 @@ def scancode(ctx, input, # NOQA
echo_func=echo_stderr,
*args, **kwargs)

# check for updates
from scancode.outdated import check_scancode_version
outdated = check_scancode_version()
if not quiet and outdated:
echo_stderr(outdated, fg='yellow')

except click.UsageError as e:
# this will exit
raise e
Expand Down Expand Up @@ -1180,7 +1185,7 @@ def scan_codebase(codebase, scanners, processes=1, timeout=DEFAULT_TIMEOUT,
location, rid, scan_errors, scan_time, scan_result, scan_timings = scans.next()
else:
location, rid, scan_errors, scan_time, scan_result, scan_timings = next(scans)

if TRACE_DEEP:
logger_debug(
'scan_codebase: location:', location, 'results:', scan_result)
Expand Down Expand Up @@ -1253,7 +1258,7 @@ def terminate_pool(pool):


def terminate_pool_with_backoff(pool, number_of_trials=3):
# try a few times to terminate,
# try a few times to terminate,
for trial in range(number_of_trials, 1):
try:
pool.terminate()
Expand Down
8 changes: 8 additions & 0 deletions src/scancode/outdated.ABOUT
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
about_resource: outdated.py
name: pip
version: 9974f2
download_url: https://raw.githubusercontent.com/pypa/pip/9974f274e1c86fb556b5d51dcfd2d4dc637b7b67/pip/utils/outdated.py
license: mit
notice_file: outdated.NOTICE
license_text_file: outdated.LICENSE
notes: this code was derived and heavily modified from pip/utils/outdated.py.
20 changes: 20 additions & 0 deletions src/scancode/outdated.LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 2008-2014 The pip developers (see outdated.NOTICE file)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
213 changes: 213 additions & 0 deletions src/scancode/outdated.NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
The following authors have contributed to pip:
Adam Wentz <awentz@theonion.com>
Aleks Bunin <github@compuix.com>
Alex Gaynor <alex.gaynor@gmail.com>
Alex Grönholm <alex.gronholm@nextday.fi>
Alex Morega <alex@grep.ro>
Alexandre Conrad <alexandre.conrad@gmail.com>
Alli <alzeih@users.noreply.github.com>
Anatoly Techtonik <techtonik@gmail.com>
Andrei Geacar <andrei.geacar@gmail.com>
Andrey Bulgakov <mail@andreiko.ru>
Anrs Hu <anrs@douban.com>
Anton Patrushev <apatrushev@gmail.com>
Antonio Alvarado Hernandez <tnotstar@gmail.com>
Antti Kaihola <akaihol+github@ambitone.com>
Armin Ronacher <armin.ronacher@active-4.com>
Ashley Manton <ajd.manton@googlemail.com>
Baptiste Mispelon <bmispelon@gmail.com>
Ben Darnell <ben@bendarnell.com>
Ben Rosser <rosser.bjr@gmail.com>
Bence Nagy <bence@underyx.me>
Berker Peksag <berker.peksag@gmail.com>
Bernardo B. Marques <bernardo.fire@gmail.com>
Bogdan Opanchuk <bogdan@opanchuk.net>
Brad Erickson <eosrei@gmail.com>
Bradley Ayers <bradley.ayers@gmail.com>
Brian Rosner <brosner@gmail.com>
Bruno Renié <brutasse@gmail.com>
Buck Golemon <buck@yelp.com>
Bussonnier Matthias <bussonniermatthias@gmail.com>
Carl Meyer <carl@oddbird.net>
Chris Brinker <chris.brinker@gmail.com>
Chris Jerdonek <chris.jerdonek@gmail.com>
Chris McDonough <chrism@plope.com>
Chris Wolfe <chriswwolfe@gmail.com>
Christian Oudard <christian.oudard@gmail.com>
Clark Boylan <clark.boylan@gmail.com>
Clay McClure <clay@daemons.net>
Cody Soyland <codysoyland@gmail.com>
Cory Benfield <lukasaoz@gmail.com>
Craig Kerstiens <craig.kerstiens@gmail.com>
Cristian Sorinel <cristian.sorinel@gmail.com>
Dan Savilonis <djs@n-cube.org>
Dan Sully <daniel-github@electricrain.com>
Daniel Collins <accounts@dac.io>
Daniel Hahler <git@thequod.de>
Daniel Holth <dholth@fastmail.fm>
Daniel Jost <torpedojost@gmail.com>
Daniele Procida <daniele@vurt.org>
Dav Clark <davclark@gmail.com>
Dave Abrahams <dave@boostpro.com>
David Aguilar <davvid@gmail.com>
David Black <db@d1b.org>
David Evans <d@drhevans.com>
David Pursehouse <david.pursehouse@gmail.com>
David Wales <daviewales@gmail.com>
Davidovich <david.genest@gmail.com>
derwolfe <chriswwolfe@gmail.com>
Dmitry Gladkov <dmitry.gladkov@gmail.com>
Donald Stufft <donald@stufft.io>
Dongweiming <dongweiming@admaster.com.cn>
Dwayne Bailey <dwayne@translate.org.za>
Endoh Takanao <djmchl@gmail.com>
enoch <lanxenet@gmail.com>
Eric Gillingham <Gillingham@bikezen.net>
Eric Hanchrow <eric.hanchrow@gmail.com>
Erik M. Bray <embray@stsci.edu>
Eugene Vereshchagin <evvers@gmail.com>
Florian Briand <ownerfrance+github@hotmail.com>
Francesco <f.guerrieri@gmail.com>
Gabriel de Perthuis <g2p.code@gmail.com>
Garry Polley <garrympolley@gmail.com>
Geoffrey Lehée <geoffrey@lehee.name>
George Song <george@55minutes.com>
Georgi Valkov <georgi.t.valkov@gmail.com>
gizmoguy1 <gizmoguy1@gmail.com>
Guilherme Espada <porcariadagata@gmail.com>
Guy Rozendorn <guy@rzn.co.il>
Herbert Pfennig <herbert@albinen.com>
Hsiaoming Yang <lepture@me.com>
Hugo Lopes Tavares <hltbra@gmail.com>
Hynek Schlawack <hs@ox.cx>
Ian Bicking <ianb@colorstudy.com>
Ian Cordasco <graffatcolmingov@gmail.com>
Igor Sobreira <igor@igorsobreira.com>
Ilya Baryshev <baryshev@gmail.com>
INADA Naoki <songofacandy@gmail.com>
Ionel Cristian Mărieș <contact@ionelmc.ro>
Ionel Maries Cristian <ionel.mc@gmail.com>
Jakub Stasiak <kuba.stasiak@gmail.com>
Jakub Vysoky <jakub@borka.cz>
James Cleveland <jc@blit.cc>
James Polley <jp@jamezpolley.com>
Jan Pokorný <jpokorny@redhat.com>
Jannis Leidel <jannis@leidel.info>
jarondl <me@jarondl.net>
Jay Graves <jay@skabber.com>
Jeff Dairiki <dairiki@dairiki.org>
Jim Garrison <jim@garrison.cc>
John-Scott Atlakson <john.scott.atlakson@gmail.com>
Jon Parise <jon@indelible.org>
Jon Wayne Parrott <jjramone13@gmail.com>
Jonas Nockert <jonasnockert@gmail.com>
Jorge Niedbalski <niedbalski@gmail.com>
Joseph Long <jdl@fastmail.fm>
Josh Bronson <jabronson@gmail.com>
Josh Hansen <josh@skwash.net>
Josh Schneier <josh.schneier@gmail.com>
Jyrki Pulliainen <jyrki@spotify.com>
Kamal Bin Mustafa <kamal@smach.net>
Kelsey Hightower <kelsey.hightower@gmail.com>
Kenneth Belitzky <kenny@belitzky.com>
Kenneth Reitz <me@kennethreitz.com>
Kevin Burke <kev@inburke.com>
Kevin Frommelt <kevin.frommelt@webfilings.com>
Kumar McMillan <kumar.mcmillan@gmail.com>
Kyle Persohn <kyle.persohn@gmail.com>
Laurent Bristiel <laurent@bristiel.com>
Leon Sasson <leonsassonha@gmail.com>
Lev Givon <lev@columbia.edu>
Lincoln de Sousa <lincoln@comum.org>
Ludovic Gasc <gmludo@gmail.com>
Luke Macken <lmacken@redhat.com>
Marc Abramowitz <marc@marc-abramowitz.com>
Marc Tamlyn <marc.tamlyn@gmail.com>
Marcus Smith <qwcode@gmail.com>
Mark Kohler <mark.kohler@proteinsimple.com>
Markus Hametner <fin+github@xbhd.org>
Masklinn <bitbucket.org@masklinn.net>
Matej Stuchlik <mstuchli@redhat.com>
Matt Good <matt@matt-good.net>
Matt Maker <trip@monstro.us>
Matt Robenolt <matt@ydekproductions.com>
Matthew Einhorn <moiein2000@gmail.com>
Matthew Gilliard <matthew.gilliard@gmail.com>
Matthew Iversen <teh.ivo@gmail.com>
Matthew Trumbell <matthew@thirdstonepartners.com>
Maxime Rouyrre <rouyrre+git@gmail.com>
Michael E. Karpeles <michael.karpeles@gmail.com>
Michael Williamson <mike@zwobble.org>
Miguel Araujo Perez <miguel.araujo.perez@gmail.com>
Mihir Singh <git.service@mihirsingh.com>
MinRK <benjaminrk@gmail.com>
Monty Taylor <mordred@inaugust.com>
Nick Stenning <nick@whiteink.com>
Nowell Strite <nowell@strite.org>
Oliver Tonnhofer <olt@bogosoft.com>
Olivier Girardot <ssaboum@gmail.com>
Ollie Rutherfurd <orutherfurd@gmail.com>
Oren Held <orenhe@il.ibm.com>
Oscar Benjamin <oscar.j.benjamin@gmail.com>
Patrick Dubroy <pdubroy@gmail.com>
Patrick Jenkins <patrick@socialgrowthtechnologies.com>
Patrick Lawson <pl@foursquare.com>
patricktokeeffe <patricktokeeffe@users.noreply.github.com>
Paul Moore <p.f.moore@gmail.com>
Paul Nasrat <pnasrat@gmail.com>
Paul Oswald <pauloswald@gmail.com>
Paul van der Linden <mail@paultjuh.org>
Pawel Jasinski <pawel.jasinski@gmail.com>
Peter Waller <peter.waller@gmail.com>
Phaneendra Chiruvella <hi@pcx.io>
Phil Freo <phil@philfreo.com>
Phil Whelan <phil123@gmail.com>
Philippe Ombredanne <pombredanne@gmail.com>
Pierre-Yves Rofes <github@rofes.fr>
Piet Delport <pjdelport@gmail.com>
Preston Holmes <preston@ptone.com>
Przemek Wrzos <hetmankp@none>
Qiangning Hong <hongqn@gmail.com>
Rafael Caricio <rafael.jacinto@gmail.com>
Ralf Schmitt <ralf@systemexit.de>
Razzi Abuissa <razzi53@gmail.com>
Remi Rampin <remirampin@gmail.com>
Rene Dudfield <renesd@gmail.com>
Richard Jones <r1chardj0n3s@gmail.com>
RobberPhex <robberphex@gmail.com>
Robert Collins <rbtcollins@hp.com>
Roey Berman <roey.berman@gmail.com>
Roman Bogorodskiy <roman.bogorodskiy@ericsson.com>
Romuald Brunet <romuald@chivil.com>
Ronny Pfannschmidt <Ronny.Pfannschmidt@gmx.de>
Rory McCann <rory@technomancy.org>
Ross Brattain <ross.b.brattain@intel.com>
schlamar <marc.schlaich@gmail.com>
Sergey Vasilyev <nolar@nolar.info>
Seth Woodworth <seth@sethish.com>
Simeon Visser <svisser@users.noreply.github.com>
Simon Cross <hodgestar@gmail.com>
Stavros Korokithakis <stavros@korokithakis.net>
Stefan Scherfke <stefan@sofa-rockers.org>
Steven Myint <git@stevenmyint.com>
Stéphane Klein <contact@stephane-klein.info>
Takayuki SHIMIZUKAWA <shimizukawa@gmail.com>
Thomas Fenzl <thomas.fenzl@gmail.com>
Thomas Guettler <tguettler@tbz-pariv.de>
Thomas Johansson <devnull@localhost>
Thomas Kluyver <takowl@gmail.com>
Tim Harder <radhermit@gmail.com>
Tomer Chachamu <tomer.chachamu@gmail.com>
Toshio Kuratomi <toshio@fedoraproject.org>
Travis Swicegood <development@domain51.com>
Valentin Haenel <valentin.haenel@gmx.de>
Victor Stinner <victor.stinner@gmail.com>
Vinay Sajip <vinay_sajip@yahoo.co.uk>
Vitaly Babiy <vbabiy86@gmail.com>
W. Trevor King <wking@drexel.edu>
Wil Tan <wil@dready.org>
Xavier Fernandez <xav.fernandez@gmail.com>
Yoval P <yoval@gmx.com>
Yu Jian <askingyj@gmail.com>
Zearin <zearin@gonk.net>
Zhiping Deng <kofreestyler@gmail.com>
Loading

0 comments on commit 1af5ac8

Please sign in to comment.