From 9d5d36889176e51addeaa4ae6541dd94d3bb2269 Mon Sep 17 00:00:00 2001 From: Dima Gerasimov Date: Wed, 6 May 2020 22:05:16 +0100 Subject: [PATCH] get rid of unnecessary .init imports --- my/books/kobo.py | 2 -- my/calendar/holidays.py | 2 +- my/cfg.py | 2 +- my/coding/codeforces.py | 2 -- my/coding/github.py | 3 --- my/coding/topcoder.py | 2 -- my/hypothesis.py | 2 -- my/materialistic.py | 2 -- my/media/imdb.py | 3 --- my/pdfs.py | 3 --- my/pinboard.py | 2 -- my/smscalls.py | 2 -- tox.ini | 6 +++--- 13 files changed, 5 insertions(+), 28 deletions(-) diff --git a/my/books/kobo.py b/my/books/kobo.py index 09fa8c9..e5603a0 100644 --- a/my/books/kobo.py +++ b/my/books/kobo.py @@ -1,8 +1,6 @@ """ [[https://uk.kobobooks.com/products/kobo-aura-one][Kobo]] e-ink reader: annotations and reading stats """ -from .. import init - from typing import Callable, Union, List from my.config import kobo as config diff --git a/my/calendar/holidays.py b/my/calendar/holidays.py index 5759ec8..4f45a93 100644 --- a/my/calendar/holidays.py +++ b/my/calendar/holidays.py @@ -13,7 +13,7 @@ from my.config.holidays_data import HOLIDAYS_DATA # pip3 install workalendar from workalendar.europe import UnitedKingdom # type: ignore -cal = UnitedKingdom() # TODO FIXME specify in config +cal = UnitedKingdom() # TODO # TODO that should depend on country/'location' of residence I suppose? diff --git a/my/cfg.py b/my/cfg.py index ddc102f..da1a83e 100644 --- a/my/cfg.py +++ b/my/cfg.py @@ -14,7 +14,7 @@ After that, you can set config attributes: """ # TODO later, If I have config stubs that might be unnecessary too.. -from . import init +from . import init # todo not sure if this line is necessary? the stub will trigger it anyway import my.config as config diff --git a/my/coding/codeforces.py b/my/coding/codeforces.py index fbbf586..138cc73 100644 --- a/my/coding/codeforces.py +++ b/my/coding/codeforces.py @@ -1,6 +1,4 @@ #!/usr/bin/env python3 -from .. import init - from my.config import codeforces as config from datetime import datetime diff --git a/my/coding/github.py b/my/coding/github.py index 0126e47..508801f 100644 --- a/my/coding/github.py +++ b/my/coding/github.py @@ -1,9 +1,6 @@ """ Github events and their metadata: comments/issues/pull requests """ - -from .. import init - from typing import Dict, Any, NamedTuple, Tuple, Optional, Iterator, TypeVar, Set from datetime import datetime import json diff --git a/my/coding/topcoder.py b/my/coding/topcoder.py index de98114..c370b5d 100644 --- a/my/coding/topcoder.py +++ b/my/coding/topcoder.py @@ -1,6 +1,4 @@ #!/usr/bin/env python3 -from .. import init - from my.config import topcoder as config from datetime import datetime diff --git a/my/hypothesis.py b/my/hypothesis.py index 46e00bc..94d4edf 100644 --- a/my/hypothesis.py +++ b/my/hypothesis.py @@ -1,8 +1,6 @@ """ [[https://hypothes.is][Hypothes.is]] highlights and annotations """ -from . import init - from .common import get_files from .error import Res, sort_res_by diff --git a/my/materialistic.py b/my/materialistic.py index 79cd448..36ff1dc 100644 --- a/my/materialistic.py +++ b/my/materialistic.py @@ -1,8 +1,6 @@ """ [[https://play.google.com/store/apps/details?id=io.github.hidroh.materialistic][Materialistic]] app for Hackernews """ -from . import init - from datetime import datetime from typing import Any, Dict, Iterator, NamedTuple diff --git a/my/media/imdb.py b/my/media/imdb.py index 42a1bc0..23bccd7 100644 --- a/my/media/imdb.py +++ b/my/media/imdb.py @@ -1,7 +1,4 @@ #!/usr/bin/env python3 - -from .. import init - import csv import json from datetime import datetime diff --git a/my/pdfs.py b/my/pdfs.py index 5e7a36f..3c04196 100755 --- a/my/pdfs.py +++ b/my/pdfs.py @@ -2,9 +2,6 @@ ''' PDF documents and annotations on your filesystem ''' - -from . import init - from concurrent.futures import ProcessPoolExecutor from datetime import datetime import re diff --git a/my/pinboard.py b/my/pinboard.py index 8685d50..d37ba07 100644 --- a/my/pinboard.py +++ b/my/pinboard.py @@ -1,8 +1,6 @@ """ [[https://pinboard.in][Pinboard]] bookmarks """ -from . import init - from .common import get_files from my.config.repos.pinbexport import dal as pinbexport diff --git a/my/smscalls.py b/my/smscalls.py index e2d80f1..91d9af5 100644 --- a/my/smscalls.py +++ b/my/smscalls.py @@ -2,8 +2,6 @@ Phone calls and SMS messages """ # TODO extract SMS as well? I barely use them though.. -from . import init - from datetime import datetime from pathlib import Path from typing import NamedTuple, Iterator, Set diff --git a/tox.ini b/tox.ini index db24138..d11c30d 100644 --- a/tox.ini +++ b/tox.ini @@ -9,10 +9,10 @@ passenv = CI CI_* setenv = MY_CONFIG = nonexistent commands = pip install -e .[testing] - # TODO ?? # python -m pytest {posargs} - python3 -c 'import my.init; from my.config import stub as config; print(config.key)' - python3 -c 'import my.init; import my.config; import my.config.repos' # shouldn't fail at least + # todo these are probably not necessary anymore? + python3 -c 'from my.config import stub as config; print(config.key)' + python3 -c 'import my.config; import my.config.repos' # shouldn't fail at least python3 -m pytest tests/misc.py tests/get_files.py tests/config.py::test_set_repo tests/config.py::test_environment_variable # TODO add; once I figure out porg depdencency?? tests/config.py # TODO run demo.py? just make sure with_my is a bit cleverer?