Skip to content

Commit

Permalink
Remove __init__.py files (#1275)
Browse files Browse the repository at this point in the history
Since we're implementing a plugin system that relies on implicit
namespacing, we should remove these files so that they don't confuse and
muddle our virtual envs (like the ones we use to run tests).

Also, they're not longer needed as of Python 3.3.

PEP 420 says:
Allowing implicit namespace packages means that the requirement to
provide an __init__.py file can be dropped completely...
  • Loading branch information
wren committed Jul 17, 2021
1 parent 4392e29 commit be1da17
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 44 deletions.
2 changes: 1 addition & 1 deletion features/steps/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from yaml.loader import SafeLoader

from jrnl import Journal
from jrnl import __version__
from jrnl.__version__ import __version__
from jrnl import plugins
from jrnl.args import parse_args
from jrnl.behave_testing import _mock_getpass
Expand Down
7 changes: 2 additions & 5 deletions jrnl/DayOneJournal.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@

from . import Entry
from . import Journal
from . import __title__
from . import __version__
from jrnl.__version__ import __version__


class DayOne(Journal.Journal):
Expand Down Expand Up @@ -133,9 +132,7 @@ def write(self):
platform.system(), platform.release()
)
if not hasattr(entry, "creator_software_agent"):
entry.creator_software_agent = "{}/{}".format(
__title__, __version__
)
entry.creator_software_agent = "jrnl/{}".format(__version__)

fn = (
Path(self.config["journal"])
Expand Down
8 changes: 0 additions & 8 deletions jrnl/__init__.py

This file was deleted.

9 changes: 0 additions & 9 deletions jrnl/__main__.py

This file was deleted.

7 changes: 3 additions & 4 deletions jrnl/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


def preconfig_diagnostic(_):
from jrnl import __version__
from jrnl.__version__ import __version__

print(
f"jrnl: {__version__}\n"
Expand All @@ -26,16 +26,15 @@ def preconfig_diagnostic(_):


def preconfig_version(_):
from jrnl import __title__
from jrnl import __version__
from jrnl.__version__ import __version__
from jrnl.plugins.collector import (
IMPORT_FORMATS,
EXPORT_FORMATS,
get_exporter,
get_importer,
)

version_str = f"""{__title__} version {__version__}
version_str = f"""jrnl version {__version__}
Copyright (C) 2012-2021 jrnl contributors
Expand Down
2 changes: 1 addition & 1 deletion jrnl/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import yaml
import xdg.BaseDirectory

from . import __version__
from jrnl.__version__ import __version__
from .exception import JrnlError
from .color import ERROR_COLOR
from .color import RESET_COLOR
Expand Down
4 changes: 0 additions & 4 deletions jrnl/plugins/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion jrnl/plugins/exporter/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from jrnl.plugins.base import BaseExporter

from ... import __version__
from jrnl.__version__ import __version__


class Exporter(BaseExporter):
Expand Down
2 changes: 1 addition & 1 deletion jrnl/plugins/exporter/fancy.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from jrnl.plugins.base import BaseExporter
from jrnl.plugins.util import check_provided_linewrap_viability

from ... import __version__
from jrnl.__version__ import __version__


class Exporter(BaseExporter):
Expand Down
2 changes: 1 addition & 1 deletion jrnl/plugins/exporter/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from jrnl.plugins.base import BaseExporter
from jrnl.plugins.util import get_tags_count

from ... import __version__
from jrnl.__version__ import __version__


class Exporter(BaseExporter):
Expand Down
2 changes: 1 addition & 1 deletion jrnl/plugins/exporter/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from jrnl.color import WARNING_COLOR
from jrnl.plugins.base import BaseExporter

from ... import __version__
from jrnl.__version__ import __version__


class Exporter(BaseExporter):
Expand Down
2 changes: 1 addition & 1 deletion jrnl/plugins/exporter/pretty.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from jrnl.plugins.base import BaseExporter

from ... import __version__
from jrnl.__version__ import __version__


class Exporter(BaseExporter):
Expand Down
2 changes: 1 addition & 1 deletion jrnl/plugins/exporter/short.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from jrnl.plugins.base import BaseExporter

from ... import __version__
from jrnl.__version__ import __version__


class Exporter(BaseExporter):
Expand Down
2 changes: 1 addition & 1 deletion jrnl/plugins/exporter/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from jrnl.plugins.base import BaseExporter
from jrnl.plugins.util import get_tags_count

from ... import __version__
from jrnl.__version__ import __version__


class Exporter(BaseExporter):
Expand Down
2 changes: 1 addition & 1 deletion jrnl/plugins/exporter/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from jrnl.plugins.base import BaseExporter

from ... import __version__
from jrnl.__version__ import __version__


class Exporter(BaseExporter):
Expand Down
2 changes: 1 addition & 1 deletion jrnl/plugins/exporter/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from jrnl.plugins.base import BaseExporter
from jrnl.plugins.util import get_tags_count

from ... import __version__
from jrnl.__version__ import __version__


class Exporter(BaseExporter):
Expand Down
2 changes: 1 addition & 1 deletion jrnl/plugins/exporter/yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from jrnl.color import WARNING_COLOR
from jrnl.plugins.base import BaseExporter

from ... import __version__
from jrnl.__version__ import __version__


class Exporter(BaseExporter):
Expand Down
2 changes: 1 addition & 1 deletion jrnl/plugins/importer/jrnl.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from jrnl.plugins.base import BaseImporter

from ... import __version__
from jrnl.__version__ import __version__


class Importer(BaseImporter):
Expand Down
2 changes: 1 addition & 1 deletion jrnl/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sys

from . import Journal
from . import __version__
from jrnl.__version__ import __version__
from .EncryptedJournal import EncryptedJournal
from .config import is_config_json
from .config import load_config
Expand Down

0 comments on commit be1da17

Please sign in to comment.