nikolai72 / google-api-python-client

Automatically exported from code.google.com/p/google-api-python-client
Other
0 stars 0 forks source link

exposing uritemplate clashes with 2 other previously existing uritemplates #315

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
[Use this form for both apiclient and oauth2client issues]

What steps will reproduce the problem?
1. Using https://pypi.python.org/pypi/uritemplate or 
https://pypi.python.org/pypi/uritemplate.py
2. Then install oauth2client with an installer that will not overwrite existing 
files.

What is the expected output? What do you see instead?

oauth2client should not expose a uritemplate to get some functionality in 
gce.py. 

/sw/bin/dpkg-lockwait -i 
/sw/fink/dists/stable/main/binary-darwin-x86_64/web/oauth2client-py27_1.2-1_darw
in-x86_64.deb
(Reading database ... 206172 files and directories currently installed.)
Preparing to replace oauth2client-py27 1.1-2 (using 
.../oauth2client-py27_1.2-1_darwin-x86_64.deb) ...
Unpacking replacement oauth2client-py27 ...
/sw/bin/dpkg: error processing 
/sw/fink/dists/stable/main/binary-darwin-x86_64/web/oauth2client-py27_1.2-1_darw
in-x86_64.deb (--install):
 trying to overwrite `/sw/lib/python2.7/site-packages/uritemplate/__init__.py', which is also in package uritemplate-py27
Errors were encountered while processing:
 /sw/fink/dists/stable/main/binary-darwin-x86_64/web/oauth2client-py27_1.2-1_darwin-x86_64.deb
### execution of /sw/bin/dpkg-lockwait failed, exit code 1

What version of the product are you using? On what operating system?

- 1.2 tar ball: 
https://code.google.com/p/google-api-python-client/downloads/detail?name=oauth2c
lient-1.2.tar.gz
 - fink on mac osx 10.9

Please provide any additional information below.

There are already 2 other uritemplate modules.  Exposing a 3rd is yet more 
trouble.  Please move uritemplate under the oauth2client namespace.

Original issue reported on code.google.com by schw...@gmail.com on 24 Nov 2013 at 6:29

GoogleCodeExporter commented 9 years ago
This is a packager problem and not a problem with the library itself.

Original comment by jcgregorio@google.com on 24 Nov 2013 at 6:35

GoogleCodeExporter commented 9 years ago
Trying to use Conflicts to make it more obvious shows the extent of the 
interdependence.  I'm trying to support bigquery in fink but oauth2client 
needed, so I have to write a patch the tar to move uritemplate/__init__.py.

fink remove --recursive uritemplate-py27

The following packages will be REMOVED:
  bigquery-py27 google-api-python-client-py27 gsutil-py27 oauth2client-py27 uritemplate-py27 
0 packages upgraded, 0 newly installed, 5 to remove and 0  not upgraded.

Original comment by schw...@gmail.com on 24 Nov 2013 at 6:56

GoogleCodeExporter commented 9 years ago
The oauth2client library merely has uritemplate as a dependent package:

  http://code.google.com/p/google-api-python-client/source/browse/setup_oauth2client.py#24

Are you suggesting libraries should have *no* dependent packages?

Original comment by jcgregorio@google.com on 24 Nov 2013 at 7:17

GoogleCodeExporter commented 9 years ago
I think we have some miss-communication.  It's perfectly find to have dependent 
packages.  I'm suggesting that using top level package names that already exist 
in pypi and that related Google tools use is risky.   
(https://pypi.python.org/pypi/uritemplate and 
https://pypi.python.org/pypi/uritemplate.py/)

But here we've got uritemplate being used by other Google packages as an 
external dependency and this package is exporting a different uritemplate.  And 
only gce needs it. 

Here is how to see the issues that I'm running into:

wget --no-check-certificate 
https://google-api-python-client.googlecode.com/files/oauth2client-1.2.tar.gz

tar tfvv oauth2client-1.2.tar.gz | grep uritemplate
drwxr-x--- jcgregorio/eng     0 2013-08-07 09:18 oauth2client-1.2/uritemplate/
-rw-r----- jcgregorio/eng  4780 2013-07-23 12:53 
oauth2client-1.2/uritemplate/__init__.py

tar xf oauth2client-1.2.tar.gz 

find oauth2client-1.2 -type f | xargs grep uritemplate
oauth2client-1.2/oauth2client/gce.py:import uritemplate
oauth2client-1.2/oauth2client/gce.py:    uri = uritemplate.expand(META, 
{'scope': self.scope})
oauth2client-1.2/oauth2client.egg-info/SOURCES.txt:uritemplate/__init__.py
oauth2client-1.2/oauth2client.egg-info/top_level.txt:uritemplate
oauth2client-1.2/setup.py:  'uritemplate',

The fix for fink turned out to be not too complicated.  But I am likely to run 
into trouble on gce with uritemplate clashes when I use virtualenv to setup my 
app.

PatchScript: <<
  rm oauth2client/gce.py
  rm -rf uritemplate
  perl -pi -e "s/'uritemplate',//" setup.py
  perl -ni -e "print unless /gce/" oauth2client.egg-info/SOURCES.txt
  perl -ni -e "print unless /uritemplate/" oauth2client.egg-info/SOURCES.txt
<<

# Then proceed with the normal install process...

Original comment by schw...@gmail.com on 24 Nov 2013 at 7:40

GoogleCodeExporter commented 9 years ago
OK, the oauth2client tar.gz shouldn't have uritemplate included, it should just 
have that listed as an external dependency, which is a legitimate bug that 
appears to happen when the .tar.gz is built. I'll look into that, and thanks 
for taking the time to explain the issue.

Original comment by jcgregorio@google.com on 24 Nov 2013 at 7:52

GoogleCodeExporter commented 9 years ago
Thanks!  -kurt

Original comment by schw...@gmail.com on 25 Nov 2013 at 3:38