Skip to content

Commit

Permalink
[refs #276 #277] Merging PR after accidentally fixing the same issue.…
Browse files Browse the repository at this point in the history
… Original PR commit message: "Fix Pyroma >= 2.4 initialization"
  • Loading branch information
carlio committed Aug 18, 2018
2 parents 7d17774 + 1970792 commit e4cfbe1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Prospector Changelog
=======

## Version 1.1.2
- [#276](https://github.com/PyCQA/prospector/issues/276) Updating required Pyroma version and removing some warnings which were removed from Pyroma
- [#276](https://github.com/PyCQA/prospector/issues/276) Updating required Pyroma version and removing some warnings which were removed from Pyroma - thanks [@volans-](https://github.com/volans-) for PR [#277](https://github.com/PyCQA/prospector/pull/277)

## Version 1.1.1
- Removing [pylint-common](https://github.com/landscapeio/pylint-common) as a direct dependency as it does not add a lot of utility and is not kept up to date as much as other plugins
Expand Down
44 changes: 25 additions & 19 deletions prospector/tools/pyroma/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,32 @@
logging.basicConfig = _old


PYROMA_CODES = {
ratings.Name: 'PYR01',
ratings.Version: 'PYR02',
ratings.VersionIsString: 'PYR03',
ratings.PEPVersion: 'PYR04',
ratings.Description: 'PYR05',
ratings.LongDescription: 'PYR06',
ratings.Classifiers: 'PYR07',
ratings.PythonVersion: 'PYR08',
ratings.Keywords: 'PYR09',
ratings.Author: 'PYR10',
ratings.AuthorEmail: 'PYR11',
ratings.Url: 'PYR12',
ratings.License: 'PYR13',
ratings.LicenceClassifier: 'PYR14',
ratings.ZipSafe: 'PYR15',
ratings.SDist: 'PYR16',
ratings.ValidREST: 'PYR18',
PYROMA_ALL_CODES = {
'Name': 'PYR01',
'Version': 'PYR02',
'VersionIsString': 'PYR03',
'PEPVersion': 'PYR04',
'Description': 'PYR05',
'LongDescription': 'PYR06',
'Classifiers': 'PYR07',
'PythonVersion': 'PYR08',
'Keywords': 'PYR09',
'Author': 'PYR10',
'AuthorEmail': 'PYR11',
'Url': 'PYR12',
'License': 'PYR13',
'LicenceClassifier': 'PYR14',
'ZipSafe': 'PYR15',
'SDist': 'PYR16',
'PackageDocs': 'PYR17',
'ValidREST': 'PYR18',
'BusFactor': 'PYR19',
}

PYROMA_CODES = {}
for name, code in PYROMA_ALL_CODES.items():
if hasattr(ratings, name):
PYROMA_CODES[getattr(ratings, name)] = code

PYROMA_TEST_CLASSES = [t.__class__ for t in ratings.ALL_TESTS]

Expand All @@ -64,7 +70,7 @@ def run(self, found_files):

all_tests = [m() for m in PYROMA_TEST_CLASSES]
for test in all_tests:
code = PYROMA_CODES[test.__class__]
code = PYROMA_CODES.get(test.__class__, 'PYRUNKNOWN')

if code in self.ignore_codes:
continue
Expand Down

0 comments on commit e4cfbe1

Please sign in to comment.