Skip to content

Commit

Permalink
Merge pull request #108 from winter-telescope/updatestarterpack
Browse files Browse the repository at this point in the history
Automatically pull latest test data then select correct tag
  • Loading branch information
robertdstein authored Aug 30, 2022
2 parents b93f187 + a072a4e commit ed0c5f7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions winterdrp/downloader/get_test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
os.path.basename(TEST_DATA_URL.replace(".git", ""))
)

TEST_DATA_TAG = "v0.1.0"


def get_test_data_dir() -> str:

Expand All @@ -27,6 +29,22 @@ def get_test_data_dir() -> str:

os.system(cmd)

else:
cmds = [
f"git -C {test_data_dir} checkout main",
f"git -C {test_data_dir} pull"
]

for cmd in cmds:
logger.info(f"Trying to update test data. Executing: {cmd}")
os.system(cmd)

fix_version_cmd = f"git -C {test_data_dir} checkout -d tags/{TEST_DATA_TAG}"

logger.info(f"Checkout out correct test data commit. Executing: {fix_version_cmd}")

os.system(fix_version_cmd)

return test_data_dir


Expand Down

0 comments on commit ed0c5f7

Please sign in to comment.