|
16 | 16 | from pybuilder.core import use_plugin |
17 | 17 | from pybuilder.core import init |
18 | 18 | from pybuilder.core import Author |
19 | | -from pybuilder.core import task |
20 | | -from pybuilder.pluginhelper.external_command import ExternalCommandBuilder |
21 | | -from pybuilder.utils import read_file |
22 | | -import json |
23 | 19 |
|
24 | 20 | use_plugin('python.core') |
25 | 21 | use_plugin('python.unittest') |
26 | 22 | use_plugin('python.install_dependencies') |
27 | 23 | use_plugin('python.flake8') |
28 | 24 | use_plugin('python.coverage') |
29 | 25 | use_plugin('python.distutils') |
| 26 | +use_plugin('pypi:pybuilder_radon', '~=0.1.2') |
| 27 | +use_plugin('pypi:pybuilder_bandit', '~=0.1.3') |
30 | 28 |
|
31 | 29 | name = 'github3api' |
32 | | -authors = [ |
33 | | - Author('Emilio Reyes', 'emilio.reyes@intel.com') |
34 | | -] |
| 30 | +authors = [Author('Emilio Reyes', 'emilio.reyes@intel.com')] |
35 | 31 | summary = 'An advanced REST client for the GitHub API' |
36 | 32 | url = 'https://github.com/soda480/github3api' |
37 | | -version = '0.0.7' |
| 33 | +version = '0.0.8' |
38 | 34 | default_task = [ |
39 | 35 | 'clean', |
40 | 36 | 'analyze', |
41 | | - 'cyclomatic_complexity', |
42 | | - 'package' |
43 | | -] |
| 37 | + 'radon', |
| 38 | + 'bandit', |
| 39 | + 'package'] |
44 | 40 | license = 'Apache License, Version 2.0' |
45 | 41 | description = summary |
46 | 42 |
|
@@ -72,25 +68,4 @@ def set_properties(project): |
72 | 68 | 'Topic :: Software Development :: Libraries', |
73 | 69 | 'Topic :: Software Development :: Libraries :: Python Modules', |
74 | 70 | 'Topic :: System :: Networking', |
75 | | - 'Topic :: System :: Systems Administration' |
76 | | - ]) |
77 | | - |
78 | | - |
79 | | -@task('cyclomatic_complexity', description='calculates and publishes cyclomatic complexity') |
80 | | -def cyclomatic_complexity(project, logger): |
81 | | - try: |
82 | | - command = ExternalCommandBuilder('radon', project) |
83 | | - command.use_argument('cc') |
84 | | - command.use_argument('-a') |
85 | | - result = command.run_on_production_source_files(logger) |
86 | | - if len(result.error_report_lines) > 0: |
87 | | - logger.error('Errors while running radon, see {0}'.format(result.error_report_file)) |
88 | | - for line in result.report_lines[:-1]: |
89 | | - logger.debug(line.strip()) |
90 | | - if not result.report_lines: |
91 | | - return |
92 | | - average_complexity_line = result.report_lines[-1].strip() |
93 | | - logger.info(average_complexity_line) |
94 | | - |
95 | | - except Exception as exception: |
96 | | - print('ERROR: unable to execute cyclomatic complexity due to: {}'.format(str(exception))) |
| 71 | + 'Topic :: System :: Systems Administration']) |
0 commit comments