cenkalti / kuyruk

⚙️ Simple task queue for Python
https://kuyruk.readthedocs.org/
MIT License
231 stars 17 forks source link

Make use of `pkg_resources` optional #45

Closed frol closed 7 years ago

frol commented 7 years ago

pkg_resources is a part of setuptools package, which is neither available nor used in Anaconda Python for entrypoints.

When setuptools is not installed, Kuyruk fails with the following traceback:

import: 'kuyruk'
Traceback (most recent call last):
  File "/staged-recipes/build_artefacts/test-tmp_dir/run_test.py", line 26, in <module>
    import kuyruk
  File "/opt/conda/envs/_test/lib/python2.7/site-packages/kuyruk/__init__.py", line 9, in <module>
    from kuyruk.config import Config
  File "/opt/conda/envs/_test/lib/python2.7/site-packages/kuyruk/config.py", line 6, in <module>
    import pkg_resources
ImportError: No module named pkg_resources

So, you cannot even import kuyruk.

frol commented 7 years ago

Oh, wait, it is not all.

cenkalti commented 7 years ago

Hello @frol.

I don't have enough information on this subject. And I couldn't find it after searching. Can you tell me why setuptools is not available on Anaconda?

frol commented 7 years ago

Anaconda has its own package manager (conda), and also its own reimplementation of entry-points, so even if we require setuptools as a "run" dependency, it won't have much use, though it won't fail, so it is also a way to go instead of this patching.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.5%) to 82.765% when pulling 6614f707dfd2f82e4746d16b526ca2488e57ea6a on frol:patch-2 into 6971f4b15bda28b8b6041be432572353da4cfa62 on cenkalti:master.

cenkalti commented 7 years ago

setuptools is pretty standard these days and I don't want to put conda specific logic into the code. So if there is another way without merging this PR I will be more happy.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.5%) to 82.765% when pulling 6614f707dfd2f82e4746d16b526ca2488e57ea6a on frol:patch-2 into 6971f4b15bda28b8b6041be432572353da4cfa62 on cenkalti:master.

frol commented 7 years ago

OK, let's drop this.