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

Add Support for Script Execution via Configuration File #6499

Closed
CucumberKing opened this issue Aug 23, 2024 · 2 comments
Closed

Add Support for Script Execution via Configuration File #6499

CucumberKing opened this issue Aug 23, 2024 · 2 comments

Comments

@CucumberKing
Copy link

Could you introduce an option in uv to allow running scripts defined in a configuration file, similar to the functionality provided by PDM and Rye.

Background

Both PDM and Rye offer functionality to define and run custom scripts directly from their configuration files. This feature simplifies the development process by enabling the execution of common tasks (e.g., testing, building, deploying) through a unified command interface.

For example:

  • PDM uses the [tool.pdm.scripts] section in the pyproject.toml file to define scripts.
  • Rye allows script definitions under [tool.rye.scripts] in the pyproject.toml.

Proposal

Add similar functionality to uv that allows users to define scripts in a configuration file (e.g., pyproject.toml) and execute them via a simple uv command.

Benefits

  • Consistency: Users familiar with tools like PDM and Rye will have a consistent experience.
  • Convenience: Simplifies the process of running repetitive tasks, improving developer productivity.
  • Automation: Encourages the automation of common project tasks, reducing manual overhead.

Suggested Implementation

  1. Configuration: Introduce a section in the pyproject.toml (or equivalent config file) under [tool.uv.scripts] where users can define scripts.

    Example:

    [tool.uv.scripts]
    test = "pytest tests/"
    build = "python setup.py sdist bdist_wheel"
  2. Command Execution: Add a command to uv that can execute these scripts. For example:

    uv run test
    uv run build
    
@my1e5
Copy link
Contributor

my1e5 commented Aug 23, 2024

Duplicate of #5903

@CucumberKing
Copy link
Author

did not see the duplicate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants