-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace safety with pip audit #645
Conversation
also: use poetry 1.2.2, and replace safety with pip-audit
Codecov ReportBase: 83.04% // Head: 85.90% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #645 +/- ##
==========================================
+ Coverage 83.04% 85.90% +2.85%
==========================================
Files 22 47 +25
Lines 920 1830 +910
==========================================
+ Hits 764 1572 +808
- Misses 156 258 +102
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
it's now included in mongoengine. we had to use this dependency to use mongo URL with "+srv"
replacing safety with pip-audit, upgrading the dependencies, after rewriting poetry.lock with poetry 1.2
see pypa/pip-audit#84 (comment) in particular
https://github.com/pyupio/safety is updated only once per month (you have to pay to have more frequent updates). https://github.com/pypa/pip-audit has fewer stars (684 against 1.4k) but use open data and is maintained by https://github.com/pypa.
Note that we upgrade poetry to 1.2.2 in this PR.
We have some issues with pip-audit (see below), and the fixes are a bit hacky (editing the requirements.txt file with
sed
). Ideally, it would be managed in a proper poetry plugin (see https://github.com/opeco17/poetry-audit-plugin/ for a plugin based on safety), but I think it's not worth creating a new repo for now.Some notes:
poetry audit
: Support Poetry viapoetry.lock
pypa/pip-audit#84pip-audit
or to create a poetry plugin to do so: Addpip-audit
to poetry operations that touch the lockfile python-poetry/poetry#6220That's why we do:
bash -c 'poetry run pip-audit -r <(poetry export -f requirements.txt --with dev)'
We still have an issue, though: the requirements.txt file contains duplicates when the same package is required both with and without "extras", e.g. with requests (which is not considered a bug by poetry: python-poetry/poetry-plugin-export#129, python-poetry/poetry-plugin-export#157, reason: python-poetry/poetry#5688 (comment)):
but pip-audit fails in this case:
I added a comment here: pypa/pip-audit#84 (comment)