-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add code to parse conda channels (not enabled) (#518)
- Loading branch information
Showing
3 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ | |
'buckaroo', | ||
'centos', | ||
'chocolatey', | ||
'conda', | ||
'cpan', | ||
'cran', | ||
'crates_io', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright (C) 2018 Dmitry Marakasov <[email protected]> | ||
# | ||
# This file is part of repology | ||
# | ||
# repology is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# repology is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with repology. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import json | ||
|
||
from repology.parsers import Parser | ||
|
||
|
||
class CondaRepodataJsonParser(Parser): | ||
def iter_parse(self, path, factory): | ||
with open(path, 'r', encoding='utf-8') as jsonfile: | ||
for pkgfilename, pkgdata in json.load(jsonfile)['packages'].items(): | ||
pkg = factory.begin(pkgfilename) | ||
|
||
pkg.set_name(pkgdata['name']) | ||
pkg.set_version(pkgdata['version']) | ||
pkg.add_licenses(pkgdata.get('license', '')) | ||
|
||
yield pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
########################################################################### | ||
# Conda | ||
########################################################################### | ||
- name: conda_forge | ||
type: repository | ||
desc: conda-forge | ||
family: conda | ||
minpackages: 1 | ||
sources: | ||
- name: [noarch, linux-32, linux-64, osx-64, win-32, win-64] | ||
fetcher: FileFetcher | ||
parser: CondaRepodataJsonParser | ||
url: 'https://conda.anaconda.org/conda-forge/{source}/repodata.json' | ||
subrepo: '{source}' | ||
repolinks: | ||
- desc: conda-forge home | ||
url: https://conda-forge.org/ | ||
tags: [ all, experimental, conda ] | ||
|
||
- name: bioconda | ||
type: repository | ||
desc: Bioconda | ||
family: conda | ||
minpackages: 1 | ||
sources: | ||
- name: [noarch, linux-32, linux-64, osx-32, osx-64, win-32, win-64] | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
AMDmi3
Author
Member
|
||
fetcher: FileFetcher | ||
parser: CondaRepodataJsonParser | ||
url: 'https://conda.anaconda.org/bioconda/{source}/repodata.json' | ||
subrepo: '{source}' | ||
repolinks: | ||
- desc: Bioconda home | ||
url: https://bioconda.github.io/ | ||
tags: [ all, experimental, conda ] |
Bioconda has only
noarch
,linux-64
andosx-64
. It's rather unlikely that windows or 32 bit will ever be added.