Closed plannigan closed 4 years ago
Thanks a lot @plannigan!
Here is the story:
I maintain/develop quite a number of Python packages. To maintain consistency across all these projects, I use a template (copier-poetry). I update this template quite often, but sometimes I don't re-apply the changes to a particular project immediately (pykdocs
in this case). The most recent versions of the template fixed the issues you raised here:
failprint
v0.6)The template also replaced invoke
by duty
. failprint
and duty
are now tested against Windows, so it should work better. https://github.com/pawamoy/failprint/issues/6 is not fixed yet, but it only impacted the check-dependencies
task because it ran poetry ... | safety ...
or poetry ... | pipx run safety ...
, and while poetry
is automatically resolved to its absolute path by failprint
, safety
and pipx
are not (it would be too wonky to implement as shell commands can be quite complex). Instead, I fixed it in the task itself by which
ing safety
or pipx
, so the command ends up being /abs/path/to/poetry ... | /abs/path/to/safety-or-pipx ...
on Windows.
About your first note: yes, I've recently switched to using flakehell
with the wemake-python-styleguide
plugin, which reports quite a lot of quality violations, so I made the check pass anyway (the -z
option in tasks.py
, for "zero"), until I fix or disable those violations.
About yout second note: could you elaborate on "made a few things harder to debug and see what was happening"? That would be very interesting and useful to improve failprint
and/or duty
!
Finally, thank you very much for taking the time to investigate and send a PR to improve CI! I really appreciate it. Also, I'm sorry you had to do this (unless you enjoyed doing it π ?): my Python template is always evolving, I'm doing my best to reach a stable, and what I deem the best project configuration. During this process, things can (and did) break π
Anyway, I'll merge this right now, and hopefully the upgrade from the template will simplify CI further and keep things working!
Thanks again!
I understand. At my work, I help maintain the project template. Unless the owner of a new project is diligent in updating things, they often become a snapshot of what the template looked like when the project was created.
It was kind of interesting. I depend on CI so heavily in my projects, working on something where CI is failing makes me uncomfortable. Since I was able to get things passing locally, it just took some fiddling to get the workflow into a better state. (It also looks like the Windows hang issue resolved itself.)
I broke CI again :grimacing:
Well it seems Poetry crashes, but I don't know why. The Python setup action is up-to-date... maybe a Poetry 1.1.3 bug?
I spent some time to get the CI pipeline into a better state.
There is one issue that I can't explain. I had gotten everything working. However, after I squashed all the debugging commits into a single clean commit, installing the dependencies on Windows always hangs instead of completing. If this persists, maybe running CI on Windows can be disabled for now.
Changes:
setup.sh
directly instead ofmake
so it will only setup project for the python version of CI step. On Windows, poetry wasn't finding the correct python executable. However,actions/setup-python
ensures thatpython
will point to the correct version.make
would try to use the other versions that weren't available.actions/cache
that could be used.)Other notes:
flakehell
displays multiple errors. Once those are addressed, the task can be changed to not silence errors.failprint
works very well for local development, especially when testing against multiple python versions. However, using as part of the CI pipeline made a few things harder to debug and see what was happening. Maybe this could be removed from CI runs in a future change.