Skip to content

Commit

Permalink
Remove all __init__.py for PEP0420 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
olofk committed Dec 30, 2023
1 parent ecf2955 commit 11a40e5
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 28 deletions.
7 changes: 6 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@
author = "Olof Kindgren"

# The full version, including alpha/beta/rc tags.
release = fusesoc.__version__
try:
from fusesoc.version import version as __version__
except ImportError:
__version__ = "unknown"

release = __version__
# The short X.Y version.
v_major, v_minor = LooseVersion(release).version[:2]
version = f"{v_major}.{v_minor}"
Expand Down
8 changes: 0 additions & 8 deletions fusesoc/__init__.py

This file was deleted.

3 changes: 0 additions & 3 deletions fusesoc/capi2/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion fusesoc/capi2/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from fusesoc import utils
from fusesoc.capi2.coredata import CoreData
from fusesoc.provider import get_provider
from fusesoc.provider.provider import get_provider
from fusesoc.vlnv import Vlnv

logger = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion fusesoc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def write(self):
self._cp.write(conf_file)

def add_library(self, library):
from fusesoc.provider import get_provider
from fusesoc.provider.provider import get_provider

section_name = "library." + library.name

Expand Down
2 changes: 1 addition & 1 deletion fusesoc/librarymanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import logging
import os

from fusesoc.provider import get_provider
from fusesoc.provider.provider import get_provider

logger = logging.getLogger(__name__)

Expand Down
5 changes: 4 additions & 1 deletion fusesoc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
import warnings
from pathlib import Path

from fusesoc import __version__
try:
from fusesoc.version import version as __version__
except ImportError:
__version__ = "unknown"

# Check if this is run from a local installation
fusesocdir = os.path.abspath(
Expand Down
3 changes: 0 additions & 3 deletions fusesoc/parser/__init__.py

This file was deleted.

9 changes: 0 additions & 9 deletions fusesoc/provider/__init__.py

This file was deleted.

6 changes: 6 additions & 0 deletions fusesoc/provider/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@

logger = logging.getLogger(__name__)

from importlib import import_module


def get_provider(name):
return getattr(import_module(f"fusesoc.provider.{name}"), name.capitalize())


class Provider:
def __init__(self, config, core_root, files_root):
Expand Down

0 comments on commit 11a40e5

Please sign in to comment.