#3203 closed defect (fixed)
[patch] bdist_wininst does not place package data files correctly
Reported by: | Owned by: | Karen Tracey | |
---|---|---|---|
Component: | Tools | Version: | |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
From changeset [3906], setup.py uses 'data_files' option for setup() to specify package data files (message catalogs, templates, etc).
This breaks bdist_wininst behaviour to place those datafiles onto C:Python2X/django instead of C:/Python2X/Lib/site-packages/django.
The attached patch includes a small hack to fix this.
Attachments (4)
Change History (14)
by , 18 years ago
Attachment: | bdist_wininst_fix.diff added |
---|
comment:1 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 17 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
In the current SVN trunk (retrieved on March 30, 2008), this is happening again: bdist_wininst installers place the data files in C:\Python2X\django, instead of alongside the .py files under C:\Python2X\Lib\site-packages\django. A look at setup.py shows that the patch for this bug was lost at some point.
comment:3 by , 17 years ago
The patch was removed because it was causing active harm. It was also tested quite extensively before removing. See #3536 for details.
Any "solution" here will need to work out why it was causing the problems mentioned in #3536 and how to work around it for both situations. We shouldn't just add this back until that has been resolved (it was marked as "hack" with good reason; let's default to non-hackiness until we truly understand the boundaries of the problem).
comment:4 by , 16 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
by , 16 years ago
Attachment: | bdist_wininst.patch added |
---|
comment:5 by , 16 years ago
Please try my patch, this one for 1.0-alpha_2. The original patch can't work correctly on my environment (python 2.4 and 2.5 on Win32). So I modify '/PURELIB/%s' to '
PURELIB
%s', and it work well for me.
See this thread http://groups.google.com/group/django-developers/browse_thread/thread/1524c615243fa356 for the reason why I need this patch.
PS. my first patch was a wrong file, don't use it.
comment:7 by , 16 years ago
Triage Stage: | Design decision needed → Ready for checkin |
---|
After some testing I do not see how the original patch (with forward slashes) ever worked. Trying it I got the (#3536) ValueError about paths not being allowed to be absolute using 'python setup.py bdist_wininst' on Python 2.3.5, 2.4.4, 2.5.1, and 2.6b2, all on Win2K.
I've also verified that without the (backslash version) of this patch, data files do not get installed in the right place by the .exe produced by bdist_wininst. They are put under the main python install tree rather than under site-packages. Some of them (files used by startapp, which was reported as running properly after removing the patch code in #3536?) may be findable in that configuration, but the admin templates, for one, are not found unless they are really under the same tree as the admin .py files.
Given that the hack is so old I tried to see if there was a better way to accomplish the same thing by now. I think there is: the package_data option to setup(). However, that was added in Python 2.4 so won't work for Python 2.3. Since Django still needs to support Python 2.3 I did not investigate that option any further. (But if/when Django drops support for Python 2.3 it may be possible to remove several of the hacks in setup.py that are there simply to force data files into the code tree.)
Therefore I've tried the revised patch (plus included a check to not try to read args that may not be there) under Python 2.3.5, 2.4.4, 2.5.1, and 2.6b2 on Win2K and in all cases verified that:
1 - 'python setup.py bdist_wininst' runs to completion and produces an .exe, not an error message.
2 - the resutling .exe file copies data files (I checked for the admin templates specifically) into the site-packages\django tree, not the base python install tree.
So, I think this can be checked in. I did not test on WinXP but I could do that if anyone thinks it is necessary. I don't have any Vista to test on, though.
comment:8 by , 16 years ago
milestone: | → 1.0 |
---|
comment:9 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixing bdist_wininst to place package data files correctly