Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split out APIs into separately-installable distributions? #1159

Closed
tseaver opened this issue Sep 30, 2015 · 9 comments
Closed

Split out APIs into separately-installable distributions? #1159

tseaver opened this issue Sep 30, 2015 · 9 comments
Assignees
Labels
packaging type: question Request for information or clarification. Not an issue.

Comments

@tseaver
Copy link
Contributor

tseaver commented Sep 30, 2015

  • gcloud on PyPI would include "core" modules.
  • gcloud would (maybe) become a namespace package
  • Each API would have a separate PyPI "project"/releases

Cons (mostly for maintainers):

  • separate release cycles
  • More complicated CI
  • Might need to split repos?

Pros (mostly for users):

  • "Hard" dependencies for each API (gRPC, I'm looking at you)
  • Separately updateable distributions
  • "Pay only for what you eat"
@tseaver tseaver added type: question Request for information or clarification. Not an issue. packaging labels Sep 30, 2015
@dhermes
Copy link
Contributor

dhermes commented Sep 30, 2015

Comments on cons:

  • separate release cycles: I think this is a good thing, but a tiny bit problematic if updates to core break the service-specific packages
  • More complicated CI: Yup, we'd need to kick off a run of Travis every time a downstream dependency is updated
  • Might need to split repos?: I see this is a positive (outside of the CI stuff)

Another potential con:

  • Building unified docs becomes harder

@jgeewax
Copy link
Contributor

jgeewax commented Oct 4, 2015

The one I'm concerned about is unified docs -- that's something that could actually be a show-stopper we'd have to sort out first...

@dhermes
Copy link
Contributor

dhermes commented Oct 4, 2015

Yeah this could be a lot of work. The flipside though is that the library is becoming too big and its a dis-service to developers to make them buy the whole house when they only want the kitchen (or a single lightswitch).

@jgeewax
Copy link
Contributor

jgeewax commented Oct 4, 2015

its a dis-service to developers to make them buy the whole house when they only want the kitchen

This is actually tricky. The majority of people in UX studies want the whole house. The more advanced users eventually run into a problem and decide they only want the kitchen -- but only after trying out lots of things and using gcloud for a while...

So, we have a bit of an issue: do we optimize for the advanced folks? If we do, we might alienate and frustrate users, effectively reducing the number of people entering the funnel who could eventually become those advanced folks...

My thought here is still that we need to make both possible, but make the common case the simplest: pip install gcloud gives me the house. If I want just the kitchen, or just the light switch, this should be possible but not necessarily something we optimize for. Does that make sense?

@dhermes
Copy link
Contributor

dhermes commented Oct 5, 2015

Yeah that'd have to be supported by also having a gcloud-core PyPI package and then using each of the gcloud-SERVICENAME packages.

@dhermes
Copy link
Contributor

dhermes commented Oct 15, 2015

@jgeewax
Copy link
Contributor

jgeewax commented Nov 3, 2015

I have no objection to this layout. Sounds to me like...

  • gcloud depends on gcloud-* ("The whole house")
  • gcloud-* (except gcloud-core) all depend on gcloud-core ("The kitchen and the foundation")

This means that if I install any of the individual services, I get the service I want, and the core library. If I install gcloud I just get everything.

The trouble (just a wild guess here) will be in the namespace issues... That is...

$ pip install gcloud-pubsub
$ python
>>> from gcloud import pubsub  # Can we make this work?
$ pip install gcloud
$ python
>>> from gcloud import pubsub  # This should (still) work.

@tseaver
Copy link
Contributor Author

tseaver commented Nov 4, 2015

Yes, that pattern will work. We will need to:

  • Move the code which is now directly in gcloud/*.py down into a gcloud/core/*.py, updating all the affected imports.
  • Declare gcloud as a namespace package in all the distributions (in their calls to setup() in setup.py),
  • Make gcloud/__init__.py contain only the following::
__import__('pkg_resources').declare_namespace(__name__)
  • If we don't split the repository, then we will need to update setup.py to call setup() once for gcloud-core, once for each API, and once for the omnibus metapackage.

@tbetbetbe
Copy link

👍 modularization

FYI googleapis folks: @Anthm, @vsubramani, @rok987

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packaging type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

4 participants