Closed WhyNotHugo closed 2 years ago
I changed my old config file to ~/.config/todoman/todoman.conf
path = '~/.calendars/*'
date_format = '%d.%m.%y'
time_format = '%H:%M'
default_due = 0
default_list = "default"
dt_separator = "_"
humanize = True
Nonetheless I get a 'no configuration file found' error. What do I need to change?
Whoops, that's not actually mentioned here! The config file is now called config.py
, not todoman.conf
. Placed in the same directory.
In addition, the shell
command does not seem available anymore
The shell
breakage is due an upstream issue; look like latest click
version does not work with click_repl
.
https://github.com/click-contrib/click-repl/issues/75
For the moment, downgrading to click<8.0
seems to be the only workaround.
Renaming the file worked. Thanks.
The
shell
breakage is due an upstream issue; look like latestclick
version does not work withclick_repl
.For the moment, downgrading to
click<8.0
seems to be the only workaround.
FYI, after updating my arch install this is not an issue to me anymore. :)
Thanks for maintaining this package!
Sadly after renaming the config file and updating its format I have a code issue:
configuration.py", line 227, in load_config
spec = importlib.util.spec_from_file_location("config", path)
AttributeError: module 'importlib' has no attribute 'util'
My Python system version is 3.9.5. Any clue how to solve this?
Thanks!
@ig-perez Is this still an issue? What OS is this? What's the output of python --version
(just want to confirm that it's not using python2
by default)?
Hi @WhyNotHugo last time I checked it was still an issue, I have downgraded to v3.9.0 and all is working fine. My OS is Linux Fedora, the system's Python version is 3.8.8. and todoman is installed under it with $ pip install --user todoman
What's the output of python -c "import importlib; importlib.util"
and python --version
?
This:
What's which python
and head $(which todoman)
$ which python
outputs /hdd/anaconda/bin/python
$ head $(which todoman)
outputs /usr/bin/which: no todoman in (/hdd/anaconda/bin:/hdd/anaconda/condabin:/home/ivan/.poetry/bin:/home/ivan/.pyenv/shims:/home/ivan/.poetry/bin:/home/ivan/.pyenv/bin:/home/ivan/.local/bin:/home/ivan/bin:/home/ivan/.poetry/bin:/home/ivan/.pyenv/shims:/home/ivan/.nvm/versions/node/v10.22.0/bin:/home/ivan/.poetry/bin:/home/ivan/.pyenv/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/ivan/.local/bin:/home/ivan/.local/bin)
Sorry, I meant which todo
for that last one.
$ which todo
outputs ~/.local/bin/todo
but let me remind you due to the reported issue I downgrade the version to 3.9 as mentioned here :)
What's head $(which todo)
.
I want to confirm it's really using the virutalenv and not the system python.
I mixed up my original question, I typed head $(which todoman)
, but I mean head $(which todo)
.
This prints the first few lines of the todoman
binary. I want to double-check that the hashbang points to the python in your virtualenv, since todo
uses a slightly non-standard hashbang.
This is the output for head $(which todo)
:
Now I recall I installed current version (todoman 3.9) within a Python 3.7 virtual env. since for higher versions only todoman v4 was available and it was not working for me.
But oddly when I run todo --version
I get todoman, version 4.0.0
nevertheless I get 3.9 when I run pip list --user
:
pip list --user
will list user-installed backages (e.g.: in the user-default virtualenv). You can probably run this version using python -m todoman
, and python -m todoman --version
should print 4.0.0
.
However, todo
runs using the python/virtualenv in /home/ivan/.pyenv/versions/3.7.0
, which apparently has 3.9.0 installed. I think you can confirm this by running /home/ivan/.pyenv/versions/3.7.0/bin/pip list
.
The configuration format is changing with release 4.0.0. We currently depend on an unmaintained library for configuration. It's not currently in a working state, and while some distributions are patching it, setting up a clean environment is a bit non-trivial, and the situation will only degrade in future.
The changes in format are be subtle, and also come with an intention to add further extensibility in future. Configuration files will be plain python. If you don't know Python don't worry, you don't need to know Python.
I'll take my own config as a reference. The pre-4.0.0 format is:
The 4.0.0 version would look like this:
Key differences:
[main]
header is no longer needed.yes
oron
is no longer valid; onlyTrue
andFalse
are valid.That's basically it. This lets up drop the problematic dependency, and we don't actually need anything to read the config: it's just python code like the rest of
todoman
!For those users who are python developers, you'll note this gives some interesting flexibility: you CAN add any custom python code into the config file. For example, you can defined the
path
programatically:There are no limitations here, but if you break something, you get to keep both pieces.