ImportError while loading conftest '/home/runner/work/flowmapper/flowmapper/tests/conftest.py'.
tests/conftest.py:5: in <module>
from flowmapper.flow import Flow
flowmapper/flow.py:5: in <module>
from .unit import Unit
flowmapper/unit.py:5: in <module>
from bw2io.units import normalize_units, DEFAULT_UNITS_CONVERSION
/opt/hostedtoolcache/Python/3.9.1[8](https://github.com/fjuniorr/flowmapper/actions/runs/7141508150/job/19448908870#step:6:9)/x64/lib/python3.[9](https://github.com/fjuniorr/flowmapper/actions/runs/7141508150/job/19448908870#step:6:10)/site-packages/bw2io/__init__.py:76: in <module>
from .importers import (
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/bw2io/importers/__init__.py:2: in <module>
from .ecoinvent_lcia import EcoinventLCIAImporter
/opt/hostedtoolcache/Python/3.9.[18](https://github.com/fjuniorr/flowmapper/actions/runs/7141508150/job/19448908870#step:6:19)/x64/lib/python3.9/site-packages/bw2io/importers/ecoinvent_lcia.py:[19](https://github.com/fjuniorr/flowmapper/actions/runs/7141508150/job/19448908870#step:6:20): in <module>
class EcoinventLCIAImporter(LCIAImporter):
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/bw2io/importers/ecoinvent_lcia.py:25: in EcoinventLCIAImporter
def __init__(self, biosphere_database: str | None = None):
E TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
Error: Process completed with exit code 4.
For https://github.com/fjuniorr/flowmapper/pull/51 I've used
bw2io.units.normalize_units
andbw2io.units.DEFAULT_UNITS_CONVERSION
instead of bringing the lists toflowmapper
to lessen future maintenance costs.However
bw2io
uses union types asX | Y
which is only Python 3.10+ explaining the failing tests for 3.9 in CI: