Skip to content

Commit 2b47e9d

Browse files
committed
Clear ScanCode cache after installation
1 parent ea17fc9 commit 2b47e9d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

setup.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@
44
# SPDX-License-Identifier: Apache-2.0
55
from codecs import open
66
from setuptools import setup, find_packages
7+
from distutils.command.install import install as _install
8+
9+
10+
def _post_install(dir):
11+
from subprocess import call
12+
call(['scancode', '--reindex-licenses'])
13+
14+
15+
class install(_install):
16+
def run(self):
17+
_install.run(self)
18+
self.execute(_post_install, (self.install_lib,),
19+
msg="Running post install task")
20+
721

822
with open('README.md', 'r', 'utf-8') as f:
923
readme = f.read()
@@ -30,6 +44,7 @@
3044
"Programming Language :: Python :: 3.8",
3145
"Programming Language :: Python :: 3.9", ],
3246
python_requires=">=3.7",
47+
cmdclass={'install': install},
3348
install_requires=required,
3449
extras_require={":python_version>'3.6'": ["scanoss>=0.7.0"],
3550
":python_version<'3.7'": ["dataclasses", "scanoss"]},

0 commit comments

Comments
 (0)