delvtech / pypechain

Static Python bindings for Ethereum smart contracts.
Apache License 2.0
9 stars 2 forks source link

[ISSUE] Pylint complains when importing type files from hyperdrivetypes #129

Closed slundqui closed 1 month ago

slundqui commented 2 months ago

Importing *Types files from hyperdrivetypes result in pylint errors:

from hyperdrivetypes import (
    ERC20ForwarderFactoryContract,
    HyperdriveFactoryContract,
    HyperdriveFactoryTypes,
    IERC20Contract,
    IHyperdriveTypes,
    IMorphoBlueHyperdriveTypes,
    LPMathContract,
    MorphoBlueConversionsContract,
    MorphoBlueHyperdriveCoreDeployerContract,
    MorphoBlueHyperdriveDeployerCoordinatorContract,
    MorphoBlueTarget0DeployerContract,
    MorphoBlueTarget1DeployerContract,
    MorphoBlueTarget2DeployerContract,
    MorphoBlueTarget3DeployerContract,
    MorphoBlueTarget4DeployerContract,
)
************* Module test_morphoblue_usde_dai_hyperdrive
.scripts/test_morphoblue_usde_dai_hyperdrive.py:1:0: C0114: Missing module docstring (missing-module-docstring)
.scripts/test_morphoblue_usde_dai_hyperdrive.py:7:0: E0611: No name 'HyperdriveFactoryTypes' in module 'hyperdrivetypes' (no-name-in-module)
.scripts/test_morphoblue_usde_dai_hyperdrive.py:7:0: E0611: No name 'IHyperdriveTypes' in module 'hyperdrivetypes' (no-name-in-module)
.scripts/test_morphoblue_usde_dai_hyperdrive.py:7:0: E0611: No name 'IMorphoBlueHyperdriveTypes' in module 'hyperdrivetypes' (no-name-in-module)

My guess is that it has something to do with the import * in __init__.py. We likely should try to codegen what we import, and constrain what packages we actually expose.

slundqui commented 2 months ago

https://github.com/delvtech/pypechain/pull/132 potentially solves this issue

slundqui commented 1 month ago

This likely was due to namespace collision, which was solved in https://github.com/delvtech/pypechain/pull/132