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

patch 2 #3

Merged
merged 4 commits into from
Feb 12, 2022
Merged

patch 2 #3

merged 4 commits into from
Feb 12, 2022

Conversation

CSchulzeTLK
Copy link
Contributor

This patch enables handling of additional handling of .pyc, .pyw, and .{platform_suffix}.pyd.

importlib.machinery.all_suffixes() (introduced in 3.3) provides a list of extensions:

>>> importlib.machinery.all_suffixes()  
['.py', '.pyw', '.pyc', '.cp38-win_amd64.pyd', '.pyd']

I manually tested the handling of ".pyw", ".pyc" (moved and renamed from __pycache__ folder), and ".cp38-win_amd64.pyd".

After cythonizing a module filename would be something like "mypackage\mymodule.cp38-win_amd64.pyd".
mypy stubgen can usually handle module names and filenames. But for .pyd files with platform suffix only module names are accepted:
stubgen --module mypackage.mymodule -o .
So corresponding stubdoc call would be;
stubdoc --module mypackage\\mymodule.cp38-win_amd64.pyd -s mypackage\\mymodule.pyi

@simon-ritchie simon-ritchie merged commit 588919d into simon-ritchie:main Feb 12, 2022
@simon-ritchie
Copy link
Owner

Hi, @CSchulzeTLK

Thx for sending and testing this pull request also!

I've merged and released v0.1.8!

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

Successfully merging this pull request may close these issues.

2 participants