-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support running scripts with default arguments #1952
Comments
+1 for the default args. (Although I think |
What do you mean? |
So I believe |
Yarn automatically runs commands when the command is not another builtin ( |
As things stand, this is not something that poetry will support out of the box. If such a feature is required, it might be better suited for a plugin once the plugin system is available. A plugin that allows for alias commands to be specified. That said, once #2310 completes, you should be able to use custom scripts by adding file. We are aware that this is not the same as having aliases defined. This can be re-evaluated later after plugin support is added. Closing for now. |
@domoritz, @thejcannon, why wouldn't a |
It would, but it's more of a convention-thing to have a built-in command that runs the tests. |
well, black:
black src
linting:
poetry run flake8 src
unit:
poetry run pytest src
tests: black linting unit (note,that the |
I do a lot of JavaScript development and like that most of my development scripts are in a the package.json file. Yes, I could use a makefile in python but out of convenience I’d prefer to define shortcuts in poetry directly. |
i think the developer's consensus is that you can put your shortcuts into a |
@funkyfuture I'm not following. How does one define shortcuts in a |
i mean that there can other tools that read their configuration from the
that's what a task runner can facilitate. i checked a few months back, but there were no task runners that make use of |
Thanks for the explanation. |
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. |
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. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature Request
I would like to run a script like
poetry run test
, which should runpytest package
.However, I could not find a way to add an argument to the script.
It would be great if scripts had default arguments.
The text was updated successfully, but these errors were encountered: