Pin setuptools in dev requirements for --require-hashes#1454
Open
Rodrigorm33 wants to merge 1 commit into
Open
Pin setuptools in dev requirements for --require-hashes#1454Rodrigorm33 wants to merge 1 commit into
Rodrigorm33 wants to merge 1 commit into
Conversation
nodeenv (pulled in by pre-commit) declares setuptools as a runtime dependency, but setuptools was not pinned in requirements-dev.txt. Under pip install --require-hashes, every resolved dependency must be pinned with == and a hash, so the install aborted on setuptools. Add setuptools to requirements-dev.in (capped <81 to keep pkg_resources, which nodeenv imports and which was removed in setuptools 82) and the matching pinned, hashed entry to requirements-dev.txt, reproducing the pip-compile --allow-unsafe output (resolves to 80.10.2). Fixes okfn-brasil#1431 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
O que isto resolve
Issue #1431:
pip install --require-hashes -r data_collection/requirements-dev.txtfalha porque
setuptoolsnão está pinado com hash.Causa
nodeenv(dependência transitiva viapre-commit) declarasetuptoolscomodependência de runtime. Em
--require-hashes, toda dependência resolvida precisaestar pinada com
==e hash. Comosetuptoolsnão constava no arquivo, o piptentava resolvê-lo solto e abortava:
Correção
requirements-dev.in: adicionasetuptools<81. O.txté gerado do.in(
make compile), então o pino precisa existir na fonte para sobreviver aregenerações. O limite
<81mantémpkg_resources-- que onodeenvimportae que foi removido no
setuptools82.0.0 -- disponível.requirements-dev.txt: adiciona a entrada pinada com hash, na seção dasdependências consideradas "unsafe", no formato do
pip-compile --allow-unsafe(resolve para 80.10.2).
Verificação
pip install --dry-run --require-hashesaborta em setuptools; depois, resolve(
Would install ... setuptools-80.10.2).--require-hashes: o pip passa do check de pinos e seguepara o download, sem nenhum outro pacote ficar sem hash.
pre-commit runnos arquivos alterados: passa.pip hashe com a saída dopip-compile.A checklist do template cobre PRs de raspadores; este PR é manutenção das
dependências de desenvolvimento, então os itens de spider/coleta não se aplicam.
Disclosure: este PR foi produzido com assistência de IA (Claude Opus 4.8) e revisado por um humano antes da abertura.