-
Notifications
You must be signed in to change notification settings - Fork 69
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
Init file in stubs-only package #108
Comments
(I was corrected later, but to clarify this is wrong, it is intentionally unimportable at runtime) |
|
@abravalheri might know :) |
Hi @gleb-chipiga, I confirm that I see the warning, but everything builds fine (so hopefully you can carry on your work without much trouble). These are the commands I used to replicate: % cd /tmp
% mkdir -p test_aiojobs_stubs
% cd test_aiojobs_stubs
% mkdir aiojobs-stubs aiojobs_protocols
% touch aiojobs-stubs/__init__.pyi aiojobs_protocols/{__init__.py,py.typed} LICENSE
% echo 'include LICENSE' > MANIFEST.in
% echo "from setuptools import setup
setup(
name='aiojobs-stubs',
package_data={'aiojobs-stubs': ['__init__.pyi'],
'aiojobs_protocols': ['py.typed']},
packages=['aiojobs-stubs', 'aiojobs_protocols'],
python_requires='>=3.8'
)" > setup.py
% virtualenv .venv -p py38
% .venv/bin/python -m pip install -U pip build
% .venv/bin/python -m build
% unzip -l dist/aiojobs_stubs-0.0.0-py3-none-any.whl
Archive: dist/aiojobs_stubs-0.0.0-py3-none-any.whl
Length Date Time Name
--------- ---------- ----- ----
0 2022-01-12 18:19 aiojobs-stubs/__init__.pyi
0 2022-01-12 18:19 aiojobs_protocols/__init__.py
0 2022-01-12 18:19 aiojobs_protocols/py.typed
0 2022-01-12 18:28 aiojobs_stubs-0.0.0.dist-info/LICENSE
183 2022-01-12 18:28 aiojobs_stubs-0.0.0.dist-info/METADATA
92 2022-01-12 18:28 aiojobs_stubs-0.0.0.dist-info/WHEEL
32 2022-01-12 18:28 aiojobs_stubs-0.0.0.dist-info/top_level.txt
655 2022-01-12 18:28 aiojobs_stubs-0.0.0.dist-info/RECORD
--------- -------
962 8 files This is caused by the implementation of pypa/distutils that predates PEP 561. This issue could be reported both in pypa/setuptools (FR for automatically adding |
Ahh, I hadn't thought about that before, but it makes sense. Shouldn't pypa/distutils or pypa/setuptools also check for Edit: Actually, that's what you suggest at the end, yes. |
Should this issue be moved? I can move it to packaging-problems, where it might get more views, or someone else could move it to distutils or setuptools. |
I think GitHub only allow maintainers of both the "origin" and the "destination" repository to move the issue 😅. If you think |
Yes, that's why I'm limited to moving it to |
This comment has been minimized.
This comment has been minimized.
from setuptools import setup Run command: setup.py sdist bdist_wheel |
I don't think the setup.py behavior is very important, though it is interesting to note: https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html |
The |
I can reproduce it with |
|
Python 3.9.9 build==0.7.0 |
(venv) ~/D/t/aiojobs-stubs (main|…) $ python -V
Python 3.9.9
(venv) ~/D/t/aiojobs-stubs (main|…) $ python -m pip list
Package Version
---------- -------
pip 21.3.1
setuptools 60.5.0
wheel 0.37.1
(venv) ~/D/t/aiojobs-stubs (main|…) $ python setup.py sdist bdist_wheel | grep package
package init file 'aiojobs-stubs/__init__.py' not found (or not a regular file) |
There is indeed a warning. I didn't notice it. Sorry. |
I only skimmed the issue, so did not see this. But distutils in ths stdlib should not receive any updates, the development has been moved to this repo, which is periodically synced with the local setuptools copy, and will eventually be merged there. |
@henryiii I wanted to clarify that this is incorrect, one of the goals of the (I mention this since someone came across your comment and was confused, so you may want to edit it and either clarify or point to this comment) |
OK, I fixed it, though you only have to scroll down a couple of comments to see that it was an incorrect statement. |
Project structure:
setup.py
MANIFEST.in
Run command:
Receive message:
According to PEP 561, the
__init__.py
file is not needed in such a package.The text was updated successfully, but these errors were encountered: