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:
- Created 4 years ago
- Reactions:3
- Comments:15 (13 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
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.