Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyroma 2.4 breaks prospector #276

Closed
tylerstapler-wf opened this issue Aug 15, 2018 · 5 comments
Closed

Pyroma 2.4 breaks prospector #276

tylerstapler-wf opened this issue Aug 15, 2018 · 5 comments

Comments

@tylerstapler-wf
Copy link

I get this error when running prospector with pyroma 2.4 installed.

prospector
Traceback (most recent call last):
  File "/usr/local/bin/prospector", line 7, in <module>
    from prospector.run import main
  File "/usr/local/lib/python3.6/site-packages/prospector/run.py", line 8, in
 <module>
    from prospector import blender, postfilter, tools
  File "/usr/local/lib/python3.6/site-packages/prospector/tools/__init__.py",
 line 48, in <module>
    'pyroma': _optional_tool('pyroma'),
  File "/usr/local/lib/python3.6/site-packages/prospector/tools/__init__.py",
 line 29, in _optional_tool
    tool_package = __import__(package_name, fromlist=[tool_class_name])
  File "/usr/local/lib/python3.6/site-packages/prospector/tools/pyroma/__init
__.py", line 40, in <module>
    ratings.PackageDocs: 'PYR17',
AttributeError: module 'pyroma.ratings' has no attribute 'PackageDocs'
@volans-
Copy link
Contributor

volans- commented Aug 16, 2018

Confirmed

volans- added a commit to volans-/prospector that referenced this issue Aug 17, 2018
As there have been some changes in the available checks in Pyroma
recently, make the initialization more robust and future-proof
dynamically creating the mapping of available checks and Prospector
codes, using PYRUNKNOWN for eventual new checks not yet mapped in
Prospector.

Closes prospector-dev#276
carlio pushed a commit that referenced this issue Aug 18, 2018
… Original PR commit message: "Fix Pyroma >= 2.4 initialization"
@carlio
Copy link
Contributor

carlio commented Aug 18, 2018

@volans- thanks for the PR. I fixed this locally before noticing your PR however yours is a better approach so I merged it over the top of my fix :-)

@carlio
Copy link
Contributor

carlio commented Aug 18, 2018

Version 1.1.2 has this fix.

@tylerstapler-wf
Copy link
Author

Thanks for the quick fix!

@volans-
Copy link
Contributor

volans- commented Aug 20, 2018

@carlio thanks for accepting my PR and make already new release!

I've tried to keep the diff at the minimum in that PR, but I think it's possible to clean it up a bit more in case you want, getting rid of both PYROMA_CODES and PYROMA_TEST_CLASSES variables altogether and using __name__ to get the name of the classes and check them in the mapping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants