-
Notifications
You must be signed in to change notification settings - Fork 250
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
Refactor package distribution #445
Comments
Following up from a conversation with @reyang: We have two related problems here: how to split up the existing single distribution package (following the packaging docs, I'll call this a distribution), and how/whether to split the code in this repo into multiple repos. For now I'm assuming that we want to keep the existing package/namespace structure, and it looks like namespace packages let us do exactly that while moving the code between distributions and repos. It's clear that we need a separate distribution for third party trace integrations ( We may also want to move the exporters ( Then there are other components like the google cloud format propagator that are backend-specific, but can't be easily extracted from the library. I don't think we should touch this now, but worth keeping in mind if we want to prioritize having a small core library later. |
FWIW our only current dependency is |
Good point @c24t. I suggest that we do this step by step:
|
You're right, the current explicit dependency (things that will be installed while running pip install opencensus) is https://github.com/census-instrumentation/opencensus-python/blob/master/setup.py#L26. There are other types of dependencies:
@c24t , what is your suggestion? Do we want to converge (e.g. having an explicit dependency from Flask integration distribution package to Flask)?
|
Step 1 sounds exactly right to me.
Do you mean using a namespace package to make the package name consistent with the other integrations in the library? Or moving the code into the repo alongside the other integrations? If the former that sounds great too.
It looks like we can use environment markers to solve the problem of integrations importing different packages at runtime (see this blog for an example), but this may be a headache. In any case I think it's more important that we enforce a minimum version for e.g. flask than that we install the right version of flask on installing the OC integration. |
@reyang do you have an opinion on which integrations should go in the client library repo and which should live in their own repo in https://github.com/opencensus-integrations? |
The former.
Thank you! I'll investigate.
I don't have a very strong opinion. I believe the httplib/request and things that come with the default Python installation should be included into the core opencensus repo. For 3rd party things like MySQL, Flask, Django, I think it is mainly determined by the maintainer's preference. |
Currently OpenCensus Python is released as a monolithic package
pip install opencensus
which has the following disadvantages:The proposal is to refactor the current monolithic package using the namespace packaging approach https://packaging.python.org/guides/packaging-namespace-packages/.
Specifically, https://packaging.python.org/guides/packaging-namespace-packages/#pkgutil-style-namespace-packages will be used given we need to support both Python 2.x and 3.x.
The text was updated successfully, but these errors were encountered: