Missing __init__.py

Bug #583426 reported by Adi Roiban
36
This bug affects 5 people
Affects Status Importance Assigned to Milestone
lazr.restfulclient (Ubuntu)
Fix Released
Undecided
Unassigned
lazr.uri (Ubuntu)
Fix Released
Undecided
Unassigned
protobuf (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When I'm running pylint I get the following warning:

warning: Not importing directory '/usr/share/pyshared/google': missing __init__.py
warning: Not importing directory '/usr/share/pyshared/lazr': missing __init__.py

All other folders from /usr/share/pyshared have an __init__.py file, so I guess that adding that file could solve this problem.

This is a possible fix:
sudo touch /usr/share/pyshared/google/__init__.py
sudo touch /usr/share/pyshared/lazr/__init__.py

ProblemType: Bug
Architecture: i386
Date: Thu May 20 19:46:16 2010
DistroRelease: Ubuntu 9.10
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
Package: python-protobuf 2.0.3-2.2ubuntu2
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-19.56-generic
SourcePackage: protobuf
Uname: Linux 2.6.31-19-generic i686

Revision history for this message
Adi Roiban (adiroiban) wrote :
description: updated
description: updated
Revision history for this message
Colin Watson (cjwatson) wrote :

The question is, which package should that file go in? There's no "lowest-level" lazr package - neither python-lazr.restfulclient nor python-lazr.uri depends on the other, and either one ought to arrange for the top-level __init__.py to exist. Do we need a python-lazr.common or something?

Changed in lazr.restfulclient (Ubuntu):
status: New → Confirmed
Changed in lazr.uri (Ubuntu):
status: New → Confirmed
Revision history for this message
Martin Pool (mbp) wrote :

Is this connected to bug 796992? Perhaps that one is caused by an attempt to work around this?

I think a tiny top level python-lazr would be a reasonable answer.

Revision history for this message
Robert Collins (lifeless) wrote :

+1 on a package containing the top level lazr namespace. The python packaging guide/policy stuff has other options too, but I like the clarity of a top level package.

Revision history for this message
Stefano Rivera (stefanor) wrote :

lazr.restfulclient *should* depend on lazr.uri (LP: #876445). But there are other lazr packages in Ubuntu (only).

Piotr thinks that dh_python2's namespace feature will be sufficient for this. That way we avoid a top level empty package (there's no obvious binary package to build it from). the lazr stack may be unimportable during upgrades, would that be an issue?

Revision history for this message
Gediminas Paulauskas (menesis) wrote :

In other packages that have namespaces but not an obvious main package, I have added a separate binary package. Example is z3c.form that also builds a python-z3c package that only contains the __init__.py. This tiny package has a version that does not mean anything, but that's hardly a problem.

menesis@ore:~/src/ubuntu/precise/z3c.form
$ cat debian/python-z3c.form.install
debian/tmp/*
menesis@ore:~/src/ubuntu/precise/z3c.form
$ cat debian/python-z3c.pyinstall
src/z3c/__init__.py z3c

$ tail -n 5 debian/control
Package: python-z3c
Architecture: all
Depends: ${python:Depends}, python-pkg-resources, ${misc:Depends}
Description: z3c namespace package
 Namespace package for all z3c.* packages to depend on.

This was done before dh_python2, and I tried to remove it and rely on dh_python2 creating empty __init__.py files, but it is bad for upgrades, because that file may not be available. I've seen python break after removing a package from that namespace (cannot import site.py)

Also this was needed because van-pydeb helper adds namespace packages like python-z3c to Depends. python-lazr would have to be added to Depends of all lazr.* packages manually...

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in protobuf (Ubuntu):
status: New → Confirmed
Revision history for this message
Anders Kaseorg (andersk) wrote :

I think this is supposed to be solved by

$ cat /usr/share/python/ns/python-protobuf
google

Somehow I managed to get to a state where this didn’t work (bug 1017339), but reinstalling python-protobuf caused /usr/lib/python2.7/dist-packages/google/__init__.py to come back.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lazr.restfulclient - 0.13.1-1

---------------
lazr.restfulclient (0.13.1-1) experimental; urgency=low

  * New upstream release.
     - Now cache-safe for concurrent clients.
  * Upload to experimental, as we are in freeze.
  * Get rid of .pth files, dh_python2's namespace support is sufficient.
    (LP: #796992, #583426)
  * Depend on python-lazr.uri. (LP: #876445)
  * Update watch file to work with secure LP urls for the tarballs.
  * Bump Standards-Version to 3.9.4, no changes needed.
  * Bump machine readable copyright format to 1.0, no changes needed.
  * Updated copyright years.

 -- Stefano Rivera <email address hidden> Tue, 06 Nov 2012 11:53:59 +0200

Changed in lazr.restfulclient (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lazr.uri - 1.0.3-2

---------------
lazr.uri (1.0.3-2) unstable; urgency=low

  [ Stefano Rivera ]
  * Get rid of .pth files, dh_python2's namespace support is sufficient
    (LP: #583426)
  * Include configure.zcml (LP: #822469)
  * Update watch file.
  * Bump machine readable debian/copyright's format to 1.0.
  * Bump Standards-Version to 3.9.5.
    * Bump debhelper Build-Dep to 8.1 for build-{arch,indep}.
  * Bump Copyright years.
  * Port to pybuild.
  * Verify upstream PGP signatures with uscan.
  * Add DEP-12 upstream metadata.

  [ Jakub Wilk ]
  * Use canonical URIs for Vcs-* fields.

 -- Stefano Rivera <email address hidden> Thu, 05 Jun 2014 00:46:06 +0200

Changed in lazr.uri (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.