From d885d6bfa27ab30e897d962520ae3142d025584c Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 29 Aug 2019 16:15:48 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=AA=20modstool:=20Fiddle=20with=20the?= =?UTF-8?q?=20damn=20packaging/namespace=20so=20that=20stuff=20works?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qurator/modstool/__init__.py | 2 +- qurator/modstool/tests/test_modstool.py | 4 +++- setup.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/qurator/modstool/__init__.py b/qurator/modstool/__init__.py index de40ea7..eabaacd 100644 --- a/qurator/modstool/__init__.py +++ b/qurator/modstool/__init__.py @@ -1 +1 @@ -__import__('pkg_resources').declare_namespace(__name__) +from .modstool import * diff --git a/qurator/modstool/tests/test_modstool.py b/qurator/modstool/tests/test_modstool.py index 87a0b94..8fb0864 100644 --- a/qurator/modstool/tests/test_modstool.py +++ b/qurator/modstool/tests/test_modstool.py @@ -1,8 +1,10 @@ -from qurator.modstool.modstool import mods_to_dict, flatten import pytest import xml.etree.ElementTree as ET +from .. import mods_to_dict, flatten + + def dict_fromstring(x): """Helper function to parse a MODS XML string to a flattened dict""" return flatten(mods_to_dict(ET.fromstring(x))) diff --git a/setup.py b/setup.py index b5e673b..3048dd5 100644 --- a/setup.py +++ b/setup.py @@ -13,8 +13,8 @@ setup( long_description_content_type='text/markdown', keywords='qurator mets mots library', license='Apache', - packages=find_packages(exclude=['*.tests', '*.tests.*', - 'tests.*', 'tests']), + namespace_packages=['qurator'], + packages=find_packages(exclude=['*.tests', '*.tests.*', 'tests.*', 'tests']), install_requires=install_requires, entry_points={ 'console_scripts': [