Giter VIP home page Giter VIP logo

poetry-exec-plugin's Introduction

poetry-exec-plugin

A plugin for poetry that allows you to execute scripts defined in your pyproject.toml, just like you can in npm or pipenv

Installation

Installation requires poetry 1.2.0+. To install this plugin run:

pip install poetry-exec-plugin

For other methods of installing plugins see the poetry documentation.

Usage

To use this plugin, first define the scripts that you wish to be able to execute in your pyproject.toml file under a section called tool.poetry-exec-plugin.commands. For example:

[tool.poetry-exec-plugin.commands]
hello-world = "TEXT=hello-world; echo $TEXT"
lint = "flake8"

This will define a script that you can then execute with the poetry exec <script> command. This will execute your script inside of the environment that poetry creates for you, allowing you to access the dependencies installed for your project. For example:

$ poetry exec hello-world
hello-world

$ poetry exec lint
./my_file.py:29:25: E222 multiple spaces after operator

Anything that you append to your exec command will be appended to the script. You can use this to pass extra flags and arguments to the commands in your scripts. For example:

$ poetry exec hello-world one two three
hello-world one two three

$ poetry exec lint --version
3.9.2 (mccabe: 0.6.1, pycodestyle: 2.7.0, pyflakes: 2.3.1) CPython 3.9.0 on Darwin

poetry-exec-plugin's People

Contributors

keattang avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.