This repository has been archived by the owner on Sep 14, 2020. It is now read-only.
Move the modules around to cleanup the code #124
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Kopf has grown since the last time the package/module structure was defined. As such, some things do not keep to each other, some upcoming things form different topics.
This PR restructures the layout of internal modules. All public interfaces are kept intact.
Specifically:
kopf.reactor
is cleaned up, only the reacting things are left there.kopf.utilities
is created for different runtime-environment-related stuff (e.g. module importing).kopf.engines
is created for all reactor-supporting but not reactor-required activities. Now, it is peering. Soon, it will be k8s-event posting in background & logging to k8s-event (PRs #??? -- add later).kopf.k8s
is renamed tokopf.clients
, as (1) the whole framework is anyway about k8s, (2) that package contain the client wrappers/adapters, (3) it can also contain other client adapters, not only k8s.kopf.config
tokopf.clients.auth
, where it belongs (it is an adapter/wrapper for the k8s client library).Unless users import the internal objects (on their own risk), this should work fine. There are no changes in the logic or behaviour itself, only the structure.
Except for this one:
create_tasks()
internal routine) now requires the loop. Usage ofasyncio.Task
is officially "discouraged" in the Python docs, so the tasks should be created in the specific loop.The upcoming changes (few PRs that follow) are built on top of this new structure: e.g. background k8s-event poster is the new "engine", new logging with transparent k8s-event posting is also one of them.
This PR also extracts the complexity from them to make the review easier — as all package moves and cleanups are here.
Types of Changes