diff --git a/server/buildoutls/buildout.py b/server/buildoutls/buildout.py index dbe5e46..8daa4d3 100644 --- a/server/buildoutls/buildout.py +++ b/server/buildoutls/buildout.py @@ -53,7 +53,8 @@ section_header, ) -from . import aiohttp_session, jinja, recipes +from . import jinja, recipes +from .util import aiohttp_session logger = logging.getLogger(__name__) diff --git a/server/buildoutls/code_actions.py b/server/buildoutls/code_actions.py index 3524825..1c378b1 100644 --- a/server/buildoutls/code_actions.py +++ b/server/buildoutls/code_actions.py @@ -19,7 +19,8 @@ UpdateMD5SumCommandParams, ) -from . import buildout, pypi +from .util import pypi +from . import buildout logger = logging.getLogger(__name__) converter = get_converter() diff --git a/server/buildoutls/diagnostic.py b/server/buildoutls/diagnostic.py index 09396c0..cff70cc 100644 --- a/server/buildoutls/diagnostic.py +++ b/server/buildoutls/diagnostic.py @@ -16,7 +16,8 @@ from pygls.server import LanguageServer from zc.buildout.configparser import MissingSectionHeaderError, ParsingError -from . import buildout, jinja, pypi, types +from . import buildout, jinja, types +from .util import pypi # this is a function to be patched in unittest from os.path import exists as os_path_exists diff --git a/server/buildoutls/server.py b/server/buildoutls/server.py index 3ab5ce8..aee65c3 100644 --- a/server/buildoutls/server.py +++ b/server/buildoutls/server.py @@ -57,12 +57,14 @@ code_actions, commands, diagnostic, - md5sum, profiling, recipes, types, ) +from .util import md5sum + + server = LanguageServer(name="zc.buildout.languageserver", version="0.9.0") server.command(commands.COMMAND_START_PROFILING)(profiling.start_profiling) diff --git a/server/buildoutls/tests/conftest.py b/server/buildoutls/tests/conftest.py index 764d245..a2ded7f 100644 --- a/server/buildoutls/tests/conftest.py +++ b/server/buildoutls/tests/conftest.py @@ -17,7 +17,7 @@ _resolved_extends_cache, parse, ) -from ..aiohttp_session import close_session +from ..util.aiohttp_session import close_session @pytest.fixture(autouse=True) diff --git a/server/buildoutls/util/__init__.py b/server/buildoutls/util/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/server/buildoutls/aiohttp_session.py b/server/buildoutls/util/aiohttp_session.py similarity index 100% rename from server/buildoutls/aiohttp_session.py rename to server/buildoutls/util/aiohttp_session.py diff --git a/server/buildoutls/md5sum.py b/server/buildoutls/util/md5sum.py similarity index 96% rename from server/buildoutls/md5sum.py rename to server/buildoutls/util/md5sum.py index fff692c..29b956d 100644 --- a/server/buildoutls/md5sum.py +++ b/server/buildoutls/util/md5sum.py @@ -15,8 +15,9 @@ ) from pygls.server import LanguageServer -from . import aiohttp_session, buildout -from .types import UpdateMD5SumCommandParams +from . import aiohttp_session +from .. import buildout +from ..types import UpdateMD5SumCommandParams async def update_md5sum( diff --git a/server/buildoutls/pypi.py b/server/buildoutls/util/pypi.py similarity index 98% rename from server/buildoutls/pypi.py rename to server/buildoutls/util/pypi.py index 8e09d19..77a3c65 100644 --- a/server/buildoutls/pypi.py +++ b/server/buildoutls/util/pypi.py @@ -9,7 +9,7 @@ import pkg_resources from . import aiohttp_session -from .types import KnownVulnerability, VersionNotFound, ProjectNotFound +from ..types import KnownVulnerability, VersionNotFound, ProjectNotFound import cattrs converter = cattrs.Converter()