Code Monkey home page Code Monkey logo

Comments (3)

dvdjlaw avatar dvdjlaw commented on May 28, 2024

setup.py is using extras_requires for optional dependencies:

https://github.com/brianray/data-describe/blob/ba1bc43d3cd610563b85d12567ec5676f1a056b2/setup.py#L39-L44

Is this the recommended pattern or is there a different pattern to more explicitly define categories of dependencies? How should requirements.txt be organized?

Within the module imports, is the recommended pattern to update a variable on ImportError? Should there be one try block for each optional dependency, or one per application?

try:
    import pandas
except ImportError as e:
    _PANDAS_INSTALLED = False

from data-describe.

terrytangyuan avatar terrytangyuan commented on May 28, 2024

The pattern in requirements.txt looks like a good start. Though module imports need more attention.

Yes the try-except block above is recommended. I think it's better to have one try block for each optional dependency. For example, we can have a module named compat.py and put all the try-except blocks there and finally other modules would import variables like _PANDAS_INSTALLED from compat.py. Within geo module, we check geo module related dependencies.

from data-describe.

dvdjlaw avatar dvdjlaw commented on May 28, 2024

Resolved by #109

from data-describe.

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.