-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Describe the bug
Running the provided test suite produces an error with importing clr with Python 3.10 and Manjaro Linux. If we try importing the package from an interactive Python shell, the error is more specific about the clr package not having an AddReference attribute. Logs attached
To Reproduce
- Create and activate Python a virtual environment
- Install the package to the virtual environment
- run
pytest - Pytest gets interrupted during collection
Expected behavior
Tests load correctly and start running.
Screenshots
(None)
Desktop (please complete the following information):
- OS: Linux 5.19.7-1-MANJARO 0.0.2 #1 SMP PREEMPT_DYNAMIC Mon Sep 5 10:16:57 UTC 2022 x86_64 GNU/Linux
- Python Version: Python 3.10.6 (main, Aug 3 2022, 17:39:45) [GCC 12.1.1 20220730] on linux
Additional context
Seeing that the module comes bundled with .dll files led me to believe that this package was never meant to run under anything other than Microsoft Windows even though any automation of data processes would likely be carried out by data engineers, developed and tested under Linux or the Windows Subsystem for Linux (WSL), and deployed to some cloud service such as functions, app services, containers or virtual machines. All of those predominantly run Linux. The current package should either try to support and test on such systems or explicitly state that they are unsupported in the README file.
Pytest log:
=================================================================================== test session starts ====================================================================================
platform linux -- Python 3.10.6, pytest-7.1.1, pluggy-1.0.0 -- /usr/bin/python
cachedir: .pytest_cache
rootdir: /home/radi/Code/PyTabular, configfile: pyproject.toml
plugins: anyio-3.6.1
collected 0 items / 1 error
========================================================================================== ERRORS ==========================================================================================
__________________________________________________________________________ ERROR collecting test/test_tabular.py ___________________________________________________________________________
ImportError while importing test module '/home/radi/Code/PyTabular/test/test_tabular.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../../.local/lib/python3.10/site-packages/_pytest/python.py:608: in _importtestmodule
mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
../../.local/lib/python3.10/site-packages/_pytest/pathlib.py:533: in import_path
importlib.import_module(module_name)
/usr/lib/python3.10/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
???
<frozen importlib._bootstrap>:1027: in _find_and_load
???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:688: in _load_unlocked
???
../../.local/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:168: in exec_module
exec(co, module.__dict__)
test/test_tabular.py:1: in <module>
import pytabular
pytabular/__init__.py:32: in <module>
import clr
E ModuleNotFoundError: No module named 'clr'
================================================================================= short test summary info ==================================================================================
ERROR test/test_tabular.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
===================================================================================== 1 error in 0.08s =====================================================================================
Import log:
Python 3.10.6 (main, Aug 3 2022, 17:39:45) [GCC 12.1.1 20220730] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pytabular
22/10/01 10:06:51 +0300::__init__::<module>::INFO::Logging configured...
22/10/01 10:06:51 +0300::__init__::<module>::INFO::To update PyTabular logger...
22/10/01 10:06:51 +0300::__init__::<module>::INFO::>>> import logging
22/10/01 10:06:51 +0300::__init__::<module>::INFO::>>> pytabular.logger.setLevel(level=logging.INFO)
22/10/01 10:06:51 +0300::__init__::<module>::INFO::See https://docs.python.org/3/library/logging.html#logging-levels
22/10/01 10:06:51 +0300::__init__::<module>::DEBUG::Python Version::3.10.6 (main, Aug 3 2022, 17:39:45) [GCC 12.1.1 20220730]
22/10/01 10:06:51 +0300::__init__::<module>::DEBUG::Python Location::/home/radi/Code/PyTabular/venv
22/10/01 10:06:51 +0300::__init__::<module>::DEBUG::Package Location::/home/radi/Code/PyTabular/pytabular/__init__.py
22/10/01 10:06:51 +0300::__init__::<module>::DEBUG::Working Directory::/home/radi/Code/PyTabular
22/10/01 10:06:51 +0300::__init__::<module>::DEBUG::Platform::linux-5.19.7-1-MANJARO
22/10/01 10:06:51 +0300::__init__::<module>::DEBUG::Beginning CLR references...
22/10/01 10:06:51 +0300::__init__::<module>::DEBUG::Adding Reference Microsoft.AnalysisServices.AdomdClient
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/radi/Code/PyTabular/pytabular/__init__.py", line 35, in <module>
clr.AddReference("Microsoft.AnalysisServices.AdomdClient")
AttributeError: module 'clr' has no attribute 'AddReference'