diff options
author | Tim Harder <radhermit@gmail.com> | 2019-02-04 18:05:19 -0600 |
---|---|---|
committer | Tim Harder <radhermit@gmail.com> | 2019-02-04 18:08:20 -0600 |
commit | 049828c327a450ab8087c537be16e7dd571c5da3 (patch) | |
tree | c5069de6151e5368106979c7117a12ed00590b61 /setup.py | |
parent | addons: ProfileAddon: conditionalize default cache usage (diff) | |
download | pkgcheck-049828c327a450ab8087c537be16e7dd571c5da3.tar.gz pkgcheck-049828c327a450ab8087c537be16e7dd571c5da3.tar.bz2 pkgcheck-049828c327a450ab8087c537be16e7dd571c5da3.zip |
setup.py: generate plugin module cache
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -1,11 +1,30 @@ #!/usr/bin/env python3 +from distutils import log +import os + from setuptools import setup from snakeoil.dist import distutils_extensions as pkgdist pkgdist_setup, pkgdist_cmds = pkgdist.setup() +class install(pkgdist.install): + """Install wrapper to generate and install pkgcheck-related files.""" + + def run(self): + pkgdist.install.run(self) + if not self.dry_run: + # Install module plugincache + # TODO: move this to pkgdist once plugin support is moved to snakeoil + with pkgdist.syspath(pkgdist.PACKAGEDIR): + from pkgcheck import plugins + from pkgcore import plugin + log.info('Generating plugin cache') + path = os.path.join(self.install_purelib, 'pkgcheck', 'plugins') + plugin.initialize_cache(plugins, force=True, cache_dir=path) + + setup(**dict(pkgdist_setup, license='BSD', author='Brian Harring, Tim Harder', @@ -17,10 +36,12 @@ setup(**dict(pkgdist_setup, cmdclass=dict( pkgdist_cmds, test=pkgdist.pytest, + install=install, ), classifiers=[ 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', ], ) ) |