Git Product home page Git Product logo

Comments (3)

thebjorn avatar thebjorn commented on August 13, 2024

You can globally remove the dependency on the command line by adding -x some_module or you can add it to a .pydeps file at the root of your project (check pydeps' own .pydeps file for syntax: https://github.com/thebjorn/pydeps/blob/master/.pydeps).

There is currently no way to only ignore some_module, but only for filename foo.py.

You can export the dependency graph as json with the --show-deps flag (it's a very simple format and it should be much easier to work with than removing/adding types to the source files), but there is unfortunately not a way to give a json dependency graph to pydeps for display..

from pydeps.

skroth avatar skroth commented on August 13, 2024

@thebjorn I think in cases where the imports under if TYPE_CHECKING are of the same package that we are trying to check, excluding it doesn't work. Is there any way to have pydeps not take into account imports under if TYPE_CHECKING?

from pydeps.

thebjorn avatar thebjorn commented on August 13, 2024

@skroth pydeps (and Python's modulefinder) doesn't do any semantic analysis, i.e. it only scans the .pyc files for opcodes related to imports, so unfortunately there is no way to check if-opcodes when they are generated(*).

(*) in Python I'm only aware of one case where the if is eliminated by the optimizer, and that is if <boolean-constant>:. This is py3+ only, since True and False became real constants in the language. Maybe that can solve your question (see https://discuss.python.org/t/moving-type-checking-out-of-typing-and-into-the-built-in-namespace/7870)

from pydeps.

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.