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

Mypy #missing-imports not picking up typehints #94

Closed
guywilsonjr opened this issue Jul 10, 2024 · 1 comment
Closed

Mypy #missing-imports not picking up typehints #94

guywilsonjr opened this issue Jul 10, 2024 · 1 comment

Comments

@guywilsonjr
Copy link

I'm looking for a little guidance on type checking with mypy. I'm not sure why but I always get errors when using pystemd.

Tested on:
/etc/os-release

NAME="Linux Mint"
VERSION="21.1 (Vera)"
ID=linuxmint
ID_LIKE="ubuntu debian"
PRETTY_NAME="Linux Mint 21.1"
VERSION_ID="21.1"
HOME_URL="https://www.linuxmint.com/"
SUPPORT_URL="https://forums.linuxmint.com/"
BUG_REPORT_URL="http://linuxmint-troubleshooting-guide.readthedocs.io/en/latest/"
PRIVACY_POLICY_URL="https://www.linuxmint.com/"
VERSION_CODENAME=vera
UBUNTU_CODENAME=jammy

Using:

  • python3.12
  • python3.11

Steps to reproduce:

python3 -m venv venv
venv/bin/pip install mypy pystemd
echo "import pystemd" >> example_pystemd.py
venv/bin/mypy example_pystemd.py

Mypy Output:

example_pystemd.py:1: error: Skipping analyzing "pystemd": module is installed, but missing library stubs or py.typed marker  [import-untyped]
example_pystemd.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)

Am I doing something wrong? Is mypy doing something wrong? or does this package not fully support typehints?

@guywilsonjr
Copy link
Author

FWIW
According to python/typing#1333
we might simply need an empty py.typed file in the pystemd folder. I cloned and tested this locally and it seems to work

@guywilsonjr guywilsonjr closed this as not planned Won't fix, can't repro, duplicate, stale Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant