Skip to content

extend pdm run to pass env, env_file, working_dir, site_packages #3829

Description

@ZeeD

Feature Description

One of the distinctive features of pdm is it's powerful script support.
When you add a custom script pdm allow you to set various options.

It would be useful extend pdm run to set / override dynamically these values.

Problem and Solution

Apart from the "general usefulness", I have two different use cases in my mind:

  1. I have multiple .env files and this would allow me to setup a start script running my command, and run pdm run start for the "normal" behavior and pdm run start --env-file .env.staging if I want to run my project aganinst another environment without the need to create a "clone" start-staging script
  2. I have some composite scripts that relies on a .env file. While normally pdm run my-composite works, sometimes I need to run the single commands, and this would allow me to do it quickly without the need to comment out the rest of the script

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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