-
Notifications
You must be signed in to change notification settings - Fork 6
Fix todos #8
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
Fix todos #8
Conversation
Marenz
commented
Feb 22, 2024
- Update versions
- Fix cookiecutter TODOS
.github/labeler.yml
Outdated
"part:actor": | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- "src/frequenz/actor/dispatch/**" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this repo scheme, I would put the actor in frequenz/dispatch/actor
instead, as the python package is using the frequenz.dispatch
namespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe not? :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second glance, this involved WAY more files than I anticipated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm but the client has the structure/namespace frequenz.client.dispatch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second glance, this involved WAY more files than I anticipated.
Why?
Hmm but the client has the structure/namespace
frequenz.client.dispatch
Yes, and it is in a repo called frequenz-client-dispatch
. I mean, we can just name this repo frequenz-actor-dispatch
and have only the actor as we planned originally, I just thought it might have been a good opportunity to try this other scheme, by mixing the actor and high-level interface in one repo, and keeping the actor as an implementation detail, as we do in the SDK, where users never need to deal with the actual actors used behind the scenes, and just use higher-level functions and objects that interact with the actors for them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see the diff now, so you actually used the actor
template to create this repo, not the lib
template, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I used actor
On second glance, this involved WAY more files than I anticipated.
Why?
Because the name/path frequenz-actor-dispatch
was all over the code, dependencies, tests, etc
I just thought it might have been a good opportunity to try this other scheme
Ah, alright. Sure, we can try.
@@ -116,12 +112,12 @@ plugins: | |||
show_source: true | |||
signature_crossrefs: true | |||
import: | |||
# TODO(cookiecutter): You might want to add other external references here | |||
# See https://mkdocstrings.github.io/python/usage/#import for details | |||
- https://docs.python.org/3/objects.inv | |||
- https://frequenz-floss.github.io/frequenz-channels-python/v0.16/objects.inv | |||
- https://frequenz-floss.github.io/frequenz-sdk-python/v0.25/objects.inv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note: Oh, dammit, we need to depend on the SDK for the actor, but the SDK will depend on the actor too eventually, we need to address frequenz-floss/frequenz-sdk-python#851 sooner than I expected.
a5e578d
to
7efa083
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, it seems there has been quite some confusion about the repo/python package name and general structure. The idea of calling this repo frequenz-dispatch-python
instead of frequenz-actor-dispatch-python
was to provide both the high-level interface and the actor in one repo (and use the normal lib
repo config template).
Sorry about the confusion and extra work, we can of course talk about it if you don't agree and go with a different approach, it's that because you specifically pointed out that having so many repos was confusing I saw this as one place where we might reduce the number of repos, and thought it could help make things more clear instead of more confusion :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/frequenz/dispatch/__init__.py
should also exist, the end user should probably do something like:
from frequenz.dispatch import Dispatcher
async def run():
dispatcher = Dispatcher(API_CONNECTION_INFO)
dispatcher.start() # this will fire the actor
dispatch_arrived = dispatcher.new_dispatches().new_receiver()
dispatch_ready = dispatcher.ready_dispatches().new_receiver()
# ...
I mean, in this case maybe the actor could be the same as the Dispatcher
object, but so far we never put any methods in actors to make it clear the communication to actors should be done via channels instead. Maybe we should think about this possibility instead of having this in 2 layers, but this is a broader question, affecting other APIs too I guess.
Then the SDK will take care of create a global Dispatcher
, so users using the SDK should do something more along the lines:
from frequenz import sdk
sdk.initialize(CONFIG)
async def run():
dispatch_arrived = sdk.dispatcher.new_dispatches().new_receiver()
dispatch_ready = sdk.dispatcher.ready_dispatches().new_receiver()
# ...
3dcf686
to
09f57f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to fix at leas the version bump in the wrong commit, but even that is not that important, so I'll approve anyway.
.github/workflows/ci.yaml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes to this file are in the wrong commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed. No re-approve required.
@@ -5,12 +5,12 @@ | |||
requires = [ | |||
"setuptools == 68.1.0", | |||
"setuptools_scm[toml] == 7.1.0", | |||
"frequenz-repo-config[actor] == 0.8.0", | |||
"frequenz-repo-config[lib] == 0.9.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could bump directly to v0.9.1 here, but dependabot will take care of it if you don't.
Signed-off-by: Mathias L. Baumann <[email protected]>
Signed-off-by: Mathias L. Baumann <[email protected]>