-
Notifications
You must be signed in to change notification settings - Fork 262
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
Can't emit Python into a specific output directory #5605
Comments
Let me make an investigation. |
Update: since user only need function code instead of whole package, python emitter need new feature to support that. |
tldr: add North Starsdk/keyvault/azure-kevault-certificates
package-name: azure-keyvault-certificates tsp-client uses
|
👋 this looks very similar to what @dgetu was working on in the TypeScript emitter (Azure/autorest.typescript#3011) - maybe it makes sense to come up with a language / flag that is consistent across languages? @joheredi FYI My workaround is similar to @mccoyp 's except I created a script to do the shuffling https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/keyvault/generate.js |
thanks for the heads up @maorleger. Let me make a note to talk about this in our group sync |
Context
I'm in the process of migrating a brownfield service (Key Vault) to TypeSpec (Azure/azure-rest-api-specs#28708) and have been struggling to emit Python code that matches our original SDK structure. In
azure-keyvault-certificates
we keep all generated code in a_generated
module; we'd like to emit from TSP into the same directory.I'm able to match our original SDK structure by placing
tsp-location.yaml
in_generated/
, emitting withtsp-client update
, and manually deleting everything that's emitted apart from source code. However, this isn't an ideal solution:azure.keyvault.certificates.models
, when the new location isazure.keyvault.certificates._generated.models
. This would break references, e.g. in docs.setup.py
, isn't automatically updated. We'd like to emit from the root of the package so that packaging information gets correctly updated.Attempted solutions
I've tried a number of configurations in
tspconfig.yaml
to achieve this, which haven't worked:"output-path"
:"./azure/keyvault/certificates/_generated"
"azure-keyvault-certificates/azure/keyvault/certificates/_generated"
"azure.keyvault.certificates._generated"
"emitter-output-dir"
:"./azure/keyvault/certificates/_generated"
"azure-keyvault-certificates/azure/keyvault/certificates/_generated"
"azure.keyvault.certificates._generated"
"namespace"
:"azure.keyvault.certificates._generated"
In all of these attempts, running
tsp-client update
from the root ofazure-keyvault-certificates
emits the code into the package root, instead of into_generated/
. Here are the files that are changed (movingtsp-location.yaml
to the package root was done manually; everything else is emitted):Additional information
In these attempts I've been using the
--local-spec-repo
option, which may or may not be relevant. Thetsp-client
output consistently indicates that the output directory is the package root:The text was updated successfully, but these errors were encountered: