GithubHelp home page GithubHelp logo

Comments (8)

willkg avatar willkg commented on June 8, 2024

I poked around and we can "cheat" and do:

import django_nose.management

That's a no-op __init__.py, so it doesn't import anything.

from django-nose.

squiddy avatar squiddy commented on June 8, 2024

That's what I tried, and it didn't work for me because it's still going through django_nose/__init__.py here.

from django-nose.

willkg avatar willkg commented on June 8, 2024

Oh, bah. I see what you're getting at.

from django-nose.

erikrose avatar erikrose commented on June 8, 2024

Boy, that's a tough one. I can't really remove the imports from __init__ until 2.0, because that's been the public API to this point. Hmm.

from django-nose.

willkg avatar willkg commented on June 8, 2024

What we ended up doing was a goofy assumption where if they have nose installed, then we add django-nose to the INSTALLED_APPS list. That'll do for now, though it does have some edge cases.

from django-nose.

ke1g avatar ke1g commented on June 8, 2024

imp.find_module('django_nose')

(you have to import imp)

This raises ImportError if the module or package is not on the path, but doesn't actually import it if it is there.

(If it's a module, the first element of the tuple returned will be an open file object for the file. If it's a package, that first element will be None. You should probably close the file if there is one.)

from django-nose.

erikrose avatar erikrose commented on June 8, 2024

Good call! Let me know if that wouldn't have worked for you, @willkg.

from django-nose.

willkg avatar willkg commented on June 8, 2024

That works super. Thanks!

from django-nose.

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.