Skip to content
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

[Bug]: Python emitter overrides my changes to setup.py #5528

Closed
4 tasks done
dargilco opened this issue Jan 8, 2025 · 3 comments · Fixed by #5559
Closed
4 tasks done

[Bug]: Python emitter overrides my changes to setup.py #5528

dargilco opened this issue Jan 8, 2025 · 3 comments · Fixed by #5559
Assignees
Labels
bug Something isn't working emitter:client:python Issue for the Python client emitter: @typespec/http-client-python

Comments

@dargilco
Copy link
Member

dargilco commented Jan 8, 2025

Describe the bug

The emitter overrides my changes to setup.py, and I was wondering if this can be addressed so I don't have to always git restore this file after re-emit. I'm attaching screen shots of the difftool (2 screen shots, but it's one file... I could not get it to fix in one capture):
Image
Image

The issues are:

  • I would like the emitter to NOT modify the PACKAGE_PPRINT_NAME, if the only change is the casing of the string. In this example, I want "AI" to be capital (not "Ai" per emitter).
  • I updated the "url" to deep link to the SDK folder, instead of to the root of the repo. But the emitter keeps reverting this change.
  • The emitter keeps deleting the extras_require that we added at the end of the file.

This a minor issue, as I know simply "git restore setup.py" after each re-emit. But wanted to call this out anyway.

Another way to "fix" this is to have an emitter flag that says "don't update setup.py". I'll be happy with that.

Reproduction

See above

Checklist

@dargilco dargilco added the bug Something isn't working label Jan 8, 2025
@dargilco
Copy link
Member Author

dargilco commented Jan 8, 2025

Tagging @iscai-msft for triage. Thanks!

@markcowl markcowl added the emitter:client:python Issue for the Python client emitter: @typespec/http-client-python label Jan 8, 2025
@iscai-msft iscai-msft self-assigned this Jan 8, 2025
@iscai-msft
Copy link
Member

@dargilco can you send over your tspconfig.yaml?

@dargilco
Copy link
Member Author

dargilco commented Jan 8, 2025

This is what I have in my tspconfig.yaml:

parameters:
  "service-dir":
    default: "sdk/ai"
  "dependencies":
    "additionalDirectories": []
    default: ""
emit:
  - "@azure-tools/typespec-autorest"
linter:
  extends:
    - "@azure-tools/typespec-azure-rulesets/data-plane"
  disable:
    "@azure-tools/typespec-azure-core/casing-style": "Disabled since JSON payload in REST API does not conform to Azure guidelines with regards to casing"
    "@azure-tools/typespec-azure-core/no-string-discriminator": "Use an extensible union instead of a plain string"
    "@azure-tools/typespec-azure-core/bad-record-type": "We do want to use Record<unknown>, and not Record<string>. But this needs further investigation"
options:
  "@azure-tools/typespec-autorest":
    azure-resource-provider-folder: "data-plane"
    emitter-output-dir: "{project-root}/.."
    output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json"
  "@azure-tools/typespec-python":
    package-mode: dataplane
    package-dir: "azure-ai-inference"
    package-name: "{package-dir}"
    flavor: azure
  "@azure-tools/typespec-csharp":
    package-dir: "Azure.AI.Inference"
    namespace: "Azure.AI.Inference"
    clear-output-folder: true
    model-namespace: false
    flavor: azure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working emitter:client:python Issue for the Python client emitter: @typespec/http-client-python
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants