Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2023.9.6 duplicate "self" argument in rdfiltercatalog/__init__.pyi #7401

Open
JHucker opened this issue Apr 30, 2024 · 3 comments
Open

2023.9.6 duplicate "self" argument in rdfiltercatalog/__init__.pyi #7401

JHucker opened this issue Apr 30, 2024 · 3 comments
Assignees
Labels

Comments

@JHucker
Copy link

JHucker commented Apr 30, 2024

Describe the bug
Upgrading to 2023.9.6 fails mypy in my pre-commit when importing FilterCatalogParams:

/home/jacobhucker/miniforge3/envs/min_rep_issue/lib/python3.11/site-packages/rdkit-stubs/Chem/rdfiltercatalog/__init__.pyi:671: error: Duplicate argument "self" in function definition
Found 1 error in 1 file (errors prevented further checking)

Viewing this file, self appears untyped and again typed:

class PythonFilterMatcher(FilterMatcherBase):
    __instance_size__: typing.ClassVar[int] = 72
    @staticmethod
    def __reduce__(*args, **kwargs):
        ...
    def __init__(self, self: typing.Any) -> None:
        """
            C++ signature :
                void __init__(_object*,_object*)
        """

To Reproduce
Minimal conda environment yaml:

name: min_rep_issue
channels:
  - conda-forge
dependencies:
  - python=3.11.8
  - pip
  - pip:
    - rdkit==2023.9.6
    - mypy==1.10.0

Minimal main.py:

from rdkit.Chem.rdfiltercatalog import FilterCatalogParams

if __name__ == "__main__":
    _ = FilterCatalogParams()

Running mypy:

$ mypy  .
/home/jacobhucker/miniforge3/envs/min_rep_issue/lib/python3.11/site-packages/rdkit-stubs/Chem/rdfiltercatalog/__init__.pyi:671: error: Duplicate argument "self" in function definition
Found 1 error in 1 file (errors prevented further checking)

Expected behavior
There should be no errors detected by mypy when scanning the above main.py example.

Configuration (please complete the following information):

  • RDKit version: 2023.9.6
  • OS: Pop!_OS 22.04 LTS
  • Python version (if relevant): 3.11.8
  • Are you using conda? In the minimal example yes, but this firstly originated when installing rdkit via poetry
  • If you are using conda, which channel did you install the rdkit from? as above
  • If you are not using conda: how did you install the RDKit? Via poetry 1.8.2
@JHucker JHucker added the bug label Apr 30, 2024
@ptosco
Copy link
Contributor

ptosco commented Apr 30, 2024

Thanks for reporting. Automated stub generation with C++ Python wrappers is tricky. I'll fix that.

@ptosco ptosco self-assigned this Apr 30, 2024
@lukasturcani
Copy link
Contributor

I have a similar issue with rdkit-stubs/Chem/rdMolDescriptors.pyi:185: error: Duplicate argument "self" in function definition

@mikemhenry
Copy link

I've been having the same issues, so far pinning to rdkit=2023.09.5 fixes it, which is okay since for now we only need to worry about this error when running mypy

andrewtarzia added a commit to JelfsMaterialsGroup/stko that referenced this issue May 15, 2024
Make ruff stricter and clean up doc strings throughout src and examples directories.

mypy fails due to issue with rdkit version: rdkit/rdkit#7401

We will wait till that is solved to fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants