zuzukin / whl2conda

Generate conda package from pure python wheel
https://zuzukin.github.io/whl2conda/
Apache License 2.0
6 stars 2 forks source link

Find pypi packages with built in tests and run them after conversion #34

Closed analog-cbarber closed 1 year ago

analog-cbarber commented 1 year ago

Some projects with test directories in shipped code:

mypy

there are pytests, but it is not clear how to run them from installation

tornado

Has tests that can be run using python -m tornado.test. When I tried this from a conda environment in which tornado was installed, most of the tests worked but there was one failure in test_error_logging.

mkdocs

There is a mkdocs.tests packages containing unittest tests, but they fail when run, so they probably aren't meant to be run this way.

pyaml

There is a pyaml.tests package with a test_dump.py file containing unittest tests. This fails with message about not having unidecode module, so there are probably extra test dependencies.

colorama

Has colorama.tests package with unittest test cases. These pass when run with pytest.

Can run all of the tests by cd'ing to the package directory in site-packages and running either pytest or unittest:

pushd `python -c "import colorama.tests, os; print(os.path.dirname(colorama.tests.__file__))"`
python -m unittest .
pytest .
popd

Using pytest, you can run

pytest --pyargs colorama.tests

colorama doesn't have any dependencies other than python, so this is not an especially interesting case.

beautifulsoup4 (bs4)

Has test suite that can be run using:

pytest --pyargs bs4.tests

pyct

Has test suite that can be run using

pytest --pyargs pyct.tests
analog-cbarber commented 1 year ago

orix

Has a renamed dependencies (quaternion and dask-core) and has a test suite that worked except for one test:

pytest --pyargs orix.tests
...
FAILED plot/test_stereographic_plot.py::TestRestrictToFundamentalSector::test_restrict_to_fundamental_sector - ValueError: operands could not be broadcast together with shapes (137,2) (185,2)

Perhaps we could just skip that one test.

 pytest --pyargs orix.tests -k "not test_restrict_to_fundamental_sector"
analog-cbarber commented 1 year ago

We do this for orix.