[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#758402: ITP: python-xstatic-jquery.quicksearch -- jQuery.quicksearch XStatic support

On 08/18/2014 11:00 PM, Justin B Rye wrote:
> Yes, this explains why my imaginary developer on BeOS would want it -
> or even developers on Debian who want to work entirely in Python eggs
> and bypass APT.  But it doesn't quite explain why there's a Debian
> package.

Well, because that's one of the dependency of a Python app I am packaging.

> Yes, so developers using pip get to pull in Python xstatic-foo modules
> as dependencies.  I see that.  But requiring xstatic-foo can't pull in
> a Debian package; and if on the other hand I'm using Debian package
> dependencies, what's the benefit of depending on python-xstatic-foo
> instead of libjs-foo direct?

The package python-xstatic-foo contains the necessary logic to tell your
application where foo is in your Debian system. That way, your Python
application will work in both environment in the same way. In both cases
(eg: "pip install / virtual env", or using Debian package), it will use
the XStatic system to search for a particular static file. In the
virtual env, it will use the file embedded in the XStatic package (as
downloaded from PyPi), but in Debian, it will use what
python-xstatic-foo configures, which is access to the files of libjs-foo.

> Does python-xstatic-foo maybe set up the libjs-foo libraries so that
> they're pulled into a virtualenv (for some reason) instead of being
> used directly out of the system libraries?

No. But it provides the path to /usr/share/javascript/foo to the Python
application who will load/use/serve it.

> Oh, no, I see: even if pip can't *pull in* a .deb, a previously
> installed .deb might still contain the module in an appropriate way to
> satisfy the dependency.  Perhaps even for people running pip within a
> virtualenv?

For people using pip & virtualenv, then it will use the embedded static
file contained in the package served by pypi.python.org.

> If I can work out the final wrinkle ("why would you Debianise it?")
> then I might add a couple of words, but that would be more or less it.

# cat debian/patches/debianize.patch
Description: Debianize the package
 Using files from libjs-jquery.quicksearch instead of embedded files.
Author: Thomas Goirand <zigo@debian.org>
Forwarded: not-needed
Last-Update: 2014-08-17

@@ -11,7 +11,7 @@ NAME = __name__.split('.')[-1] # package
                                # please use a all-lowercase valid python
                                # package name

-VERSION = '2.0.3' # version of the packaged files, please use the upstream
+VERSION = '2.0.4' # version of the packaged files, please use the upstream
                   # version number
 BUILD = '1' # our package build number, so we can release new builds
              # with fixes for xstatic stuff.
@@ -34,9 +34,9 @@ HOMEPAGE = 'http://plugins.jquery.com/jq
 LICENSE = '(same as %s)' % DISPLAY_NAME

 from os.path import join, dirname
-BASE_DIR = join(dirname(__file__), 'data')
+#BASE_DIR = join(dirname(__file__), 'data')
 # linux package maintainers just can point to their file locations like
-#BASE_DIR = '/usr/share/javascript/jquery_quicksearch'
+BASE_DIR = '/usr/share/javascript/jquery.quicksearch'

     # CDN locations (if no public CDN exists, use an empty dict)

Do you get it now? :)

>> I hope now that everything make sense, and that you can write back a
>> single new reply so that we can close this case! :)
> Let's see: the Debian package can't be pulled in by pip, but it can
> satisfy pip dependencies, which improves portability in aspects of the
> workflow I probably don't need to know about.


> If it also provides
> hooks to make virtualenv setups work more smoothly

Not correct. Debian packages are orthogonal to virtualenv, there's no
hook, even though a Debian package will satisfy the pip dependency. In a
virtualenv, typically, you'd use the packages from PyPi, not from
Debian, and this could work on all systems (including BeOS ?). In such
case, you'd use the static files from the PyPi package, not the system one.

So, a developer may use PyPi and "pip install", in which case we don't
care (he does what he wants in his virtualenv in MacOS or whatever). But
in Debian, we care not to use embedded files, so we have
python-xstatic-foo which depends: libjs-foo, and points to the files in
/usr/share/javscript/foo so that the application of that same developer
will use the system version of foo, rather than the embedded static
files of xstatic-foo, as served by PyPi.

Let me know if things still need to be clarified.

Thomas Goirand (zigo)

Reply to: