core/ci: fix windows-specific issues

- use portable separators
- paths should be prepended with r' (so backwards slash isn't treated as escaping)
- sqlite connections should be closed (otherwise windows fails to remove the underlying db file)
- workaround for emojis via PYTHONUTF8=1 test for now
- make ZipPath portable
- properly use tox python environment everywhere

  this was causing issues on Windows
  e.g.
      WARNING: test command found but not installed in testenv
        cmd: C:\hostedtoolcache\windows\Python\3.9.12\x64\python3.EXE
This commit is contained in:
Dima Gerasimov 2022-05-02 18:26:22 +01:00 committed by karlicoss
parent 637982a5ba
commit 64a4782f0e
11 changed files with 67 additions and 37 deletions

16
tox.ini
View file

@ -12,7 +12,7 @@ passenv = CI CI_*
[testenv:tests-core]
commands =
pip install -e .[testing]
python3 -m pytest \
{envpython} -m pytest \
tests/core.py \
tests/sqlite.py \
tests/get_files.py \
@ -29,7 +29,7 @@ commands =
# installed to test my.core.serialize while using simplejson and not orjson
pip install simplejson
python3 -m pytest \
{envpython} -m pytest \
tests/serialize_simplejson.py \
{posargs}
@ -52,28 +52,28 @@ commands =
hpi module install my.reddit.rexport
python3 -m pytest tests \
{envpython} -m pytest tests \
# ignore some tests which might take a while to run on ci..
--ignore tests/takeout.py \
--ignore tests/extra/polar.py \
# dont run simplejson compatibility test since orjson is now installed
--ignore tests/serialize_simplejson.py
--ignore tests/serialize_simplejson.py \
{posargs}
[testenv:demo]
commands =
pip install git+https://github.com/karlicoss/hypexport
./demo.py
{envpython} ./demo.py
[testenv:mypy-core]
whitelist_externals = cat
allowlist_externals = cat
commands =
pip install -e .[testing,optional]
pip install orgparse # used it core.orgmode?
# todo add tests?
python3 -m mypy --install-types --non-interactive \
{envpython} -m mypy --install-types --non-interactive \
-p my.core \
--txt-report .coverage.mypy-core \
--html-report .coverage.mypy-core \
@ -109,7 +109,7 @@ commands =
# todo fuck. -p my.github isn't checking the subpackages?? wtf...
# guess it wants .pyi file??
python3 -m mypy --install-types --non-interactive \
{envpython} -m mypy --install-types --non-interactive \
-p my.browser \
-p my.endomondo \
-p my.github.ghexport \