Coder Social home page Coder Social logo

No module named pep8 about django-moderation HOT 5 CLOSED

dominno avatar dominno commented on August 17, 2024
No module named pep8

from django-moderation.

Comments (5)

dominno avatar dominno commented on August 17, 2024

If you run tests from your project, then pep8 need to be installed. If you run tests using description from README.rst, then it will automatically install pep8 when you run bin/buildout.

It can be fixed by trying to import it in side of test, it will cause test to fail when it's not installed. Or pep8 could be placed inside of setup.py as requirement, then it will be installed when you do setup.py install. What solution will be better ?

from django-moderation.

hexabits avatar hexabits commented on August 17, 2024

Well for people who neither use buildout nor used setup.py (like me) to install it, there is currently no recourse.

It seems to me that a test utilizing PEP8 module is unnecessary because:

  • The tests should have the same dependencies as the app itself, especially no extra dependencies.
  • Tests should be testing for a specific functionality of the app, not to report on something general like PEP8 compliance. It would be like packaging a test to show test coverage. :)

I understand you need to monitor PEP8 compliance, but it's not something integral to the app so it should be a test that lies outside of the tests packaged with the app. It's really only the package distributors' concern whether or not PEP8 compliance is 100%, not the end user's.

from django-moderation.

dominno avatar dominno commented on August 17, 2024

For some tests i also use for example Mock library. What to do with those tests ? Maybe it will be better to create option skip_moderation_tests if True then when calling manage.py test of your project, tests for moderation will not be run. Just like in South reusable app. http://south.aeracode.org/docs/settings.html#skip-south-tests

I think that testing code for PEP8 is necessary because when writing tests and code, when running tests i can see right a way if new code is PEP8 compatible. It's very useful.

I

from django-moderation.

hexabits avatar hexabits commented on August 17, 2024

Of course the tests are needed, but I don't think they need to be bundled with the app if they require many different/extra dependencies. As it stands I cannot run manage test to completion because the import errors stop it.

With PEP8 for example, you can run external tests on the code before committing it, but an end-user probably doesn't need to verify PEP8-compliance themselves. So something like including a src/tests folder with the project that you need to run PEP8 and other tests with, but src/moderation/tests will be free of those kinds of tests that aren't needed by the end user.

from django-moderation.

dominno avatar dominno commented on August 17, 2024

Fixed imports of test tools used in tests. Now test can be run when tools like: mock, pep8 are not istalled but this tests will not pass until its installed. Closed by f53a3f9

from django-moderation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.