brightway-lca / brightway2-calc

The calculation engine for the Brightway2 life cycle assessment framework.
BSD 3-Clause "New" or "Revised" License
11 stars 14 forks source link

test requirements and CI tests pull brightway2 #57

Closed tngTUDOR closed 2 years ago

tngTUDOR commented 2 years ago

Current requirements-test.txt includes brightway2:

brightway2
bw_processing
numpy
pandas
pytest
pytest-cov
python-coveralls
scipy
stats_arrays

The azure-pipelines install testing deps by hand:

(for ubuntu 20.04 )

conda install --yes --quiet -c defaults -c conda-forge -c cmutel -c haasad --name bw2 python=$PYTHON_VERSION numpy bw_processing matrix_utils pandas scipy psutil pypardiso pytest peewee brightway2 pytest pytest-azurepipelines">=1.0.2" pytest-cov

this mix ( ;) ), from the master branch of brightway2-calc will lead to testing using other brightway2 packages that might not be suited for brightway25 environment.

tngTUDOR commented 2 years ago

Current testing would yield a bw2 environment. For example with miniconda3:

git clone git@github.com/brightway-lca/brightway2-calc.git
cd brightway2-calc
docker run --rm -it \
-v`pwd`:/code \
continuumio/miniconda3

inside the container:

cd /code # to be in the brightway2-calc directory
conda install -c conda-forge -c cmutel --file requirements-test.txt # install the deps
.... # a lot of info from conda
conda list | egrep "bw2"
bw2analyzer               0.9.4                      py_1    cmutel
bw2calc                   1.8.1                      py_2    cmutel
bw2data                   0.4.1                      py_2    cmutel
bw2io                     0.8.6                      py_1    cmutel
bw2parameters             0.7                        py_0    cmutel

Edit: there is no error when running the tests, but we are testing with bw2calc 1.8.1:

pytest
============================================================================================== test session starts ===============================================================================================
platform linux -- Python 3.10.4, pytest-7.1.2, pluggy-1.0.0
rootdir: /code, configfile: pytest.ini
plugins: cov-3.0.0
collected 83 items                                                                                                                                                                                               

tests/dict_man.py .....................                                                                                                                                                                    [ 25%]
tests/lca.py ...................................................                                                                                                                                           [ 86%]
tests/svdm.py ........                                                                                                                                                                                     [ 96%]
tests/utils.py ...                                                                                                                                                                                         [100%]
...