Skip to content

Allow inject enviroment variables via .env or other env file #3355

Open
@Zheaoli

Description

@Zheaoli

Feature Description

For now, we may run some code via PDM script like

run_server = { shell = "uvicorn --host 0.0.0.0 --port $SERVER_PORT exporter.app:app --reload"}

Or I may some other environment variables in my program. I may want to write the environment variables to a file like .env when I deploy my program.

Problem and Solution

I propose add new global flag --env-file, the default value is .env. The PDM main process will inject the environment variables into subprocess if the file is exist

Additional Context

No response

Are you willing to contribute to the development of this feature?

  • Yes, I am willing to contribute to the development of this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ⭐ enhancementImprovements for existing features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions