Skip to content

Commit 45936d4

Browse files
authored
Merge pull request #11 from soda480/0.0.8
Add pybuilder build plugins
2 parents 15a28bd + 5693cfe commit 45936d4

File tree

2 files changed

+9
-41
lines changed

2 files changed

+9
-41
lines changed

README.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,7 @@ for repo in client.get('/user/repos', _get='page'):
8181

8282
### Development ###
8383

84-
Ensure the latest version of Docker is installed on your development server.
85-
86-
Clone the repository:
87-
```bash
88-
cd
89-
git clone https://github.com/soda480/github3api.git
90-
cd github3api
91-
```
84+
Ensure the latest version of Docker is installed on your development server. Fork and clone the repository.
9285

9386
Build the Docker image:
9487
```sh

build.py

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,27 @@
1616
from pybuilder.core import use_plugin
1717
from pybuilder.core import init
1818
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
2319

2420
use_plugin('python.core')
2521
use_plugin('python.unittest')
2622
use_plugin('python.install_dependencies')
2723
use_plugin('python.flake8')
2824
use_plugin('python.coverage')
2925
use_plugin('python.distutils')
26+
use_plugin('pypi:pybuilder_radon', '~=0.1.2')
27+
use_plugin('pypi:pybuilder_bandit', '~=0.1.3')
3028

3129
name = 'github3api'
32-
authors = [
33-
Author('Emilio Reyes', 'emilio.reyes@intel.com')
34-
]
30+
authors = [Author('Emilio Reyes', 'emilio.reyes@intel.com')]
3531
summary = 'An advanced REST client for the GitHub API'
3632
url = 'https://github.com/soda480/github3api'
37-
version = '0.0.7'
33+
version = '0.0.8'
3834
default_task = [
3935
'clean',
4036
'analyze',
41-
'cyclomatic_complexity',
42-
'package'
43-
]
37+
'radon',
38+
'bandit',
39+
'package']
4440
license = 'Apache License, Version 2.0'
4541
description = summary
4642

@@ -72,25 +68,4 @@ def set_properties(project):
7268
'Topic :: Software Development :: Libraries',
7369
'Topic :: Software Development :: Libraries :: Python Modules',
7470
'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

Comments
 (0)