Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .conda format support #61

Merged
merged 2 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
test:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

strategy:
matrix:
Expand Down
5 changes: 3 additions & 2 deletions conda_mirror/conda_mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,7 @@ def get_repodata(channel, platform, proxies=None, ssl_verify=None):
resp = requests.get(url, proxies=proxies, verify=ssl_verify).json()
info = resp.get("info", {})
packages = resp.get("packages", {})
packages.update(resp.get("packages.conda", {}))
# Patch the repodata.json so that all package info dicts contain a "subdir"
# key. Apparently some channels on anaconda.org do not contain the
# 'subdir' field. I think this this might be relegated to the
Expand Down Expand Up @@ -747,7 +748,7 @@ def _download_backoff_retry(


def _list_conda_packages(local_dir):
"""List the conda packages (*.tar.bz2 files) in `local_dir`
"""List the conda packages (tar.bz2 or conda files) in `local_dir`

Parameters
----------
Expand All @@ -760,7 +761,7 @@ def _list_conda_packages(local_dir):
List of conda packages in `local_dir`
"""
contents = os.listdir(local_dir)
return fnmatch.filter(contents, "*.tar.bz2")
return [fn for fn in contents if fn.endswith(".tar.bz2") or fn.endswith(".conda")]


def _validate_packages(package_repodata, package_directory, num_threads=1):
Expand Down