Use hypexport package in demo.py, clean up tox

This commit is contained in:
Dima Gerasimov 2020-09-28 18:54:51 +02:00 committed by karlicoss
parent abbaa47aaf
commit deefa9fbbc
3 changed files with 11 additions and 14 deletions

14
demo.py
View file

@ -16,9 +16,15 @@ def run():
copytree(my_repo, 'my_repo', symlinks=True) copytree(my_repo, 'my_repo', symlinks=True)
# 2. prepare repositories you'd be using. For this demo we only set up Hypothesis # 2. prepare repositories you'd be using. For this demo we only set up Hypothesis
hypothesis_repo = abspath('hypothesis_repo') tox = 'TOX' in os.environ
check_call(['git', 'clone', 'https://github.com/karlicoss/hypexport.git', hypothesis_repo]) if tox: # tox doesn't like --user flag
# check_call('pip3 install git+https://github.com/karlicoss/hypexport.git'.split())
else:
try:
import hypexport
except ModuleNotFoundError:
check_call('pip3 install --user git+https://github.com/karlicoss/hypexport.git'.split())
# 3. prepare some demo Hypothesis data # 3. prepare some demo Hypothesis data
hypothesis_backups = abspath('backups/hypothesis') hypothesis_backups = abspath('backups/hypothesis')
@ -45,7 +51,7 @@ def run():
check_call(['python3', '-c', ''' check_call(['python3', '-c', '''
import my.hypothesis import my.hypothesis
pages = my.hypothesis.get_pages() pages = my.hypothesis.pages()
from itertools import islice from itertools import islice
for page in islice(pages, 0, 8): for page in islice(pages, 0, 8):

View file

@ -137,10 +137,6 @@ for cls, p in modules:
# paths[s]/glob to the exported JSON data # paths[s]/glob to the exported JSON data
export_path: Paths export_path: Paths
# path to a local clone of hypexport
# alternatively, you can put the repository (or a symlink) in $MY_CONFIG/my/config/repos/hypexport
hypexport : Optional[PathIsh] = None
#+end_src #+end_src
** [[file:../my/reddit.py][my.reddit]] ** [[file:../my/reddit.py][my.reddit]]

View file

@ -5,7 +5,7 @@ envlist = py3,mypy # pylint
# TODO ugh. unclear how to reuse setup.cfg deps in tox # TODO ugh. unclear how to reuse setup.cfg deps in tox
[testenv] [testenv]
passenv = CI CI_* passenv = CI CI_*
# deliberately set to nonexistent pathe to check the fallback logic # deliberately set to nonexistent path to check the fallback logic
setenv = MY_CONFIG = nonexistent setenv = MY_CONFIG = nonexistent
commands = commands =
pip install -e .[testing] pip install -e .[testing]
@ -21,11 +21,6 @@ commands =
[testenv:demo] [testenv:demo]
# TODO wtf????
changedir = {toxworkdir}/{envname}/../..
# TODO not sure?? also reuse installed my. instead on installing in demo.py?
skip_install = true
# TODO need to keep full config as example? to dummy run CI
commands = ./demo.py commands = ./demo.py