[tahoe-lafs-trac-stream] [Tahoe-LAFS] #2209: Missing `allmydata/web/static/img` subdirectory when installed from `pip`.

Tahoe-LAFS trac at tahoe-lafs.org
Sat Mar 29 01:01:46 UTC 2014


#2209: Missing `allmydata/web/static/img` subdirectory when installed from `pip`.
---------------------------+---------------------------------------------
     Reporter:  nejucomo   |      Owner:  nejucomo
         Type:  defect     |     Status:  new
     Priority:  normal     |  Milestone:  1.11.0
    Component:  packaging  |    Version:  1.10.0
   Resolution:             |   Keywords:  packaging pip web review-needed
Launchpad Bug:             |
---------------------------+---------------------------------------------

Comment (by daira):

 {{{
 (2014-03-29 00:14:03) daira1: dstufft: the only difference between the
 sdist that is installed correctly by pip (including the
 src/allmydata/web/static/img directory) and the sdist that is not
 installed correctly
 (2014-03-29 00:15:07) daira1: is that the former has
 'allmydata.web.static.img', in the 'packages=' argument to
 setuptools.setup(...)
 (2014-03-29 00:15:52) daira1: however the 'package_data=' argument
 contains "allmydata.web.static.img": ["*.png"] in both cases
 (2014-03-29 00:16:01) daira1: is this a bug in pip and/or setuptools?
 (2014-03-29 00:16:30) dstufft: can you link me to the setup.py?
 (2014-03-29 00:16:39) dstufft: or the two setup.py's
 (2014-03-29 00:16:40) daira1: yes, just a sec
 (2014-03-29 00:19:50) daira1: with 'allmydata.web.static.img':
 https://github.com/tahoe-lafs/tahoe-
 lafs/blob/1931505518726256ff2e8becb5634910afbcf766/setup.py
 (2014-03-29 00:20:09) daira1: without: https://github.com/tahoe-lafs
 /tahoe-lafs/blob/master/setup.py
 (2014-03-29 00:20:47) daira1: diff: https://github.com/tahoe-lafs/tahoe-
 lafs/commit/1931505518726256ff2e8becb5634910afbcf766
 (2014-03-29 00:21:56) daira1: and here's the ticket: https://tahoe-
 lafs.org/trac/tahoe-lafs/ticket/2209
 (2014-03-29 00:22:45) daira1: I was under the impression that packages=
 was only supposed to contain source packages? I could be wrong about that
 (2014-03-29 00:25:33) dstufft: daira1: allmydata.web.static.img is a
 package, it has a __init__.py
 (2014-03-29 00:26:15) daira1: it has an __init__.py only to work around a
 setuptools bug
 (2014-03-29 00:26:38) dstufft: in order for that to work without
 allmydata.web.static.img in packages=[...] you'd need to set
 package_data={"allmydaa.web.static": ["img/*.png"]}
 (2014-03-29 00:26:59) daira1: https://tahoe-lafs.org/trac/tahoe-
 lafs/ticket/1960
 (2014-03-29 00:27:02) dstufft: in other words, the keys for package_data
 has to be installed packages
 (2014-03-29 00:27:19) daira1: ah, I see
 (2014-03-29 00:28:06) daira1: currently we have:
 (2014-03-29 00:28:06) daira1:       package_data={"allmydata.web":
 ["*.xhtml"],
 (2014-03-29 00:28:06) daira1:                     "allmydata.web.static":
 ["*.js", "*.png", "*.css"],
 (2014-03-29 00:28:06) daira1:
 "allmydata.web.static.css": ["*.css"],
 (2014-03-29 00:28:06) daira1:
 "allmydata.web.static.img": ["*.png"],
 (2014-03-29 00:28:06) daira1:                     },
 (2014-03-29 00:28:17) daira1: so that should be:
 (2014-03-29 00:28:40) daira1:       package_data={"allmydata.web":
 ["*.xhtml"],
 (2014-03-29 00:28:40) daira1:                     "allmydata.web.static":
 ["*.js", "*.png", "*.css", "img/*.png", "css/*.css"],
 (2014-03-29 00:28:40) daira1:                     },
 (2014-03-29 00:28:41) daira1: ?
 (2014-03-29 00:28:47) dstufft: Yea I think so
 (2014-03-29 00:29:02) dstufft: I'm not 100% sure on that, but I think so
 (2014-03-29 00:29:08) daira1: I'll try it
 (2014-03-29 00:29:10) daira1: thanks
 (2014-03-29 00:29:13) dstufft: np
 (2014-03-29 00:29:16) dstufft: let me know!
 (2014-03-29 00:29:22) ***daira1 nods
 (2014-03-29 00:30:57) daira1: hmm, or maybe:
 (2014-03-29 00:30:57) daira1:       package_data={"allmydata.web":
 ["*.xhtml", "static/*.js", "static/*.png",
 (2014-03-29 00:30:57) daira1:
 "static/*.css", "static/img/*.png", "static/css/*.css"],
 (2014-03-29 00:30:57) daira1:                     },
 }}}

 The pull request uses the latter. I smoke-tested it with `pip` and also
 using:
 {{{
 make clean
 python setup.py build
 sudo python setup.py install
 }}}

--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2209#comment:6>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage


More information about the tahoe-lafs-trac-stream mailing list