Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Nov 19, 2025

Description

Adds a new environment_class_name configuration option to the Python SDK generator, allowing users to customize the name of the generated environment class/enum.

Link to Devin run: https://app.devin.ai/sessions/90c5ae81ff4f4096a1666828e339ac2e
Requested by: [email protected] (@aditya-arolkar-swe)

Changes Made

Python Generator (v4.39.0)

  • Added environment_class_name optional config field to SDKCustomConfig
  • Updated EnvironmentsEnumDeclarationReferencer to accept and use custom environment class name
  • Modified SdkGeneratorContextImpl to compute default as {ClientName}Environment and allow override via config
  • Default behavior preserved: When environment_class_name is not specified, continues to use {ClientName}Environment (e.g., AcmeEnvironment)
  • Added minor version bump entry to generators/python/sdk/versions.yml

Java Generator

  • ⚠️ Note: Java generator changes are also present in this PR (added environment-class-name config option). These may need to be removed based on requirements.

Usage Example

# generators.yml
generators:
  - name: fernapi/fern-python-sdk
    version: 4.39.0
    config:
      environment_class_name: "CustomEnvironment"  # Optional: defaults to {ClientName}Environment

Testing

  • Code compiles successfully
  • Lint checks pass
  • Seed tests run (not executed - may need snapshot updates)
  • Manual testing with actual SDK generation (not performed)

Review Checklist

Critical items to verify:

  1. ⚠️ Java changes: Confirm whether Java generator changes should be included or removed from this PR
  2. Backward compatibility: Verify default behavior ({ClientName}Environment) is preserved when config is not specified
  3. versions.yml: Confirm version bump (4.39.0) and changelog entry are correct
  4. Seed snapshots: Determine if any seed test snapshots need updating (changes should be backward compatible, so likely no updates needed)
  5. Config validation: Verify the new config field is properly validated and documented

Implementation details:

  • The default is computed in SdkGeneratorContextImpl as f"{exported_client_class_name}Environment"
  • Override is applied via custom_config.environment_class_name or default_env_class_name
  • The EnvironmentsEnumDeclarationReferencer now receives the final computed name directly

@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link

🌱 Seed Test Selector

Select languages to run seed tests for:

  • Python
  • TypeScript
  • Java
  • Go
  • Ruby
  • C#
  • PHP
  • Swift
  • Rust
  • OpenAPI
  • Postman

How to use: Click the ⋯ menu above → "Edit" → check the boxes you want → click "Update comment". Tests will run automatically and snapshots will be committed to this PR.

@devin-ai-integration devin-ai-integration bot changed the title feat: add environment_class_name config option to Python and Java generators feat(python): add environment_class_name config option to customize environment class name Nov 19, 2025
@devin-ai-integration devin-ai-integration bot changed the title feat(python): add environment_class_name config option to customize environment class name feat(python): add environment_class_name config option Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant