-
Notifications
You must be signed in to change notification settings - Fork 231
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
[python] always respect typespec namesapce even if package-name is set #5649
base: main
Are you sure you want to change the base?
Conversation
No changes needing a change description found. |
You can try these changes here
|
de51480
to
82afed4
Compare
{ | ||
"package-name": "headasbooleantrue", | ||
"head-as-boolean": "true", | ||
"enable-typespec-namespace": "false", |
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.
instead of adding in enable-typespec-namespace: false
here, can we instead switch package-name: headasbooleantrue
to namespace: headasbooleantrue
?
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.
I am afraid not. Since for unbranded, we always respect typespec namespace if enable-typespec-namespace is undefined, you can see the namespace of the 3 packages are all type.model.visibility
which will conflict with each other if we don't set enable-typespec-namespace as false.
if ( | ||
self.code_model.namespace.count(".") >= self._namespace_from_package_name.count(".") | ||
or self.code_model.options["enable_typespec_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.
the idea here is to no longer get namespace from package name, the preference should be
namespace
in tspconfig- @clientNamespace in tsp (i know there are issues differentiating this rn from the original namspace in the spec)
namespace
in spec
Now by default, we get package-name
from whatever namespace out of the top 3 wins. Only if you want to override that namesapce, then you would use the package-name
flag. We do have to see how many specs this will influence and add namespace
to tspconfigs
so we don't break
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 is similar with my proposal shared in teams channel. Let us discuss about it in tomorrow's scrum meeting.
We have discussed that we shall always respect typespace namespace even if the package-name is different with it.