dodo.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # define tasks for Andrew Cement data repository
  2. from doit import get_var
  3. # create virtual environment
  4. def task_setup_venv():
  5. """Create virtual environment"""
  6. return {
  7. 'file_dep': ['requirements_dev.txt', 'setup.cfg', 'pyproject.toml'],
  8. 'actions': ['python3 -m venv venv',
  9. './venv/bin/pip install --upgrade pip wheel',
  10. './venv/bin/pip install --upgrade --upgrade-strategy '
  11. 'eager -e .[dev]',
  12. 'touch venv',],
  13. 'targets': ['venv'],
  14. 'verbosity': 2,
  15. }
  16. read_config = {
  17. "version": get_var('version', None),
  18. }
  19. def task_read_version():
  20. """ Read specific version of the data"""
  21. return {
  22. 'actions': [f"./venv/bin/python src/read_version_datalad.py "
  23. f"--version={read_config['version']}"],
  24. 'verbosity': 2,
  25. 'setup': ['setup_venv'],
  26. }
  27. def task_download_version():
  28. """ Download specific version of the data"""
  29. return {
  30. 'actions': [f"./venv/bin/python src/download_version_datalad.py "
  31. f"--version={read_config['version']}"],
  32. 'verbosity': 2,
  33. 'setup': ['setup_venv'],
  34. }