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

Mark Django REST Framework as incompatible with eggs #2386

Merged
merged 1 commit into from Jan 7, 2015

Conversation

xordoquy
Copy link
Collaborator

@xordoquy xordoquy commented Jan 7, 2015

I just found that sometime Django REST Framework HTML renderer may not work depending on how you install it. In my case, this was listed within a setup.py's install_require which lead Django REST Framework to be installed as an egg.
Django doesn't load templates from eggs by default and has no way to gather the static files from an egg at all.
jezdez & dstuff confirm the way to fix that is to mark the packages as zip_safe = False.

@xordoquy xordoquy changed the title Make Django REST Framework as incompatible with eggs Mark Django REST Framework as incompatible with eggs Jan 7, 2015
@tomchristie
Copy link
Member

tomchristie commented Jan 7, 2015

Okay, sure thing. If there's anything online we can link to from this PR with context that'd be helpful.

@tomchristie tomchristie added this to the 3.0.3 Release milestone Jan 7, 2015
@tomchristie
Copy link
Member

tomchristie commented Jan 7, 2015

Also if noted in the release notes, then include it with a more user-facing message (eg. "Ensure templates load correctly when pacakge is installed with easy_install in windows")

Link to relevant docs...

https://pythonhosted.org/setuptools/setuptools.html#setting-the-zip-safe-flag

Not all packages, however, are capable of running in compressed form, because they may expect to be able to access either source code or data files as normal operating system files.

Also http://flask.pocoo.org/docs/0.10/patterns/distribute/#basic-setup-script

In general you probably don’t want your packages to be installed as zip files because some tools do not support them and they make debugging a lot harder.

tomchristie added a commit that referenced this issue Jan 7, 2015
Mark Django REST Framework as incompatible with eggs
@tomchristie tomchristie merged commit c381412 into encode:master Jan 7, 2015
1 check passed
@xordoquy
Copy link
Collaborator Author

xordoquy commented Jan 8, 2015

Also related:
https://code.djangoproject.com/ticket/22774

@tomchristie
Copy link
Member

tomchristie commented Jan 8, 2015

Including your IRC convo for future reference.

screen shot 2015-01-08 at 10 45 00

Assume we've never had it raised before because it only manifests on easy_install + windows.

@xordoquy
Copy link
Collaborator Author

xordoquy commented Jan 8, 2015

Actually, I had it while pip installing my project which has DRF in the setup's install_requires.

@tomchristie
Copy link
Member

tomchristie commented Jan 8, 2015

In which case utterly mystifying that it's not been reported previously.

Be interesting to know if there's any design convo around changing the default of this - as a developer I shouldn't have to know about magically keys that I have to set in the config - it really oughta just not be broken in the first place.

@xordoquy xordoquy mentioned this pull request Jan 8, 2015
10 tasks
@xordoquy xordoquy deleted the bugfix/drop_egg_support branch Jan 12, 2015
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.

None yet

2 participants