Skip to content

Commit 90e0614

Browse files
committed
Add conda col
1 parent 66a8bb2 commit 90e0614

File tree

10 files changed

+53
-2
lines changed

10 files changed

+53
-2
lines changed

_plugins/ecosystem_status.rb

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def generate(site)
3131
repo_name = software.data['name']
3232
gh_org = software.data['gh_org']
3333
python_package = software.data['python_package']
34+
conda_package = software.data['conda_package']
3435

3536
next unless gh_org && repo_name
3637

@@ -103,11 +104,18 @@ def generate(site)
103104
if python_package
104105
pypi_info = fetch_pypi_info(python_package)
105106
end
107+
108+
# Get conda info if conda package exists
109+
conda_info = nil
110+
if conda_package
111+
conda_info = fetch_conda_info(conda_package)
112+
end
106113

107114
repo_data = {
108115
'repo_name' => repo_name,
109116
'gh_org' => gh_org,
110117
'python_package' => python_package,
118+
'conda_package' => conda_package,
111119
'repo_url' => "https://github.com/#{gh_org}/#{repo_name}",
112120
'latest_release' => latest_release,
113121
'commits_since_release' => commits_since_release,
@@ -116,6 +124,7 @@ def generate(site)
116124
'open_pr_count' => open_prs ? open_prs.length : 0,
117125
'last_merged_pr' => last_merged_pr,
118126
'pypi_info' => pypi_info,
127+
'conda_info' => conda_info,
119128
'updated_at' => Time.now
120129
}
121130

@@ -157,10 +166,10 @@ def fetch_pypi_info(package_name)
157166
uri = URI("https://pypi.org/pypi/#{package_name}/json")
158167
http = Net::HTTP.new(uri.host, uri.port)
159168
http.use_ssl = true
160-
169+
161170
request = Net::HTTP::Get.new(uri)
162171
response = http.request(request)
163-
172+
164173
if response.code == '200'
165174
JSON.parse(response.body)
166175
else
@@ -170,5 +179,23 @@ def fetch_pypi_info(package_name)
170179
puts "Error fetching PyPI info for #{package_name}: #{e.message}"
171180
nil
172181
end
182+
183+
def fetch_conda_info(package_name)
184+
uri = URI("https://api.anaconda.org/package/conda-forge/#{package_name}")
185+
http = Net::HTTP.new(uri.host, uri.port)
186+
http.use_ssl = true
187+
188+
request = Net::HTTP::Get.new(uri)
189+
response = http.request(request)
190+
191+
if response.code == '200'
192+
JSON.parse(response.body)
193+
else
194+
nil
195+
end
196+
rescue => e
197+
puts "Error fetching conda info for #{package_name}: #{e.message}"
198+
nil
199+
end
173200
end
174201
end

_software/fwdpy11.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ gh_org: molpopgen
66
docs_url: https://molpopgen.github.io/fwdpy11
77
category: simulate
88
python_package: fwdpy11
9+
conda_package: fwdpy11
910
priority: 11
1011
code_snippet: |2
1112
pop = fwdpy11.DiploidPopulation(

_software/msprime.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ gh_org: tskit-dev
99
docs_url: https://tskit.dev/msprime/docs/
1010
category: simulate
1111
python_package: msprime
12+
conda_package: msprime
1213
publication: https://doi.org/10.1093/genetics/iyab229
1314
logo: https://raw.githubusercontent.com/tskit-dev/administrative/main/logos/svg/msprime/Tskit_msprime_logo_on_black_no_background.eps.svg
1415
priority: 2

_software/pyslim.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ gh_org: tskit-dev
99
docs_url: https://tskit.dev/pyslim/docs/stable
1010
category: analyse
1111
python_package: pyslim
12+
conda_package: pyslim
1213
priority: 12
1314
code_snippet: |2
1415
rts = pyslim.recapitate(

_software/tsdate.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ docs_url: https://tskit.dev/tsdate/docs/stable/
77
publication: https://doi.org/10.1126/science.abi8264
88
category: infer
99
python_package: tsdate
10+
conda_package: tsdate
1011
logo: https://raw.githubusercontent.com/tskit-dev/administrative/main/logos/svg/tsdate/Tskit_tsdate_logo_on_black_no_background.eps.svg
1112
priority: 4
1213
code_snippet: |2

_software/tsinfer.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ publication: https://doi.org/10.1038/s41588-019-0483-y
88
logo: https://raw.githubusercontent.com/tskit-dev/administrative/main/logos/svg/tsinfer/Tskit_tsinfer_logo_on_black_no_background.eps.svg
99
category: infer
1010
python_package: tsinfer
11+
conda_package: tsinfer
1112
priority: 3
1213
code_snippet: |2
1314
sample_data = tsinfer.load(

_software/tskit.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ gh_org: tskit-dev
66
docs_url: https://tskit.dev/tskit/docs/
77
category: analyse
88
python_package: tskit
9+
conda_package: tskit
910
logo: https://raw.githubusercontent.com/tskit-dev/administrative/main/logos/svg/tskit/Tskit_logo_on_black_no_background.eps.svg
1011
priority: 1
1112
code_snippet: |2

_software/tstrait.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ docs_url: https://tskit.dev/tstrait/docs/
1010
publication: https://doi.org/10.1093/bioinformatics/btae334
1111
category: simulate
1212
python_package: tstrait
13+
conda_package: tstrait
1314
priority: 13
1415
code_snippet: |2
1516
model = tstrait.trait_model(

_software/tszip.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ gh_org: tskit-dev
66
docs_url: https://tskit.dev/tszip/docs/
77
category: analyse
88
python_package: tszip
9+
conda_package: tszip
910
priority: 14
1011
code_snippet: |2
1112
$ tszip 1kg_chr20.trees

ecosystem-status.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<th>Package</th>
1616
<th>Latest Release</th>
1717
<th>PyPI</th>
18+
<th>Conda</th>
1819
<th class="ecosystem-status__header--center">Unreleased Commits</th>
1920
<th class="ecosystem-status__header--center">CI Status</th>
2021
<th class="ecosystem-status__header--center">Open PRs</th>
@@ -73,6 +74,21 @@
7374
<span class="text-muted">N/A</span>
7475
{% endif %}
7576
</td>
77+
78+
<!-- Conda -->
79+
<td>
80+
{% if status.conda_info and software.conda_package %}
81+
<a href="https://anaconda.org/conda-forge/{{ software.conda_package }}" class="text-decoration-none">
82+
<strong>{{ status.conda_info.latest_version }}</strong>
83+
</a>
84+
{% elsif software.conda_package %}
85+
<a href="https://anaconda.org/conda-forge/{{ software.conda_package }}" class="text-muted text-decoration-none">
86+
Conda Error
87+
</a>
88+
{% else %}
89+
<span class="text-muted">N/A</span>
90+
{% endif %}
91+
</td>
7692

7793
<!-- Unreleased Commits -->
7894
<td class="ecosystem-status__cell--center">

0 commit comments

Comments
 (0)