Replies: 5 comments 4 replies
-
thanks for the feedback @rr-! Could you please help me understand better, because I'm not entirely clear on what you're suggesting? Do you mean that you would not like to have yaml pipeline files and you instead want to define your step sequences in |
Beta Was this translation helpful? Give feedback.
-
Thanks for explaining some more, @rr-, that really helps! 🙌 There are a few things that make putting the entire pipeline into
Now, having said some of the reasons not to do it. . . Your idea and the example you give looks sensible and I like your suggestion very much! IF what we're talking about is very static, unlikely to change, simple one-liner commands that you pretty much just set at the beginning of the project and then never touch again. In there words, like you show in your example. So if you had pyproject.toml like this: [tool.pypyr]
[tool.pypyr.commands]
test = "pytest --cov=dict --cov-report term-missing"
lint = "pre-commit run -a"
clean = """
rm .coverage
rm -rf .mypy_cache
rm -rf .pytest_cach
"""
# use list to run multiple commands
all= ["test", "lint", "clean"] And then you'd run like: $ pypyr test
$ pypyr lint
# as per make style, run 2 targets from the cli
$ pypyr lint clean
$ pypyr all I'll have to think a bit more about how or if arguments + variables can be made to work, so that: [tool.pypyr.commands]
test = "pytest --cov=dict --cov-report term-missing ${f}" You can run: $ pypyr test f=./myfile.py
# or maybe even, but this might not be possible to do cleanly. . .
$ pypyr test ./myfile.py So this would basically be a simplified "command only" or "array of command" syntax that you can set in your What do you think, @rr-? Would something like this help you, or do you have suggestions for doing it differently, or does it sound like a can of worms you don't even want to open 😆 ? |
Beta Was this translation helpful? Give feedback.
-
Oh also, something extra I think would be useful is to create a pypyr built-in step to load configuration values from So you would have your yaml pipeline to encode your business logic flow. And then the variable configuration values you can store in So these config values can then load into the pipeline at runtime with a ready-made step. |
Beta Was this translation helpful? Give feedback.
-
Yes, what you're describing with transparent args sounds very useful and I'd find it handy myself! I'll have to think a bit about how best to go implementing some more. Re what you're saying whether pypyr is necessarily the best tool for this. . . You make a good point! The simple In the case of It so happens TOML parsing in general is definitely coming to pypyr (#134) - and I am planning to add a convenience step to read pipeline config from This is not quite what you're describing, however, because you'd still need a pipeline - although I have half a mind to create a built-in pipeline to do just this - loop over a In this case you have $ pypyr do-pyproject-toml-scripts -- test -v3 -s myproject/tests/test_views.py --pdb (I'd have to think of a better pipeline name than Since the prospective Some suggestions: I'm sure you know about these already, but just for the sake of completeness, I'd feel remiss not to point out some other excellent open-source projects in this arena. . . You might want to check out tox - this is an amazing tool that not only manages your virtual environments for you, but allows you to specify commands with a "passthrough" argument style like you want! However, Since You might want to check out https://github.com/nat-n/poethepoet - I've not used this myself (yet), but it looks like a great project! It does most (or maybe some) of what you're after, especially if you're in the |
Beta Was this translation helpful? Give feedback.
-
Yep, so not having the "command" (aka a pipeline name) so you can just go But if we're going to stick to the easier way of doing this (for now), If we take {
"scripts": {
"start": "node index.js",
"dothing": "mycommand --blah",
}
} You can then execute: $ npm start
$ npm run dothing So So similarly I guess, instead of "do-pyproject-toml-scripts", maybe $ pypyr run dothing where |
Beta Was this translation helpful? Give feedback.
-
pypyr seems nice but polluting the filesystem with a few small files is the opposite of what I want from this tool, which is to replace makefiles such as this one:
and on top of it, allow me to pass extra arguments to it so I can
make test my/test.py
, and use the now-standard pyproject.toml for it (just like setuptools has setup.py and npm has package.json).Beta Was this translation helpful? Give feedback.
All reactions