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
DO NOT MERGE: Experimental rewrite of ops to invoke #228
Conversation
Sorry for the messy "bump version 4.5.x -> 4.5.x+1` commits - testing CI/CD tool might have side effects like this. |
This is AMAZING work @vlcinsky! Wow! 🥇 🥇 🥇 Thank you so much! You did a lot and you wrote a fair & balanced assessment and I think it's super useful for anyone looking to learn more of pypyr, pyinvoke or just general ci/cd of python projects. I've not particularly optimised the pypyr ops pipelines for number of lines. . . and you've probably noticed I'm a bit wordy with my comments/descriptions which also take up more space in the pipelines. But I'm not particularly interested in starting a over-the-top minimisation competition - what's better is what you did here, which is a real-world comparison of code-in-practice, as it exists in the wild for actual useful tasks, without using fancy tricks to get the line-count down. I would be very interested to hear if you have some thoughts on streamlining & possible improvements to pypyr, whether in the core or in pipelines, now that you've been through the process? Feel free on the Discussions board https://github.com/pypyr/pypyr/discussions I don't want your valuable work to be lost in a PR here that'll end up closed & forgotten. . . How about I create a repo for you in the pypyr organisation where you can put this work and all the great documentation/notes you've written? I've made the repo here https://github.com/pypyr/pyinvoke-comparison-example and I made you a maintainer, so you've got the power to do what you want :-) I've left a little toy/hello-world python package in there for the example rather than the full pypyr build, so for the sake of testing/building you don't have to wait for a big project with >1,000 tests to run 1st :-) By the way, I have a very similar test repo here https://github.com/pypyr/python-ci-cd-example that I use to test a bare-bones python project with fully automated ci/cd implemented in pypyr, including GitHub actions. It's very similar to what you see here in the pypyr repo, but it's a sandpit where I can be more free to make experimental messes that I don't want to make in the main production pypyr repo. I am at fault for not advertizing/documenting this experimental repo more widely, though - I didn't write anything up as thoroughly as you have done here! P.S Regarding a note you made:
From the pypyr side, at least, you can do the following to create a virtualenv with all the necessary build/test dependencies in "one step": https://pypyr.io/docs/contributing/developers-guide/#if-tox-takes-too-long Alternatively you can just use tox, but for day-to-day testing that takes more time to run, so while I'm still furiously hacking & slashing I tend to run tests more selectively in the venv just for quicker turnaround :-) |
@yaythomas I put the code into https://github.com/pypyr/pyinvoke-comparison-example repository. |
Much thanks, looks great! 🙌 🙌 🙌 |
new example repo renamed to https://github.com/pypyr/pypyr-to-invoke-comparison-example |
To learn pypyr, I rewrote existing ops/* content to invoke as I am using invoke often and feel quite familiar with it.
This pull requests is not supposed to be accepted, I put it here to notify about possible comparison between pypyr and invoke implementation only.
For quick review, read the
ops/README.rst
file.All stuff from ops/*.yaml is implemented in
tasks.py
andops/*.py
files.GitHub actions are not modified and I am not planning to change that.
Comparing amount of code:
If I would try to have less lines, it seems feasible to get the invoke part down to 300 lines
This makes pypyr 259 lines rewritten to invoke 300 lines what seems a bit more, but still pretty close.
Lessons learned