aiidalab / aiidalab-launch

Tool to launch AiiDAlab on a local workstation.
MIT License
5 stars 3 forks source link

Use ruff instead of flake8, isort, black and pyupgrade #202

Closed danielhollas closed 9 months ago

danielhollas commented 9 months ago

aiida-core recently switched to ruff, and I've been using it for my app for some time. IMO we should consider slowly switching AiiDAlab repos as well. @unkcpz @yakutovicha LMK what you think.

I've enabled a couple more rules than there were before, based on my judgment and previous experience. More might be useful, but this is a reasonable start IMO.

I've also removed a couple of hooks that did not seem as useful, now that the codebase and its configuration is quite stable. But I am happy to revert.

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (3d7c9d2) 85.86% compared to head (23197e3) 86.07%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #202 +/- ## ========================================== + Coverage 85.86% 86.07% +0.20% ========================================== Files 9 9 Lines 920 919 -1 ========================================== + Hits 790 791 +1 + Misses 130 128 -2 ``` | [Flag](https://app.codecov.io/gh/aiidalab/aiidalab-launch/pull/202/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | Coverage Δ | | |---|---|---| | [py-3.10](https://app.codecov.io/gh/aiidalab/aiidalab-launch/pull/202/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | `85.74% <100.00%> (-0.02%)` | :arrow_down: | | [py-3.11](https://app.codecov.io/gh/aiidalab/aiidalab-launch/pull/202/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | `85.74% <100.00%> (-0.02%)` | :arrow_down: | | [py-3.12](https://app.codecov.io/gh/aiidalab/aiidalab-launch/pull/202/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | `85.96% <100.00%> (+0.20%)` | :arrow_up: | | [py-3.8](https://app.codecov.io/gh/aiidalab/aiidalab-launch/pull/202/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | `85.69% <100.00%> (-0.02%)` | :arrow_down: | | [py-3.9](https://app.codecov.io/gh/aiidalab/aiidalab-launch/pull/202/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab) | `85.80% <100.00%> (-0.02%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aiidalab#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

danielhollas commented 9 months ago

Huh, interestingly, when I added back the check-manifest file, it started failing in pre-commit bot with

['/pc/clone/LLopfktuRsCG39y1Br0Ylw/py_env-python3/bin/python', '-m', 'build', '--sdist', '.', '--outdir', '/tmp/check-manifest-64gqzu8s-sdist'] failed (status 1):
* Creating venv isolated environment...
ERROR Failed to create venv. Maybe try installing virtualenv.
  Command '/tmp/build-env-iai5zihp/bin/python3.11 -m ensurepip --upgrade --default-pip' failed with return code 1
  stdout:
    /tmp/build-env-iai5zihp/bin/python3.11: No module named ensurepip

It doesn't seem like an actual issue, just some missing dependencies. For now I've removed the build-related setup from pyproject.toml which seems to solve this. Let's deal with it in a follow-up PR.