thought-machine / pleasings

Addons & new build rules for Please
Apache License 2.0
98 stars 39 forks source link

Update //python:requirements to allow comments after dependencies #39

Closed eganjs closed 4 years ago

eganjs commented 4 years ago

I'm a fan of please and pip-compile and ideally I would like to use them together (particularly for the hashing functionality!)

To enable this I've updated the //python:requirements rules to try and improve the parsing of the requirements.txt file

eganjs commented 4 years ago

I'm happy with the state of this PR now, I won't be pushing more updates except to respond to review comments

eganjs commented 4 years ago

After some reflection, I have re-scoped the PR to only add the ability to comment on the same line as a dependency declaration.

I realised that the hashing I was interested in would not be possible as that part of the file is not parsed by the existing rule or my changes.

So instead, allowing comments after packages is a nice compromise that still enables minimum-viable usage of pip-compile.

peterebden commented 4 years ago

Nice, thanks!