Use hypexport package in demo.py, clean up tox
This commit is contained in:
parent
abbaa47aaf
commit
deefa9fbbc
3 changed files with 11 additions and 14 deletions
14
demo.py
14
demo.py
|
@ -16,9 +16,15 @@ def run():
|
|||
copytree(my_repo, 'my_repo', symlinks=True)
|
||||
|
||||
# 2. prepare repositories you'd be using. For this demo we only set up Hypothesis
|
||||
hypothesis_repo = abspath('hypothesis_repo')
|
||||
check_call(['git', 'clone', 'https://github.com/karlicoss/hypexport.git', hypothesis_repo])
|
||||
#
|
||||
tox = 'TOX' in os.environ
|
||||
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
|
||||
hypothesis_backups = abspath('backups/hypothesis')
|
||||
|
@ -45,7 +51,7 @@ def run():
|
|||
check_call(['python3', '-c', '''
|
||||
import my.hypothesis
|
||||
|
||||
pages = my.hypothesis.get_pages()
|
||||
pages = my.hypothesis.pages()
|
||||
|
||||
from itertools import islice
|
||||
for page in islice(pages, 0, 8):
|
||||
|
|
|
@ -137,10 +137,6 @@ for cls, p in modules:
|
|||
|
||||
# paths[s]/glob to the exported JSON data
|
||||
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
|
||||
** [[file:../my/reddit.py][my.reddit]]
|
||||
|
||||
|
|
7
tox.ini
7
tox.ini
|
@ -5,7 +5,7 @@ envlist = py3,mypy # pylint
|
|||
# TODO ugh. unclear how to reuse setup.cfg deps in tox
|
||||
[testenv]
|
||||
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
|
||||
commands =
|
||||
pip install -e .[testing]
|
||||
|
@ -21,11 +21,6 @@ commands =
|
|||
|
||||
|
||||
[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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue