Skip to content
Open
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
59 changes: 50 additions & 9 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- uses: pre-commit/[email protected]

pyright:
Expand Down Expand Up @@ -148,14 +150,39 @@ jobs:
- name: Check LICENSE.txt in sdist
run: tar -tvf dist/*.tar.gz | grep -q itables_for_dash/async-ITable.js.LICENSE.txt

# Upload the wheel as an artifact
- name: Upload wheel artifact
# Build conda package
- name: Set up Mambaforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
auto-update-conda: true
python-version: 3.11

- name: Install conda-build
run: mamba install conda-build -y

- name: Build conda package
run: |
conda config --set anaconda_upload no
# Not sure how to remove the 'defaults' channel ?
# conda config --set conda-remove-defaults true
# conda config --remove channels defaults
conda build conda.recipe --output-folder conda-dist

# Upload the wheel and conda package as artifacts
- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: itables-wheel
path: dist/*.whl
path: dist/itables-*.whl

- name: Upload conda package
uses: actions/upload-artifact@v4
with:
name: itables-conda-package
path: conda-dist/**/itables-*.conda

# Comment on PR with artifact link (only on PRs)
# Comment on PR with artifact link
- name: Comment with direct artifact link
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
Expand All @@ -173,21 +200,35 @@ jobs:
});

// Find the artifact named 'itables-wheel'
const artifact = artifacts.find(a => a.name === 'itables-wheel');
let artifact_url;
let artifact = artifacts.find(a => a.name === 'itables-wheel');
let wheel_url;
if (artifact) {
wheel_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${run_id}/artifacts/${artifact.id}`;
} else {
wheel_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${run_id}#artifacts`;
}

// Find the artifact named 'itables-conda-package'
artifact = artifacts.find(a => a.name === 'itables-conda-package');
let conda_url;
if (artifact) {
artifact_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${run_id}/artifacts/${artifact.id}`;
conda_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${run_id}/artifacts/${artifact.id}`;
} else {
artifact_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${run_id}#artifacts`;
conda_url = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${run_id}#artifacts`;
}


const body = `${marker}
Thank you for making this pull request.

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).

Also, the version of ITables developed in this PR is available as a wheel artifact :package: for easy installation.
Download it [here](${artifact_url}), unzip it and then run <code>pip install itables-xxx.whl</code> in the unzipped directory.`;
Download it [here](${wheel_url}), unzip it and then run <code>pip install itables-xxx.whl</code> in the unzipped directory.

A conda package is also available for easy installation:
Download it [here](${conda_url}), and then run <code>conda install itables-xxx.tar.bz2</code> in the directory where you downloaded the file.
`;

// List comments on the PR
const { data: comments } = await github.rest.issues.listComments({
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@
# Python
*.egg-info
*.pyc

# Build artifacts
build
dist
conda-dist

# Notebooks
*.ipynb
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ repos:
hooks:
- id: check-json
- id: check-yaml
exclude: ^conda\.recipe/meta\.yaml$
- id: end-of-file-fixer
- id: trailing-whitespace

Expand Down
57 changes: 57 additions & 0 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{% set version_match = load_file_regex(
load_file="src/itables/version.py",
regex_pattern='.*__version__ = "(.+)"') %}
{% set version = version_match[1] %}

package:
name: itables
version: {{ version }}

source:
path: ..

build:
number: 0
noarch: python
script: {{ PYTHON }} -m pip install . -vv

requirements:
host:
- nodejs
- python >=3.9
- python-build
- hatch-jupyter-builder
- dash
- pyyaml
- hatchling
- pip
run:
- ipython
- pandas
- numpy
- packaging
- typing-extensions
- python >=3.9

test:
imports:
- itables
commands:
- pip check
- python -c "import itables; print(itables.__version__)"
requires:
- pip

about:
home: https://github.com/mwouts/itables
dev_url: https://github.com/mwouts/itables
doc_url: https://mwouts.github.io/itables
summary: Pandas and Polars DataFrames as Interactive DataTables
license: MIT
license_file:
- LICENSE
description: |
Render Pandas and Polars DataFrames as interactive [DataTables](https://datatables.net/)
that you can sort, paginate, scroll or filter. ITables works in Jupyter,
VS Code, Google Colab, Quarto, Marimo, and in many application frameworks like
Dash, Panel, Shiny, or Streamlit.
7 changes: 7 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
ITables ChangeLog
=================

2.5.3-dev (unreleased)
------------------

**Added**
- A conda package is built (and attached) to each PR.


2.5.2 (2025-09-02)
------------------

Expand Down
3 changes: 3 additions & 0 deletions src/itables/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""ITables' version number"""

# https://peps.python.org/pep-0440/
# version must comply with [N!]N(.N)*[{a|b|rc}N][.postN][.devN]
# (no hyphens allowed - otherwise the dev conda build will fail)
__version__ = "2.5.2"
Loading