Opened 2 years ago

Closed 2 years ago

Last modified 13 months ago

#19252 closed Bug (fixed)

Install from wheel package

Reported by: Alex Morega <alex@…> Owned by: nobody
Component: Packaging Version: master
Severity: Release blocker Keywords:
Cc: apollo13 Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

On Mac OS, pip wheel builds a Django wheel which installs cleanly. On Linux, it builds a wheel which (correctly) marks data files as such, and they get installed outside the django package. This doesn't happen on Mac OS since setup.py tricks distutils into handling data files as purelib files.

This little patch extends the setup.py hack to kick in when building wheels regardless of platform: https://gist.github.com/4018017. The osx_install_data should probably be renamed though.

Change History (15)

comment:1 Changed 2 years ago by jacob

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Severity changed from Normal to Release blocker

comment:2 Changed 2 years ago by anonymous

Perhaps those files should always be purelib files?

comment:3 Changed 2 years ago by claudep

  • Triage Stage changed from Unreviewed to Accepted
  • Version changed from 1.4 to master

comment:4 Changed 2 years ago by jezdez

  • Resolution set to invalid
  • Status changed from new to closed

The wheel format isn't accepted yet (http://www.python.org/dev/peps/pep-0427/) and there is currently no such feature in pip. Closing as invalid as it's basically not a problem we should try to fix.

comment:5 Changed 2 years ago by anonymous

This bug is exactly the same thing that happens, and is currently compensated for, when building bdist_wininst installers. This should be a hint that data files are a problem.

Why not fix it for everyone by disusing the data files feature of distutils, regardless of sys.argv?

comment:6 Changed 2 years ago by carljm

  • Resolution invalid deleted
  • Severity changed from Release blocker to Normal
  • Status changed from closed to new

The wheel PEP is now accepted, and pip will soon have support AFAIK.

Regardless, comment 5 is correct that we jump through way too many hoops in our setup.py in order to try to trick distutils into handling data_files as if they were package_data, and that is the root cause of this bug. Instead we should just use package_data and solve the problem properly.

I don't believe this is a 1.5 release blocker, though, so re-setting the severity to Normal.

comment:7 Changed 2 years ago by jacob

  • Severity changed from Normal to Release blocker

I'd like to start distributing Django as a wheel for 1.6, so I'm re-marking this as a release blocker. As we get closer to 1.6 we can revisit whether the ecosystem is "ready" and perhaps punt, but making this a blocker now means we won't just forget.

comment:8 Changed 2 years ago by aaugustin

  • Component changed from Core (Other) to Packaging

comment:9 Changed 2 years ago by apollo13

FWIW our resolution of data-files is borked currently: https://github.com/django/django/blob/master/setup.py#L72

This results in: django/conf/project_template beeing data and django/conf/project_template/project_name beeing a package. As such a wheel install currently puts manage.py somehwere else and startproject doesn't collect all files…

So the whole setup.py needs a bit more rework.

comment:10 Changed 2 years ago by apollo13

  • Cc apollo13 added

comment:11 Changed 2 years ago by apollo13

Last edited 2 years ago by apollo13 (previous) (diff)

comment:12 Changed 2 years ago by apollo13

Building wheels is possible via:

pip wheel .

(Assuming pip 1.4). python setup.py bdist_wheel doesn't work since we don't use setuptools in setup.py, but that's fine.

Version 0, edited 2 years ago by apollo13 (next)

comment:13 Changed 2 years ago by Jannis Leidel <jannis@…>

  • Resolution set to fixed
  • Status changed from new to closed

In a5becad9094e5c5403b692b9a7b3a6ffaabf64a3:

Fixed #19252 -- Added support for wheel packages.

Signed-off-by: Jannis Leidel <jannis@…>

comment:14 Changed 2 years ago by Jannis Leidel <jannis@…>

In 4391718f26466f82f943e37368181d5c0520fa35:

[1.5.x] Fixed #19252 -- Added support for wheel packages.

Backport from master (a5becad9094e5c5403b692b9a7b3a6ffaabf64a3).

Signed-off-by: Jannis Leidel <jannis@…>

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