Opened 15 years ago

Closed 14 years ago

Last modified 9 years ago

#13587 closed Cleanup/optimization (fixed)

Set zip_safe = False in setup.py

Reported by: Tim Graham Owned by: nobody
Component: Packaging Version: dev
Severity: Normal Keywords: setup.py
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Django isn't zip_safe:

django.contrib.gis.tests.geogapp.tests: module references __file__
django.contrib.gis.tests.geo3d.tests: module references __file__
django.contrib.gis.tests.layermap.tests: module references __file__
django.contrib.gis.gdal.tests.test_ds: module references __file__
django.contrib.admindocs.views: module references __file__
django.contrib.auth.tests.views: module references __file__
django.utils.autoreload: module references __file__
django.utils.module_loading: module references __path__
django.utils.version: module references __path__
django.utils.translation.trans_real: module references __file__
django.test._doctest: module references __file__
django.test._doctest: module MAY be using inspect.getsourcefile
django.test.simple: module references __file__
django.core.management.sql: module references __file__
django.core.management.base: module references __path__
django.core.management.__init__: module references __file__
django.core.management.__init__: module references __path__
django.core.management.commands.loaddata: module references __file__
django.core.management.commands.loaddata: module references __path__
django.core.management.commands.makemessages: module references __file__
django.core.servers.basehttp: module references __path__
django.views.i18n: module references __file__
django.db.utils: module references __file__
django.db.models.loading: module references __file__
django.conf.__init__: module references __file__
django.conf.project_template.manage: module references __file__
django.template.loaders.app_directories: module references __file__

Any reason not to set the zip_safe flag in setup.py? This was addressed in #538 but the flag was lost at some point when setup.py was refactored.

Attachments (1)

zip_safe.diff (385 bytes ) - added by Tim Graham 15 years ago.

Download all attachments as: .zip

Change History (4)

by Tim Graham, 15 years ago

Attachment: zip_safe.diff added

comment:1 by Russell Keith-Magee, 14 years ago

Resolution: invalid
Status: newclosed

Yes, there is a reason - Django uses distutils, not setuptools. zip_safe is a setuptools option; if you apply the provided patch and run python setup.py install , you get the warning {{{UserWarning: Unknown distribution option: 'zip_safe'
}}}

comment:2 by bhuztez, 13 years ago

Easy pickings: unset
Severity: Normal
Type: Uncategorized
UI/UX: unset

the zip_egg_fixed patch for #14087 can fix this.

comment:3 by Tim Graham, 9 years ago

Component: Core (Other)Packaging
Resolution: invalidfixed
Type: UncategorizedCleanup/optimization

Django has since switched to setuptools in 1.7 and zip_safe=False was added as part of that change: 66f546b90624297858b0f958abbe5c2b3e8bdffb.

Note: See TracTickets for help on using tickets.
Back to Top