slaypni / fastdtw

A Python implementation of FastDTW
MIT License
774 stars 122 forks source link

Make pytest-runner requirement conditional #31

Closed wshanks closed 4 years ago

wshanks commented 5 years ago

Don't require pytest-runner outside of tests because setup_requires behaves poorly in certain situations. For example, see https://github.com/pytest-dev/pytest-runner#conditional-requirement and https://github.com/pypa/pip/issues/410.

ecederstrand commented 4 years ago

Ping? This is annoying when you are using a non-standard PyPI repo because setup_requires ignores any settings I have tried and still goes to pypi.org.

A different solution is to put the requirement in setup.cfg. See an example at https://github.com/django-haystack/django-haystack/pull/1686

wshanks commented 4 years ago

On the user side, the workarounds I have found are:

  1. Add a find_links entry to .pydistutils.cfg as described in my second link above. I found this approach too fragile for my use case.
  2. Add the setup_requires package as an additional explicit requirement to your project. The only ones I have encountered so far are pytest-runner and setuptools-scm and they are both lightweight dependencies. EDIT: actually, it is a little more involved than this. You need to install dependencies in two steps. First install the setup_requires package(s). Then install all of your normal dependenices. If you just add the setup_requires packages as additional dependencies, pip won't recognize them as dependencies of the packages that list them in setup_requires and might still try to install the package that needs the setup_requires package before installing the setup_requires package.
slaypni commented 4 years ago

@willsALMANJ @ecederstrand Thank you for your PR, and sorry for your inconvenience. Just merged!

ecederstrand commented 4 years ago

@slaypni Thanks for merging this.

Would it be possible for you to release a version to pypi.org containing this patch?

slaypni commented 4 years ago

@ecederstrand New version uploaded!