question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support running scripts with default arguments

See original GitHub issue
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

I would like to run a script like poetry run test, which should run pytest package.

However, I could not find a way to add an argument to the script.

[tool.poetry.scripts]
test = "pytest:main"

It would be great if scripts had default arguments.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:15 (13 by maintainers)

github_iconTop GitHub Comments

7reactions
castarcocommented, Aug 9, 2021

Disclaimer: this is a short rant (skip it if you’re looking for a useful comment), about Python, not Poetry. Sorry, but I had to say it.

@ypicard you’re right. Python is overcomplicated when it comes to packaging and configuration, with few benefits in exchange for that extra complexity. It has been like that for around 20 years, and the solutions that are usually proposed don’t improve much over the previous state of things.

The biggest problem is that most prolific Python developers already have a ton of hacks in place, and they don’t feel the pain because of those hacks and memorized tricks (it reminds me to the Assembler programmers that refused using C, because they already learnt a lot of smart tricks to overcome the major pain points); then a lot of newbies arrive to the community, without prior experience on other development environments… and they end up believing that this state of things is normal, or “okish”. And it’s not, it’s a total clusterfuck.

Poetry makes it a bit nicer, but not much; as it’s not its responsibility, to be honest.

Every time I’ve said that in public I received a shower of negative comments, and probably other people had the same experience. So I lost any faith on the project, since criticism is not well taken. I abandoned Python years ago because of that, and I only use it when I’m forced to.

7reactions
ypicardcommented, Jun 17, 2021

Coming from the Javascript ecosystem, I find it hard to believe a discussion is even needed for this kind of topic. How can native arguments not be natively supported, and what are the arguments against implementing it? There are so many forum threads trying to figure out how to enable this, I think this just shows the community would like to see this supported by default.

Adding other scripts using other tools just feels like a hack.

I would really like to understand the difference in philosophy between the 2 communities here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Default parameters - JavaScript - MDN Web Docs
Default function parameters allow named parameters to be initialized with default values if no value or undefined is passed.
Read more >
How to write a bash script that takes optional input arguments?
I want to say that the this subject is not about the optional argument but a positional argument with default value. This terminology...
Read more >
Create and Use Default Values in PowerShell Scripts
Summary: Microsoft Scripting Guy Ed Wilson teaches you how to create and to use intelligent defaults for your Windows PowerShell scripts or ...
Read more >
Adding arguments and options to your Bash scripts - Red Hat
In this article, you've used positional parameters to enter data into the Bash program during invocation from the command line and used options ......
Read more >
How To Handle Command-line Arguments in Node.js Scripts
Node.js supports a list of passed arguments, known as an argument vector. The argument vector is an array available from process.argv in your ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found