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

Overview

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

Comments
  • Drop simple-chalk dependency

    Drop simple-chalk dependency

    cleo library has built-in support for terminal colors, and already defines semantic styles, s.a, info, comment, question and error.

    Using self.line and self.line_error style argument we can drop the dependency on simple-chalk library, as it is only being used to display error messages in red, and info messages in dim.

    Tested locally by pulling the plugin with poetry self add https://github.com/ajcerejeira/poetry-exec-plugin.git.

    Here is how an info message is rendered under Gnome terminal:

    image

    And this is how an error message looks like: image

    opened by ajcerejeira 2
  • Fix arguments propagation to commands

    Fix arguments propagation to commands

    Hi, thanks for this utility, looks promising! I've found a bug that stucks me sometimes, so I've decided to submit a patch.

    If you create a command like:

    [tool.poetry-exec-plugin.commands]
    printf = "printf"
    

    You can't pass it strings with spaces because the words after the space are not properly passed to the command:

    $ poetry exec printf -- 'Hello world\n'
    Exec: printf Hello world\n
    
    Hello<my-user>@<myenv>
    

    This turns many commands unusable. For example is not possible to execute a pytest test that have spaces in their id:

    [tool.poetry-exec-plugin.commands]
    test = "pytest"
    
    [tool.poetry-exec-plugin.commands]
    $ poetry exec test -- -svv 'tests/path/to/test.py::test_name[my id]'
    Exec: poetry exec test -- -svv 'tests/path/to/test.py::test_name[my id]'
    ===== test session starts =====
    platform linux -- Python 3.7.13, pytest-7.1.2, pluggy-1.0.0 -- /my/python
    cachedir: .pytest_cache
    rootdir: ..., configfile: pyproject.toml
    plugins: cov-3.0.0
    collected 0 items                                                                                                                          
    
    ===== no tests ran in 0.01s =====
    ERROR: file or directory not found: id]
    

    So this fixes it using shlex.join, with a backport for Python3.7 that should be removed when that version reaches their EOL.

    I've rewritten the test suite to remove mocks and because cleo.testers.command_tester.CommandTester does not allow to pass arguments to commands.

    opened by mondeja 1
  • Bump certifi from 2022.6.15 to 2022.12.7

    Bump certifi from 2022.6.15 to 2022.12.7

    Bumps certifi from 2022.6.15 to 2022.12.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Suggest correct command if other command is very similar

    Suggest correct command if other command is very similar

    For example if I execute poetry exec docs and a doc command exists, instead of showing this error (current):

    $ poetry exec docs
    
    Unable to find the command 'docs'. To configure a command you must add it to your pyproject.toml under the path [tool.poetry-exec-plug
    in.commands]. For example:
    
    [tool.poetry-exec-plugin.commands]
    docs = "echo Hello World"
    

    It would show something like:

    $ poetry exec docs
    
    Unable to find the command 'docs'. Perhaps you wanted to run the 'doc' command?
    
    npm output
    $ npm run docs
    npm ERR! Missing script: "docs"
    npm ERR! 
    npm ERR! Did you mean one of these?
    npm ERR!     npm run doc
    npm ERR!     npm run doc:show
    npm ERR! 
    npm ERR! To see a list of scripts, run:
    npm ERR!   npm run
    
    opened by mondeja 0
  • Question : Specifying the plugin installation from the `pyproject.toml` file

    Question : Specifying the plugin installation from the `pyproject.toml` file

    Really cool and promising plugin!

    Is it possible to specify the plugin installation from the project's pyproject.toml file?

    That way, we wouldn't have to specify the plugin as a requirement in our CI builders and dev-machine setup, and simply be allowed to do (whether or not the plugin is installed) :

    poetry install
    poetry run test
    

    Thanks!

    opened by franknarf8 1
Releases(0.3.5)
  • 0.3.5(Aug 26, 2022)

    What's Changed

    • Small tweaks to prepare for poetry 1.2.0's imminent release by @keattang in https://github.com/keattang/poetry-exec-plugin/pull/10

    Full Changelog: https://github.com/keattang/poetry-exec-plugin/compare/0.3.4...0.3.5

    Source code(tar.gz)
    Source code(zip)
  • 0.3.4(Jul 6, 2022)

    What's Changed

    • Updated dependencies by @keattang in https://github.com/keattang/poetry-exec-plugin/pull/6
    • Drop simple-chalk dependency by @ajcerejeira in https://github.com/keattang/poetry-exec-plugin/pull/5

    New Contributors

    • @keattang made their first contribution in https://github.com/keattang/poetry-exec-plugin/pull/6
    • @ajcerejeira made their first contribution in https://github.com/keattang/poetry-exec-plugin/pull/5

    Full Changelog: https://github.com/keattang/poetry-exec-plugin/compare/0.3.3...0.3.4

    Source code(tar.gz)
    Source code(zip)
  • 0.3.3(Jun 25, 2022)

    What's Changed

    • Fix arguments propagation to commands by @mondeja in https://github.com/keattang/poetry-exec-plugin/pull/4

    New Contributors

    • @mondeja made their first contribution in https://github.com/keattang/poetry-exec-plugin/pull/4

    Full Changelog: https://github.com/keattang/poetry-exec-plugin/compare/0.3.2...0.3.3

    Source code(tar.gz)
    Source code(zip)
  • 0.3.2(Oct 18, 2021)

    What's Changed

    • End description with dot by @pkulev in https://github.com/keattang/poetry-exec-plugin/pull/2
    • Fix typo 'project_foler_path' -> 'project_folder_path' by @pkulev in https://github.com/keattang/poetry-exec-plugin/pull/1

    New Contributors

    • @pkulev made their first contribution in https://github.com/keattang/poetry-exec-plugin/pull/2

    Full Changelog: https://github.com/keattang/poetry-exec-plugin/compare/0.3.1...0.3.2

    Source code(tar.gz)
    Source code(zip)
  • 0.3.0(Sep 12, 2021)

  • 0.2.1(Aug 21, 2021)

  • 0.1.0(Aug 21, 2021)

