Skip to content

Commit

Permalink
Use Python namespace packages
Browse files Browse the repository at this point in the history
Before, namespace packages would break in auditwheel due to a
superfluous check (fixed in the commit referenced in the Dockerfiles).
Now, the auditwheel used in the manylinux1-support Docker images can
handle namespace packages, and we may thus use them. This should
alleviate future user pain w.r.t. installation of grpcio-tools causing
loss of grpcio files and vice versa (e.g. requiring a reinstall of
grpcio following installation of grpcio-tools).
  • Loading branch information
soltanmm-google committed Jun 7, 2016
1 parent e5d37dd commit d4b4009
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,7 @@ def cython_extensions(module_names, extra_sources, include_dirs,
ext_modules=CYTHON_EXTENSION_MODULES,
packages=list(PACKAGES),
package_dir=PACKAGE_DIRECTORIES,
# TODO(atash): Figure out why auditwheel doesn't like namespace packages.
#namespace_packages=['grpc'],
namespace_packages=['grpc'],
package_data=PACKAGE_DATA,
install_requires=INSTALL_REQUIRES,
setup_requires=SETUP_REQUIRES,
Expand Down
3 changes: 1 addition & 2 deletions tools/distrib/python/grpcio_tools/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ def maybe_cythonize(exts):
protoc_ext_module(),
]),
packages=setuptools.find_packages('.'),
# TODO(atash): Figure out why auditwheel doesn't like namespace packages.
#namespace_packages=['grpc'],
namespace_packages=['grpc'],
install_requires=[
'protobuf>=3.0.0a3',
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,10 @@ RUN /opt/python/cp27-cp27mu/bin/pip install cython
RUN /opt/python/cp34-cp34m/bin/pip install cython
RUN /opt/python/cp35-cp35m/bin/pip install cython

####################################################
# Install auditwheel with fix for namespace packages
RUN git clone https://github.com/pypa/auditwheel /usr/local/src/auditwheel
RUN cd /usr/local/src/auditwheel && git checkout bf071b38c9fe78b025ea05c78b1cb61d7cb09939
RUN /opt/python/cp35-cp35m/bin/pip install /usr/local/src/auditwheel
RUN rm /usr/local/bin/auditwheel
RUN cd /usr/local/bin && ln -s /opt/python/cp35-cp35m/bin/auditwheel
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,10 @@ RUN /opt/python/cp27-cp27mu/bin/pip install cython
RUN /opt/python/cp34-cp34m/bin/pip install cython
RUN /opt/python/cp35-cp35m/bin/pip install cython

####################################################
# Install auditwheel with fix for namespace packages
RUN git clone https://github.com/pypa/auditwheel /usr/local/src/auditwheel
RUN cd /usr/local/src/auditwheel && git checkout bf071b38c9fe78b025ea05c78b1cb61d7cb09939
RUN /opt/python/cp35-cp35m/bin/pip install /usr/local/src/auditwheel
RUN rm /usr/local/bin/auditwheel
RUN cd /usr/local/bin && ln -s /opt/python/cp35-cp35m/bin/auditwheel

0 comments on commit d4b4009

Please sign in to comment.