-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix python reference and imports #2
Conversation
The executable change I'm fine with, however, the imports seem to be working for me. I tested the issue in a new, clean virtualenv:
|
Use env to select the right python executable. Fixes issue on MacOS with selecting the system python instead of the Homebrew python.
Weird. I'm getting this locally: sh-3.2$ pip2.7 install --user git+git://github.com/tbabej/tasklib@develop --upgrade
Collecting git+git://github.com/tbabej/tasklib@develop
Cloning git://github.com/tbabej/tasklib (to develop) to /var/folders/pm/64xc5hqn3qqc0xwrh04wzsjc0000gn/T/pip-cd4I4R-build
Requirement already up-to-date: six==1.5.2 in /usr/local/lib/python2.7/site-packages (from tasklib==0.10.0)
Requirement already up-to-date: pytz in /usr/local/lib/python2.7/site-packages (from tasklib==0.10.0)
Requirement already up-to-date: tzlocal in /usr/local/lib/python2.7/site-packages (from tasklib==0.10.0)
Installing collected packages: tasklib
Running setup.py install for tasklib
Successfully installed tasklib
sh-3.2$ task add test
Traceback (most recent call last):
File "~/.task/hooks/on-add-pirate", line 7, in <module>
from tasklib.task import TaskWarrior, Task
ImportError: cannot import name TaskWarrior
Hook Error: Expected feedback from a failing hook script. I'll investigate on my own. In the meantime I dropped those changes and left just the executable change. |
I figured out where the difference is, I am importing:
and you are (this is in the codebase)
The code in the repository contains the wrong version. Can you please get the import commit back up again, only not importing from backends directly, as TaskWarrior is exposed in the main module? I think we'll be fine for merging then. If you'd prefer doing it in a different pull request, feel free to do so. |
TaskWarrior and Task are available from the main tasklib module, not tasklib.task.
@tbabej Sure. Commit added. |
Fix python reference and imports
Thanks! |
np, thanks for task.shift-recurrence |
I wanted to use task.shift-recurrence but ran into these issues on MacOS.
with selecting the system python instead of the Homebrew python.
mentioned in the README.