Trashselected - Plugin for fman.io to move files that has been selected in fman to trash

TrashSelected Plugin for fman.io to move files that has been selected in fman to

1 Feb 04, 2022
A casual IDOR exploiter that provides .csv files of url and status code.

IDOR-for-the-casual Do you like to IDOR? Are you a Windows hax0r? Well have I got a tool for you... A casual IDOR exploiter that provides .csv files o

Ben Wildee 2 Jan 20, 2022
Kellogg bad | Union good | Support strike funds

KelloggBot Credit to SeanDaBlack for the basis of the script. req.py is selenium python bot. sc.js is a the base of the ios shortcut [COMING SOON] Set

407 Nov 17, 2022
Semester long, web application project for CSCI 4370/6370 (Database Management)

Database_Project Prototype ideas for website: Computer Science library (Sells books, products, etc.) Code editor Graph visualizer / creator (can save

Jordan Harman 4 Feb 17, 2022
decorator

Decorators for Humans The goal of the decorator module is to make it easy to define signature-preserving function decorators and decorator factories.

Michele Simionato 734 Dec 30, 2022
Pomodoro timer by the Algodrip team!

PomoDrip 🍅 Pomodoro timer by the Algo Drip team! To-do: Create the script for the pomodoro timer Design the front-end of the program (Flask or Javasc

Algodrip 3 Sep 12, 2021
Your Google Recon is Now Automated

GRecon : GRecon (Greei-Conn) is a simple python tool that automates the process of Google Based Recon AKA Google Dorking The current Version 1.0 Run 7

adnane-tebbaa 189 Dec 21, 2022
A simply program to find active jackbox.tv game codes

PeepingJack A simply program to find active jackbox.tv game codes How does this work? It uses a threadpool to loop through all possible codes in a ran

3 Mar 20, 2022
A synchronous, single-threaded interface for starting processes on Linux

A synchronous, single-threaded interface for starting processes on Linux

Spencer Baugh 27 Jan 28, 2022
Run CodeServer on Google Colab using Inlets in less than 60 secs using your own domain.

Inlets Colab Run CodeServer on Colab using Inlets in less than 60 secs using your own domain. Features Optimized for Inlets/InletsPro Use your own Cus

2 Dec 30, 2021
PORTSCANNING-IN-PYTHON - A python threaded portscanner to scan websites and ipaddresses

PORTSCANNING-IN-PYTHON This is a python threaded portscanner to scan websites an

1 Feb 16, 2022
Hopefully it'll become a very annoying desktop pet

AnnoyingPet Basic Tutorial: https://seebass22.github.io/python-desktop-pet-tutorial/ Handling Mouse Input: https://pythonhosted.org/pynput/mouse.html

1 Jun 08, 2022
Junos PyEZ is a Python library to remotely manage/automate Junos devices.

The repo is under active development. If you take a clone, you are getting the latest, and perhaps not entirely stable code. DOCUMENTATION Official Do

Juniper Networks 623 Dec 10, 2022
This is a multi-app executor that it used when we have some different task in a our applications and want to run them at the same time

This is a multi-app executor that it used when we have some different task in a our applications and want to run them at the same time. It uses SQLAlchemy for ORM and Alembic for database migrations.

Majid Iranpour 5 Apr 16, 2022
python's memory-saving dictionary data structure

ConstDict python代替的Dict数据结构 若字典不会增加字段,只读/原字段修改 使用ConstDict可节省内存 Dict()内存主要消耗的地方: 1、Dict扩容机制,预留内存空间 2、Dict也是一个对象,内部会动态维护__dict__,增加slot类属性可以节省内容 节省内存大小

Grenter 1 Nov 03, 2021
Ant Colony Optimization for Traveling Salesman Problem

tsp-aco Ant Colony Optimization for Traveling Salesman Problem Dependencies Python 3.8 tqdm numpy matplotlib To run the solver run main.py from the p

Baha Eren YALDIZ 4 Feb 03, 2022
Created a Python Keylogger script.

Python Script Simple Keylogger Script WHAT IS IT? Created a Python Keylogger script. HOW IT WORKS Once the script has been executed, it will automatic

AC 0 Dec 12, 2021
A numbers check python package

A numbers check python package

Fayas Noushad 3 Nov 28, 2021
Frappe app for authentication, can be used with FrappeVue-AdminLTE

Frappeauth App Frappe app for authentication, can be used with FrappeVue-AdminLTE

Anthony C. Emmanuel 9 Apr 13, 2022
Pokemon catch events project to demonstrate data pipeline on AWS

Pokemon Catches Data Pipeline This is a sample project to practice end-to-end data project; Terraform is used to deploy infrastructure; Kafka is the t

Vitor Carra 4 Sep 03, 2021