MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / check_scancode_version

Function check_scancode_version

src/scancode/outdated.py:133–155  ·  view source on GitHub ↗

Check for an updated version of scancode-toolkit. Return a message to display if outdated or None. Limit the frequency of checks to once per week. State is stored in the scancode_cache_dir. If `force` is True, redo a PyPI remote check.

(
    installed_version=scancode_version,
    release_date=scancode_release_date,
    new_version_url='https://pypi.org/pypi/scancode-toolkit/json',
    force=False,
)

Source from the content-addressed store, hash-verified

131
132
133def check_scancode_version(
134 installed_version=scancode_version,
135 release_date=scancode_release_date,
136 new_version_url='https://pypi.org/pypi/scancode-toolkit/json',
137 force=False,
138):
139 """
140 Check for an updated version of scancode-toolkit. Return a message to
141 display if outdated or None. Limit the frequency of checks to once per week.
142 State is stored in the scancode_cache_dir. If `force` is True, redo a PyPI
143 remote check.
144 """
145 newer_version = fetch_newer_version(
146 installed_version=installed_version,
147 new_version_url=new_version_url,
148 force=force,
149 )
150 if newer_version:
151 return build_outdated_message(
152 installed_version=installed_version,
153 release_date=release_date,
154 newer_version=newer_version,
155 )
156
157
158def fetch_newer_version(

Callers 1

scancodeFunction · 0.90

Calls 2

fetch_newer_versionFunction · 0.85
build_outdated_messageFunction · 0.85

Tested by

no test coverage detected