Skip to content

Commit

Permalink
Change specs in env file
Browse files Browse the repository at this point in the history
  • Loading branch information
Hind-M committed Jan 9, 2025
1 parent 6e9d143 commit f6f5c94
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 29 deletions.
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
- shell: bash -l {0}
id: fetch-release
run: |
python -m pip install packaging
python fetch_release.py ${{ github.event.inputs.version }}
- name: Release
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_fetch_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
create-args: pytest
- name: Add micromamba to GITHUB_PATH
run: echo "${HOME}/micromamba-bin" >> "$GITHUB_PATH"

- shell: bash -l {0}
id: fetch-release
run: |
python -m pip install packaging pytest
python -m pytest tests/test_fetch_release.py -v --exitfirst
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: fetch-release-env
channels:
- conda-forge
dependencies:
- packaging
- python
- requests
- rich
28 changes: 1 addition & 27 deletions tests/test_fetch_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_get_all_tags_github(retry_config):
pytest.fail("Failed to fetch GitHub tags after multiple retries.")


@pytest.mark.parametrize("version", ("latest", "2.0.5", "2.0.5.rc0", "2.0.4alpha1"))#, "1.5.10"))
@pytest.mark.parametrize("version", ("latest", "2.0.5", "1.5.9", "2.0.5.rc0", "2.0.4alpha1"))
@pytest.mark.parametrize("use_default_version", (False, True))
def test_get_micromamba_existing_version(retry_config, version, use_default_version):
"""
Expand All @@ -82,32 +82,6 @@ def test_get_micromamba_existing_version(retry_config, version, use_default_vers

pytest.fail(f"Failed to fetch micromamba release info after multiple retries.")

#@pytest.mark.parametrize("version", ("1.5.10"))
@pytest.mark.parametrize("use_default_version", (False, True))
def test_get_micromamba_existing_1_x(retry_config, use_default_version):
"""
Test fetching existing micromamba dev or prerelease version.
"""
max_retries = retry_config['max_retries']
retry_delay = retry_config['retry_delay']

for _ in range(max_retries):
try:
version = "1.5.9";
get_micromamba(version, use_default_version)
assert get_output_value("MICROMAMBA_NEW_VERSION") == "false"
assert get_output_value("MICROMAMBA_NEW_PRERELEASE") == None
assert get_output_value("MICROMAMBA_LATEST") == None
assert get_output_value("MICROMAMBA_VERSION") == None
print(f"Fetched micromamba release {version} successfully.")
return
except requests.exceptions.RequestException as e:
print(f"Error fetching micromamba release, retrying... {e}")
time.sleep(retry_delay)

pytest.fail(f"Failed to fetch micromamba release info after multiple retries.")


@pytest.mark.parametrize("use_default_version", (False, True))
def test_get_micromamba_non_existing_version(use_default_version):
"""
Expand Down

0 comments on commit f6f5c94

Please sign in to comment.