ComPWA / policy

Pre-commit hooks that ensure that ComPWA repositories have a similar developer set-up
https://compwa.github.io/policy
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

Switch to community-maintained `pyright` Python package #13

Closed redeboer closed 11 months ago

redeboer commented 3 years ago

Pyright's official documentation now refers to a community-maintained Python package, pyright. This might solve the problem below. Note thought that we still need to turn this into a local hook, just like mypy, because the proposed solution is not generic enough.

  - repo: local
    hooks:
      - id: pyright
        name: pyright
        entry: pyright
        language: system
        require_serial: true
        types:
          - python

Update

The pyright Python package builds node locally. This takes a long time and if you break the process, there will be a corrupted build folder under ~/.cache/pyright-python/nodeenv and you will be unable to run pyright again. To fix this problem:

rm -rf `~/.cache/pyright-python/nodeenv`

and rerun pyright.

### Implementation
- [ ] [ComPWA/qrules](https://github.com/ComPWA/qrules)
- [ ] [ComPWA/ampform](https://github.com/ComPWA/ampform)
- [ ] [ComPWA/ampform-dpd](https://github.com/ComPWA/ampform-dpd)
- [ ] [ComPWA/tensorwaves](https://github.com/ComPWA/tensorwaves)
- [ ] [ComPWA/compwa-org](https://github.com/ComPWA/compwa-org)
- [ ] [ComPWA/PWA-pages](https://github.com/ComPWA/PWA-pages)
- [ ] [ComPWA/repo-maintenance](https://github.com/ComPWA/repo-maintenance)
- [ ] [ComPWA/actions](https://github.com/ComPWA/actions)
- [ ] [ComPWA/sphinxcontrib-hep-pdgref](https://github.com/ComPWA/sphinxcontrib-hep-pdgref)
- [ ] [ComPWA/polarimetry](https://github.com/ComPWA/polarimetry)
- [ ] [ComPWA/Nstar-documentation](https://github.com/ComPWA/Nstar-documentation/issues/2)

Original post

The pyright pre-commit hook seems not to work in the tox -e sty job (all of the ComPWA repos). This is a pity, because now it's not possible to run all CI locally with tox -p. image

redeboer commented 11 months ago

Closing this for now due to the build speed if NodeJS is not installed. This is not only annoying locally, but also works against pre-commit caching on GitHub Actions.