aquarist-labs / aquarium

Project Aquarium is a SUSE-sponsored open source project aiming at becoming an easy to use, rock solid storage appliance based on Ceph.
https://aquarist-labs.io/
Other
71 stars 23 forks source link

gravel: pyright doesn't like circular imports in gstate.py #466

Closed jecluis closed 1 year ago

jecluis commented 3 years ago

pyright basically ignores typing.TYPE_CHECKING by design when circular import detection is enabled, because they argue, reasonably imo, that it makes the code fragile -- what's being checked is different from what's being run, etc.

Even though in our case it's not a bad thing, I'm sure there must be a way to get rid of this.

Cycle detected in import chain
  /home/joao/code/projects/aquarist-labs/aquarium.git/src/gravel/controllers/gstate.py
  /home/joao/code/projects/aquarist-labs/aquarium.git/src/gravel/controllers/resources/inventory.pyPylance
Cycle detected in import chain
  /home/joao/code/projects/aquarist-labs/aquarium.git/src/gravel/controllers/gstate.py
  /home/joao/code/projects/aquarist-labs/aquarium.git/src/gravel/controllers/resources/inventory.py
  /home/joao/code/projects/aquarist-labs/aquarium.git/src/gravel/controllers/nodes/mgr.pyPylance
Cycle detected in import chain
  /home/joao/code/projects/aquarist-labs/aquarium.git/src/gravel/controllers/gstate.py
  /home/joao/code/projects/aquarist-labs/aquarium.git/src/gravel/controllers/resources/inventory.py
  /home/joao/code/projects/aquarist-labs/aquarium.git/src/gravel/controllers/nodes/mgr.py
  /home/joao/code/projects/aquarist-labs/aquarium.git/src/gravel/controllers/nodes/deployment.pyPylance
Cycle detected in import chain
  /home/joao/code/projects/aquarist-labs/aquarium.git/src/gravel/controllers/gstate.py
  /home/joao/code/projects/aquarist-labs/aquarium.git/src/gravel/controllers/resources/inventory.py
  /home/joao/code/projects/aquarist-labs/aquarium.git/src/gravel/controllers/nodes/mgr.py
  /home/joao/code/projects/aquarist-labs/aquarium.git/src/gravel/controllers/nodes/deployment.py
  /home/joao/code/projects/aquarist-labs/aquarium.git/src/gravel/controllers/nodes/etcd.pyPylance
jecluis commented 3 years ago

@jhesketh do you think this is something you can look into, without any particular rush?