Add demo on CI
This commit is contained in:
parent
328b75bef3
commit
0f72233f61
2 changed files with 17 additions and 7 deletions
|
@ -11,9 +11,11 @@ jobs:
|
|||
# TODO FIXME switch to tox?
|
||||
- run: pip3 install --user mypy pylint
|
||||
|
||||
# TODO how to make it compatible
|
||||
- run: python3 -m mypy --namespace-packages my
|
||||
- run: python3 -m pylint -E my
|
||||
- run: ./demo.py
|
||||
|
||||
# - run: python3 -m mypy --namespace-packages my
|
||||
# - run: python3 -m pylint -E my
|
||||
|
||||
# TODO need to keep full my_configuration.py as example? to dummy run CI
|
||||
|
||||
|
||||
|
|
16
demo.py
16
demo.py
|
@ -33,19 +33,27 @@ def run():
|
|||
with_my = 'my_repo/with_my'
|
||||
copy('my_repo/with_my.example', with_my)
|
||||
|
||||
private_config = os.path.abspath('my_configuration.py')
|
||||
Path(private_config).write_text("""
|
||||
private_config = Path('my_configuration').absolute()
|
||||
private_config.mkdir()
|
||||
|
||||
my_configuration = private_config / 'my_configuration'
|
||||
my_configuration.mkdir()
|
||||
|
||||
repos = my_configuration / 'repos'
|
||||
repos.mkdir()
|
||||
(repos / 'hypexport').symlink_to(hypothesis_repo)
|
||||
|
||||
Path(my_configuration / '__init__.py').write_text("""
|
||||
|
||||
class paths:
|
||||
class hypexport:
|
||||
repo = '{hypothesis_repo}'
|
||||
export_dir = '{hypothesis_backups}'
|
||||
|
||||
""".format(**locals()))
|
||||
#
|
||||
|
||||
# edit the config and set path to private configuration
|
||||
my = Path(with_my).read_text().replace('MY_CONFIGURATION_PATH=', 'MY_CONFIGURATION_PATH=' + private_config)
|
||||
my = Path(with_my).read_text().replace('MY_CONFIGURATION_DIR=', 'MY_CONFIGURATION_DIR=' + str(private_config))
|
||||
Path(with_my).write_text(my)
|
||||
#
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue