Closed mbacicc closed 2 years ago
Howdy - Thanks for the request. Seems fine to add this support. PR would be accepted.
Is there a requirements parsing spec or library we can copy / include into bandersnatch to handle all these edge cases? Would love to re-invent as little as possible here.
Naturally, please just add some tests showing this working etc.
Actually I'm not so sure that my way of using the requirements file is correct, neither I know if it is a supported way of doing that. I do this to speed up tests in our Gitlab CI/CD to take packages from our local bandersnatch and pypiserver package servers, avoiding the download of common packages from internet on every commit push.
At the moment I did a trick to remove the extra parameters with a python script which then uploads the edited requirements file to the docker volume of bandersnatch, but I can try to investigate on how to solve this at a bandersnatch level.
Ahh ok. If this is not a standard then I’d be hesitant to accept it in our parsing code …
I actually took this from here: Stackoverflow - Using pip with two --extra-index-url arguments that both point to the same domain But I'm not sure if it's a wanted feature by pip.
Since it's not a standard, I don't think we want to support this. I also think you realized you don't need it. Please reopen if I misunderstood anything.
Last time we considered this I had less time and experience. I dropped this idea and i parsed the requirements file before sending it to bandersnatch, remove the lines starting with -
.
It is actually possible to add pip options inside the requirement files as stated in the Requirements file specifications on pypa/pip docs.
I will try to do a PR where bandersnatch at least survives when it encounters such options, dropping the lines. Maybe in the future we can see if some of these can be useful in the mirroring process.
I have some django packages which depend on custom packages that we self host on our internal pypiserver. To make it work we add this first line to requirements.txt:
This line generates an exception in bandersnatch: