-
Notifications
You must be signed in to change notification settings - Fork 5
/
tox.ini
75 lines (70 loc) · 2.37 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
#
# Note, you can also install detox ("pip install detox") to execute tox in
# parallel.
[build-system]
requires = [ "setuptools == 40.6.3", "wheel == 0.32.3"]
[tox]
isolated_build = True
envlist =
py38
py39
py310
py311
py312
check-wheel-contents
ruff
[testenv]
deps =
pylint==2.15.8
setuptools>=38.6.0
whitelist_externals =
/usr/bin/bash
/usr/bin/echo
setenv =
TOX_INI_DIR = {toxinidir}
commands =
# super simple test time.
# pylint
bash -c "echo $(find . ! -name 'emoji_fzf_emojilib.py' ! -path './.*' ! -path './build/*' -name '*.py')"
bash -c "pylint $(find . ! -name 'emoji_fzf_emojilib.py' ! -path './.*' ! -path './build/*' -name '*.py')"
# confirm we can build the wheel with no errors. use env-specific working dir
# so we don't ruin things for our friends
python setup.py bdist_wheel --bdist-dir {envdir}/bdist --dist-dir {envdir}/dist
# test installation
bash -c "pip install {envdir}/dist/*.whl"
# very basic runtime checks
emoji-fzf --help
emoji-fzf --version
bash -c "emoji-fzf preview > /dev/null"
bash -c "emoji-fzf preview --prepend > /dev/null"
bash -c "emoji-fzf preview | grep -q '^thumbs_up'"
bash -c "emoji-fzf preview --prepend | grep -q '^👍 thumbs_up'"
bash -c "emoji-fzf --custom-aliases test-custom-aliases.json preview | grep -q 'random-custom-test-alias'"
# --skip-multichar should return less lines
bash -c 'test "$(emoji-fzf preview --skip-multichar | wc -l)" -lt "$(emoji-fzf preview | wc -l)"'
emoji-fzf get
emoji-fzf get blahblahgargbagenogood
emoji-fzf get dragon
emoji-fzf get dragon bus
emoji-fzf get --name dragon
emoji-fzf get --name dragon bus
echo "dragon" | emoji-fzf get
echo "dragon bus" | emoji-fzf get shower
# sanity checks on the wheel
[testenv:check-wheel-contents]
deps=
check-wheel-contents==0.3.1
basepython=python3
commands=
python setup.py bdist_wheel --bdist-dir {envdir}/bdist --dist-dir {envdir}/dist
bash -c "check-wheel-contents {envdir}/dist/*.whl"
[testenv:ruff]
deps=
ruff==0.1.3
basepython=python3
commands=
ruff check setup.py emoji_fzf/