Giter VIP home page Giter VIP logo

poetry-exec-plugin's People

Contributors

keattang avatar mondeja avatar pkulev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

poetry-exec-plugin's Issues

Problem when running poetry exec on Windows.

I can't run any command via poetry exec on Windows, someone could please help me?
Every command that I run returns "The system cannot find the path specified.".

PS C:\...> poetry exec test-command -vvv 
Loading configuration file C:\...\poetry.toml
Adding repository pypi-repo (...)
Using virtualenv: C:\...\.venv
Exec: mkdir testfolder 

The system cannot find the path specified.

✨ Done!

  Stack trace:

  7  ~\AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\application.py:327 in run
      325│ 
      326│             try:
    → 327│                 exit_code = self._run(io)
      328│             except BrokenPipeError:
      329│                 # If we are piped to another process, it may close early and send a

  6  ~\AppData\Local\Programs\Python\Python39\lib\site-packages\poetry\console\application.py:190 in _run
      188│         self._load_plugins(io)
      189│
    → 190│         exit_code: int = super()._run(io)
      191│         return exit_code
      192│

  5  ~\AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\application.py:431 in _run
      429│             io.input.interactive(interactive)
      430│ 
    → 431│         exit_code = self._run_command(command, io)
      432│         self._running_command = None
      433│

  4  ~\AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\application.py:473 in _run_command
      471│ 
      472│         if error is not None:
    → 473│             raise error
      474│
      475│         return terminate_event.exit_code

  3  ~\AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\application.py:457 in _run_command
      455│ 
      456│             if command_event.command_should_run():
    → 457│                 exit_code = command.run(io)
      458│             else:
      459│                 exit_code = ConsoleCommandEvent.RETURN_CODE_DISABLED

  2  ~\AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\commands\base_command.py:119 in run
      117│         io.input.validate()
      118│
    → 119│         status_code = self.execute(io)
      120│
      121│         if status_code is None:

  1  ~\AppData\Local\Programs\Python\Python39\lib\site-packages\cleo\commands\command.py:62 in execute
       60│ 
       61│         try:
    →  62│             return self.handle()
       63│         except KeyboardInterrupt:
       64│             return 1

  AttributeError

  'int' object has no attribute 'returncode'

  at ~\AppData\Local\Programs\Python\Python39\lib\site-packages\poetry_exec_plugin\plugin.py:81 in handle
       77│ 
       78│         self.line("\n✨ Done!")
       79│
       80│         if result:
    →  81│             return result.returncode
       82│
       83│
       84│ def factory() -> ExecCommand:
       85│     return ExecCommand()

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

Feature Request - Completions

One thing that is very nice about npm scripts is how they tie into tab completions very easily, it would be very nice if poetry exec could support tab completions easily. Willing to work on this but not sure what the best way to generate them would be yet.

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!

poetry-exec-plugin isn't compatible with poetry 1.5.0

The newest release of poetry (1.5.0) makes it impossible to execute a command with poetry-exec-plugin:

poetry exec -vvv some-command
(...long stack trace...)
  AttributeError

  'PyProjectTOML' object has no attribute '_file'

  at ~/Library/Application Support/pypoetry/venv/lib/python3.9/site-packages/poetry_exec_plugin/plugin.py:39 in handle
       35│         ),
       36│     ]
       37│ 
       38│     def handle(self) -> Any:
    →  39│         pyproject_folder_path = self.poetry.pyproject._file.path.parent
       40│         pyproject_data = self.poetry.pyproject.data
       41│ 
       42│         cmd_name = self.argument("cmd")
       43│         cmd = (

I tested it out locally, and the fix seems to be very easy: Just change in line 39: self.poetry.pyproject.file.path.parent

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.