galaxyproject / tools-iuc

Tool Shed repositories maintained by the Intergalactic Utilities Commission
https://galaxyproject.org/iuc
MIT License
162 stars 417 forks source link

Make flake8 plugins configurable #4988

Open peterjc opened 1 year ago

peterjc commented 1 year ago

Currently the GitHub actions template https://github.com/galaxyproject/tools-iuc/blob/master/.github/workflows/pr.yaml uses:

    - name: Install flake8
      run: pip install flake8 flake8-import-order

This is run in conjunction with a flake8 configuration under https://github.com/galaxyproject/tools-iuc/blob/master/setup.cfg

The individual tool authors using the template may wish to use different flake8 plugins (which may have specific version requirements). The suggestion from @bernt-matthias in discussion on https://github.com/peterjc/galaxy_blast/pull/149 is to add a .flake_requirements (or flake8_requirements?).

This could by default be just:

# List of flake8 and any plugins you wish to use, optionally with versions:
flake8
flake8-import-order

There are pros-and-cons to pinning this to current latest versions (it would avoid the dependencies changing without warning and introducing new checks, and thus breaking the CI unexpectedly, but complicates updating the CI checks):

# List of flake8 and any plugins you wish to use, optionally with versions:
flake8==6.0
flake8-import-order==0.18.2

Either way, the pr.yaml would become:

    - name: Install flake8 and any plugins
      run: pip install -r .flake8_requirements

Note this allows the tool author to remove flake8-import-order if they really wanted to.

The tool authors can supplement the provided flake8 configuration for any additional plugins they add.

nsoranzo commented 1 year ago

I think this should be moved to https://github.com/galaxyproject/galaxy-tool-repository-template , but I don't have write access to that repo.

bernt-matthias commented 1 year ago

Thanks for writing this up @peterjc .. Should be trivial to implement

@nsoranzo I think the main repo for developing the workflows will be the IUC repo. In particular once https://github.com/galaxyproject/tools-iuc/pull/4830 is done and merged ;)

peterjc commented 1 year ago

So in the short term if this supported in principle, would a pull request go to https://github.com/galaxyproject/galaxy-tool-repository-template then?

bernt-matthias commented 1 year ago

@peterjc I would open a PR against IUC