pyupio / pyup

A tool to update your project's dependencies on GitHub. Runs on pyup.io, comes with a command line interface.
https://pyup.io
MIT License
448 stars 67 forks source link

Extra dot in requirements file detected twice and not updated #390

Open browniebroke opened 4 years ago

browniebroke commented 4 years ago

I have an issue with PyUP on Cookiecutter Django project. This is a project template for Cookiecutter to quickly generate boilerplate for a Django project

We have 4 requirements file:

We're receiving updates for all of them except base.txt, and I can't really understand why.

When looking at the PyUP dashboard, I can see the file is detected twice, with a dot in the name:

  1. {{cookiecutter.project_slug}}/requirements/./base.txt
  2. {{cookiecutter.project_slug}}/requirements/base.txt

Somehow, I assume this is preventing the update from arriving...?

I've tried to add them to the config file, or click "reload" in the dashboard, but the problem persists.

lf1up commented 4 years ago

@browniebroke thank you for this catch. This is an unusual bug causing strange behavior. I added it to the list of bugfixes.

browniebroke commented 4 years ago

Just adding here a new piece of info I've just discovered in case it helps. Pyup creates the branches to run the updates, but doesn't open a pull reques:

https://github.com/pydanny/cookiecutter-django/branches/all

image
browniebroke commented 4 years ago

I tracked it down to this recursive call to add_requirement_file:

https://github.com/pyupio/pyup/blob/6fb86387f58c5a345d7c44ebdbb02a6a1d1ba07d/pyup/bot.py#L519

Which doesn't play nice with our production.txt and local.txt including the base requirements with a relative path: -r ./base.txt

https://github.com/pydanny/cookiecutter-django/blob/3dedd4dd4b55254a0fe6ef272c70c0a54c5e5188/%7B%7Bcookiecutter.project_slug%7D%7D/requirements/production.txt#L3

browniebroke commented 4 years ago

Changed the -r ./base.txt to -r base.txt fixed it, all good on my end now!

Do you want to keep this issue open to improve how you deal with this use case?