Skip to content

Commit a06bb71

Browse files
committed
Build a conda package on PRs
1 parent 2383415 commit a06bb71

File tree

5 files changed

+115
-8
lines changed

5 files changed

+115
-8
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
- uses: actions/checkout@v4
2121
- name: Set up Python
2222
uses: actions/setup-python@v5
23+
with:
24+
python-version: 3.11
2325
- uses: pre-commit/[email protected]
2426

2527
pyright:
@@ -148,14 +150,37 @@ jobs:
148150
- name: Check LICENSE.txt in sdist
149151
run: tar -tvf dist/*.tar.gz | grep -q itables_for_dash/async-ITable.js.LICENSE.txt
150152

151-
# Upload the wheel as an artifact
152-
- name: Upload wheel artifact
153+
# Build conda package
154+
- name: Set up Mambaforge
155+
uses: conda-incubator/setup-miniconda@v3
156+
with:
157+
miniforge-version: latest
158+
auto-update-conda: true
159+
python-version: 3.11
160+
161+
- name: Install conda-build
162+
run: mamba install conda-build -y
163+
164+
- name: Build conda package
165+
run: |
166+
conda config --set anaconda_upload no
167+
conda config --set conda-remove-defaults true
168+
conda build conda.recipe --output-folder conda-dist
169+
170+
# Upload the wheel and conda package as artifacts
171+
- name: Upload wheel
153172
uses: actions/upload-artifact@v4
154173
with:
155174
name: itables-wheel
156175
path: dist/*.whl
157176

158-
# Comment on PR with artifact link (only on PRs)
177+
- name: Upload conda package
178+
uses: actions/upload-artifact@v4
179+
with:
180+
name: itables-conda-package
181+
path: conda-dist/**/*.tar.bz2
182+
183+
# Comment on PR with artifact link
159184
- name: Comment with direct artifact link
160185
if: github.event_name == 'pull_request'
161186
uses: actions/github-script@v7
@@ -173,21 +198,35 @@ jobs:
173198
});
174199
175200
// Find the artifact named 'itables-wheel'
176-
const artifact = artifacts.find(a => a.name === 'itables-wheel');
177-
let artifact_url;
201+
let artifact = artifacts.find(a => a.name === 'itables-wheel');
202+
let wheel_url;
203+
if (artifact) {
204+
wheel_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${run_id}/artifacts/${artifact.id}`;
205+
} else {
206+
wheel_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${run_id}#artifacts`;
207+
}
208+
209+
// Find the artifact named 'itables-conda-package'
210+
artifact = artifacts.find(a => a.name === 'itables-conda-package');
211+
let conda_url;
178212
if (artifact) {
179-
artifact_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${run_id}/artifacts/${artifact.id}`;
213+
conda_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${run_id}/artifacts/${artifact.id}`;
180214
} else {
181-
artifact_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${run_id}#artifacts`;
215+
conda_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${run_id}#artifacts`;
182216
}
183217
218+
184219
const body = `${marker}
185220
Thank you for making this pull request.
186221
187222
Did you know? You can try it on Binder: [![Binder:lab](https://img.shields.io/badge/binder-jupyterlab-0172B2.svg)](https://mybinder.org/v2/gh/${{ github.event.pull_request.head.repo.full_name }}/${{ github.event.pull_request.head.ref }}?urlpath=lab/tree/docs/quick_start.md).
188223
189224
Also, the version of ITables developed in this PR is available as a wheel artifact :package: for easy installation.
190-
Download it [here](${artifact_url}), unzip it and then run <code>pip install itables-xxx.whl</code> in the unzipped directory.`;
225+
Download it [here](${wheel_url}), unzip it and then run <code>pip install itables-xxx.whl</code> in the unzipped directory.
226+
227+
A conda package is also available for easy installation:
228+
Download it [here](${conda_url}), and then run <code>conda install itables-xxx.tar.bz2</code> in the directory where you downloaded the file.
229+
`;
191230
192231
// List comments on the PR
193232
const { data: comments } = await github.rest.issues.listComments({

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55
# Python
66
*.egg-info
77
*.pyc
8+
9+
# Build artifacts
810
build
911
dist
12+
conda-dist
1013

1114
# Notebooks
1215
*.ipynb

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ repos:
99
hooks:
1010
- id: check-json
1111
- id: check-yaml
12+
exclude: ^conda\.recipe/meta\.yaml$
1213
- id: end-of-file-fixer
1314
- id: trailing-whitespace
1415

conda.recipe/meta.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{% set version_match = load_file_regex(
2+
load_file="src/itables/version.py",
3+
regex_pattern='.*__version__ = "(.+)"') %}
4+
{% set version = version_match[1] %}
5+
6+
package:
7+
name: itables
8+
version: {{ version }}
9+
10+
source:
11+
path: ..
12+
13+
build:
14+
number: 0
15+
noarch: python
16+
script: {{ PYTHON }} -m pip install . -vv
17+
18+
requirements:
19+
host:
20+
- nodejs
21+
- python >=3.9
22+
- python-build
23+
- hatch-jupyter-builder
24+
- dash
25+
- pyyaml
26+
- hatchling
27+
- pip
28+
run:
29+
- ipython
30+
- pandas
31+
- numpy
32+
- packaging
33+
- typing-extensions
34+
- python >=3.9
35+
36+
test:
37+
imports:
38+
- itables
39+
commands:
40+
- pip check
41+
- python -c "import itables; print(itables.__version__)"
42+
requires:
43+
- pip
44+
45+
about:
46+
home: https://github.com/mwouts/itables
47+
dev_url: https://github.com/mwouts/itables
48+
doc_url: https://mwouts.github.io/itables
49+
summary: Pandas and Polars DataFrames as Interactive DataTables
50+
license: MIT
51+
license_file:
52+
- LICENSE
53+
description: |
54+
Render Pandas and Polars DataFrames as interactive [DataTables](https://datatables.net/)
55+
that you can sort, paginate, scroll or filter. ITables works in Jupyter,
56+
VS Code, Google Colab, Quarto, Marimo, and in many application frameworks like
57+
Dash, Panel, Shiny, or Streamlit.

docs/changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
ITables ChangeLog
22
=================
33

4+
2.5.3-dev (unreleased)
5+
------------------
6+
7+
**Added**
8+
- A conda package is built (and attached) to each PR.
9+
10+
411
2.5.2 (2025-09-02)
512
------------------
613

0 commit comments

Comments
 (0)