Issue 3902: Packages containing only extension modules have to contain init.py (original) (raw)

Issue3902

Created on 2008-09-18 18:11 by Peaker, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
distutils-init.py-apiref-setup.diff mikehoy,2011-10-07 21:23 review
apiref-setupscript-v2.diff mikehoy,2011-10-09 16:15 Version 2 review
apiref-setupscript-v3.diff mikehoy,2011-10-10 18:47 v3 with line wrapping at 80th char and response to question in apiref review review
apiref-setupscript-v4.diff mikehoy,2011-10-12 01:18 review
Messages (13)
msg73393 - (view) Author: Eyal Lotem (Peaker) Date: 2008-09-18 18:11
When using either the ext_package keyword argument to setup, or when using the "pkg.name" module name notation to Extension instances, distutils installs the compiled extensions into the appropriate package directory. However, distutils does not create an __init__.py file in that directory, so it is not actually a package and is not importable.
msg119366 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-10-22 08:35
Thanks for the report. To the best of my knowledge, distutils never generates Python files, and the docs for ext_modules or ext_package don’t imply __init__.py will be generated. IOW, for “pkg.foo”, you’re supposed to have pkg/__init__.py and pkg/foo.c. I think this bug is invalid, or is a request for a small doc improvement. Do you agree?
msg120586 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-11-06 06:26
Reclassifying as request for doc enhancement. I’ll check the distutils2 doc and add a line about this problem if I find the text is not clear enough. Someone finding this report thanks to the “easy” keyword can feel free to propose a patch.
msg144773 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-10-02 14:14
We’re working on a patch on the core-mentorship list.
msg145146 - (view) Author: Mike Hoy (mikehoy) * Date: 2011-10-07 21:23
> We’re working on a patch on the core-mentorship list. Éric, I emailed the diff to the Core-Mentorship list, but since there was no reply I will just attach it here. Please review patch and let me know if you want any changes.
msg145209 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-10-09 03:44
>> We’re working on a patch on the core-mentorship list. > I emailed the diff to the Core-Mentorship list, but since there > was no reply I will just attach it here. I added that message here to avoid someone else working on the same bug. I did not reply to the mailing list because it’s not easy to review emailed patches and I don’t have Internet access each day. > Please review patch and let me know if you want any changes. Done. You should have received an email; if not, follow the link titled “review” on the right of your patch.
msg145272 - (view) Author: Mike Hoy (mikehoy) * Date: 2011-10-09 16:15
Submitted v2 of my patch after reading Éric's review of my first.
msg145303 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-10-10 15:35
You did not reply to my first question on apiref.rst, and you did not rewrap your lines to 80 chars :)
msg145311 - (view) Author: Mike Hoy (mikehoy) * Date: 2011-10-10 18:47
Responded to first question in apiref and uploaded a new patch that wraps lines at 80 characters.
msg145382 - (view) Author: Mike Hoy (mikehoy) * Date: 2011-10-12 01:18
setupscript did not have the changes that were made in apiref. v4 is now consistent and line wrapping at 80 chars.
msg145416 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-10-12 16:56
Looks good, will commit.
msg146082 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-10-21 13:52
New changeset f84040b11211 by Éric Araujo in branch 'default': Document that packaging doesn’t create __init__.py files (#3902). http://hg.python.org/cpython/rev/f84040b11211
msg146088 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-10-21 14:02
I thought about the wording again and committed a different version. I also decided not to backport to distutils; see the commit message for a rationale. Thanks for the help!
History
Date User Action Args
2022-04-11 14:56:39 admin set github: 48152
2011-10-21 14:02:51 eric.araujo set status: open -> closedversions: - 3rd party, Python 2.7, Python 3.2messages: + components: - Distutils, Distutils2resolution: fixedstage: patch review -> resolved
2011-10-21 13:52:28 python-dev set nosy: + python-devmessages: +
2011-10-12 16:56:48 eric.araujo set messages: +
2011-10-12 01🔞13 mikehoy set files: + apiref-setupscript-v4.diffmessages: +
2011-10-10 18:47:39 mikehoy set files: + apiref-setupscript-v3.diffmessages: +
2011-10-10 15:35:19 eric.araujo set messages: +
2011-10-09 16:15:53 mikehoy set files: + apiref-setupscript-v2.diffmessages: +
2011-10-09 03:44:22 eric.araujo set messages: +
2011-10-07 21:23:27 mikehoy set files: + distutils-init.py-apiref-setup.diffnosy: + mikehoymessages: + keywords: + patch
2011-10-02 14:14:31 eric.araujo set versions: + Python 2.7, Python 3.2, Python 3.3nosy: + alexismessages: + components: + Distutilsstage: needs patch -> patch review
2010-11-06 06:26:33 eric.araujo set components: + Documentation, Distutils2, - Distutilsversions: + 3rd party, - Python 3.1, Python 2.7, Python 3.2keywords: + easynosy:tarek, eric.araujo, Peakertitle: distutils does not create __init__.py for packages containing extension modules -> Packages containing only extension modules have to contain __init__.pymessages: + stage: needs patch
2010-10-22 08:35:33 eric.araujo set messages: -
2010-10-22 08:35:27 eric.araujo set assignee: tarek -> eric.araujomessages: + nosy: + eric.araujo, - terry.reedytitle: distutils does not correctly create packages for compiled extensions -> distutils does not create __init__.py for packages containing extension modules
2010-08-05 20:44:44 terry.reedy set nosy: + terry.reedymessages: +
2010-07-11 11:07:05 BreamoreBoy set versions: + Python 3.2, - Python 2.6, Python 3.0
2009-02-06 09:17:05 tarek set assignee: tareknosy: + tarekversions: + Python 2.6, Python 3.0, Python 3.1, Python 2.7, - Python 2.5
2008-09-18 18:11:45 Peaker create