python-lint-annotate
python-lint-annotate copied to clipboard
Requirements not found error + fix for error in black
setup-python action was searching for the requirements.txt file of the linted python project, which in pipenv projects broke the action and updated black to get this fix: https://github.com/psf/black/pull/2966
Now that I am looking at this, I see a bigger problem. If we do install requirements.txt than linting with mypy is a lot less usefull since it just ignores missing libraries: missing-imports but that is far from ideal. The checks pass but the user does not know that some may have been silently skipped.
Is see few options here:
- we have to figure out how to install all dependencies ourselves, maybe add some configurable mypy option where the user could point the action to the requirements file(s). We would also ideally need to take care of other installation tools like poetry
- second option is to make the user install everything the package requires. But that also has its problems. What if other actions are separated from this one? We are setting our own python version with @setup-python this will overwrite the setup the user has done if I am not mistaken. The @setup-python could be left on the user but then we have to be prepared to handle some non-standard environments whis can be really cumbersome.
- just state in the README that this action requires a
requirements.txtfile to be placed in repo even if it should be empty
I am quite short on time and will look into it later, but you could take a shot at this @nmenardg-keeper if you would like :) Or just let me hear your toughts on this.
You're making good points here. Thinking about it, here are the options I see:
- User provides a command to run for installing dependencies
- Very flexible, but kind of dirty
- Let the user do the setup beforehand.
setup-pythonand installing dependencies- To be honest I don't understand the problems you mention here.
- Tell the user to generate a requirements.txt file beforehand
- this is possible with
pipenv requirements, I don't know about other tools like poetry - Very easy on our part
- I don't like the idea of asking people to provide an empty requirements.txt that wouldn't help mypy in the end
- this is possible with
I'd go with option 3
Closed by mistake