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

Switch to Pixi for development / CI and hatchling for build system #6182

Merged
merged 94 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from 93 commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
79b3794
Move deps to pyproject.toml
hoxbro Apr 10, 2024
2ec0c05
Update other setup.py stuff
hoxbro Apr 10, 2024
a7933b2
Try to move stuff to pixi
hoxbro Apr 10, 2024
d760350
Try updating the ci test file
hoxbro Apr 10, 2024
ce6037b
Small changes
hoxbro Apr 10, 2024
726ed7e
Remove setup.py
hoxbro Apr 10, 2024
0062cb1
Add global tasks
hoxbro Apr 10, 2024
6a52141
Add environment
hoxbro Apr 10, 2024
e15620e
Add ui and core tests
hoxbro Apr 10, 2024
93cec10
Updates
hoxbro Apr 10, 2024
6917525
Remove setup.cfg
hoxbro Apr 10, 2024
c5b93ce
Rename python-version to environment
hoxbro Apr 11, 2024
a5b2172
Add PIXI_ENVIRONMENT_NAME and install-ui
hoxbro Apr 11, 2024
d179b11
Update environments
hoxbro Apr 11, 2024
da8b2c0
Revert PIXI_ENVIRONMENT_NAME
hoxbro Apr 11, 2024
f492143
Clean up
hoxbro Apr 11, 2024
fc62bd5
Add pixi.lock step
hoxbro Apr 11, 2024
aba4511
examples -> example
hoxbro Apr 11, 2024
bb0eeb0
Disable dask_expr for now
hoxbro Apr 11, 2024
cfee98e
Update UI tests to work with osx-arm64
hoxbro Apr 11, 2024
46a9a9a
Use depends on for test-ui
hoxbro Apr 11, 2024
40dd844
Add cache to pixi.lock file
hoxbro Apr 11, 2024
7e6a1a3
Init .git for pyproject cache
hoxbro Apr 11, 2024
7e4e437
Clean up
hoxbro Apr 11, 2024
87558f5
Check test cache
hoxbro Apr 11, 2024
ebbc113
Clean up again
hoxbro Apr 11, 2024
c32f63d
Debug code
hoxbro Apr 11, 2024
9e5a759
Debug 2
hoxbro Apr 11, 2024
d4a214b
Debug 3
hoxbro Apr 11, 2024
934ff5e
Debug 4
hoxbro Apr 11, 2024
bd4ce48
Clean up
hoxbro Apr 11, 2024
4c2d194
Update key
hoxbro Apr 11, 2024
ea8fa82
Update checkout
hoxbro Apr 11, 2024
cb418b3
Switch to pixi.toml
hoxbro Apr 11, 2024
931aa01
Clean up
hoxbro Apr 11, 2024
94eb02d
Try without cache
hoxbro Apr 11, 2024
ed4d4ab
Remove editable
hoxbro Apr 11, 2024
dd2ca40
Add version file to .gitignore
hoxbro Apr 11, 2024
956bc95
Reduce collection of test
hoxbro Apr 11, 2024
1daccd3
Formatting
hoxbro Apr 11, 2024
93b7486
Move to install task
hoxbro Apr 11, 2024
59c7693
Add back pyproject.toml
hoxbro Apr 11, 2024
5028622
Add pixi_install composite
hoxbro Apr 11, 2024
6333061
Try docs
hoxbro Apr 11, 2024
ff09ac9
Add pixi lock step
hoxbro Apr 11, 2024
b6bf7c1
Move download-data step to install task
hoxbro Apr 11, 2024
03c963c
Make download data a python file
hoxbro Apr 12, 2024
d385355
Update conda build
hoxbro Apr 12, 2024
4b3b881
Update build workflow
hoxbro Apr 12, 2024
f0acd4a
Fix script path
hoxbro Apr 12, 2024
e9c99b1
Add nightly lock workflow
hoxbro Apr 12, 2024
6ddcfb5
Don't download data
hoxbro Apr 12, 2024
5bd1177
Add pixi env path
hoxbro Apr 12, 2024
322cd21
Update test.yaml and try macos ARm64 build
hoxbro Apr 12, 2024
b347129
Remove files
hoxbro Apr 12, 2024
9a56b12
More descriptive task name
hoxbro Apr 12, 2024
8b93da3
Only run on macOS-arm64
hoxbro Apr 12, 2024
52d82a4
Fix extra docs
hoxbro Apr 12, 2024
d104fd7
Switch to hatchling and remove manifest.in
hoxbro Apr 12, 2024
a51e993
Add entry-points
hoxbro Apr 12, 2024
401758a
Add build_script
hoxbro Apr 12, 2024
7205333
Update build to match with previous implementation
hoxbro Apr 13, 2024
df15a75
Add version boilerplate
hoxbro Apr 13, 2024
629ae8b
Simplify build-conda
hoxbro Apr 13, 2024
20175e5
Also build sdist for conda packages
hoxbro Apr 13, 2024
38902ee
Rename NAME to PACKAGE
hoxbro Apr 13, 2024
ac88724
Small fixes, looking at Github diff view
hoxbro Apr 13, 2024
2736057
Rename to project.scripts
hoxbro Apr 13, 2024
a22a51c
Rename test-309 to test-39
hoxbro Apr 13, 2024
821fd40
Small changes
hoxbro Apr 13, 2024
fc43b6c
Add tsdownsample to unix systems
hoxbro Apr 15, 2024
bc6870f
Add comment to conda build script
hoxbro Apr 15, 2024
e9f5974
Move to github action for codecov
hoxbro Apr 15, 2024
a429d3c
Remove pypi-dependecies (for now)
hoxbro Apr 15, 2024
ab8e6ea
Update .github/workflows/test.yaml
hoxbro Apr 15, 2024
c4f04c1
Merge branch 'main' into pixi_play
hoxbro Apr 15, 2024
f8c84c0
Make install editable
hoxbro Apr 16, 2024
a879fc6
Merge branch 'main' into pixi_play
hoxbro Apr 16, 2024
ea77fe4
Add xyzservices
hoxbro Apr 16, 2024
37ccc9b
Adding coverage to examples
hoxbro Apr 18, 2024
3a7a6ac
Remove hatchling setupscript
hoxbro Apr 18, 2024
308eb51
Ignore __version.py file from coverage
hoxbro Apr 18, 2024
5a2145c
Add lint environment
hoxbro Apr 18, 2024
d2891e8
Remove test-unit for the test-ui environment
hoxbro Apr 18, 2024
fb90b42
Add developer guide
hoxbro Apr 18, 2024
f4a18e4
Remove environment variables as they are directly in the action
hoxbro Apr 18, 2024
f92a285
Exclude lines from covarage
hoxbro Apr 18, 2024
ad08c33
Remove coverage from examples as it significantly slows down the run
hoxbro Apr 18, 2024
8c74dfe
Update developer guide
hoxbro Apr 18, 2024
7184033
Add to index.rst
hoxbro Apr 18, 2024
788cf02
Update extend-ignore
hoxbro Apr 18, 2024
ab113a6
Docs update
hoxbro Apr 18, 2024
9867caf
Update documentation dev guide
hoxbro Apr 18, 2024
8bd7937
Disable dask-expr for docs build
hoxbro Apr 18, 2024
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
44 changes: 17 additions & 27 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ defaults:
shell: bash -el {0}

env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
PYTHON_VERSION: "3.11"
PACKAGE: "holoviews"

Expand All @@ -30,31 +29,28 @@ jobs:
steps:
- run: echo "All builds have finished, have been approved, and ready to publish"

pixi_lock:
name: Pixi lock
runs-on: ubuntu-latest
steps:
- uses: holoviz-dev/holoviz_tasks/pixi_lock@pixi

conda_build:
name: Build Conda
needs: [pixi_lock]
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
with:
fetch-depth: "100"
- name: Fetch unshallow
run: git fetch --prune --tags --unshallow -f
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
- name: conda setup
run: |
# pyct is for running setup.py
conda install -y conda-build build pyct -c pyviz/label/dev
environments: "build"
download-data: false
- name: conda build
run: |
source ./scripts/build_conda.sh
echo "CONDA_FILE="$CONDA_PREFIX/conda-bld/noarch/$PACKAGE-$VERSION-py_0.tar.bz2"" >> $GITHUB_ENV
run: pixi run -e build build-conda
- uses: actions/upload-artifact@v4
if: always()
with:
name: conda
path: ${{ env.CONDA_FILE }}
path: dist/*tar.bz2
if-no-files-found: error

conda_publish:
Expand Down Expand Up @@ -88,21 +84,15 @@ jobs:

pip_build:
name: Build PyPI
needs: [pixi_lock]
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "100"
- name: Fetch unshallow
run: git fetch --prune --tags --unshallow -f
- uses: actions/setup-python@v5
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install build
run: |
python -m pip install build
environments: "build"
download-data: false
- name: Build package
run: python -m build .
run: pixi run -e build build-pip
- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down
35 changes: 11 additions & 24 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,15 @@ on:
- cron: "0 14 * * SUN"

jobs:
pixi_lock:
name: Pixi lock
runs-on: ubuntu-latest
steps:
- uses: holoviz-dev/holoviz_tasks/pixi_lock@pixi

build_docs:
name: Documentation
needs: [pixi_lock]
runs-on: "ubuntu-latest"
timeout-minutes: 120
defaults:
Expand All @@ -40,34 +47,14 @@ jobs:
PANEL_EMBED_JSON: "true"
PANEL_EMBED_JSON_PREFIX: "json"
steps:
- uses: holoviz-dev/holoviz_tasks/install@v0
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
with:
name: Documentation
python-version: "3.10"
channel-priority: flexible
channels: pyviz/label/dev,conda-forge,nodefaults
envs: "-o doc"
cache: true
conda-update: true
environments: docs
- name: Set output
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Download data
run: |
conda activate test-environment
bash scripts/download_data.sh
- name: generate rst
run: |
conda activate test-environment
nbsite generate-rst --org holoviz --project-name holoviews
- name: refmanual
run: |
conda activate test-environment
python ./doc/generate_modules.py holoviews -d ./doc/reference_manual -n holoviews -e tests
- name: build docs
run: |
conda activate test-environment
nbsite build --what=html --output=builtdocs --org holoviz --project-name holoviews
- name: Build documentation
run: pixi run -e docs docs-build
- name: upload dev
if: |
(github.event_name == 'workflow_dispatch' && github.event.inputs.target == 'dev') ||
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/nightly_lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: nightly_lock
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

jobs:
pixi_lock:
name: Pixi lock
runs-on: ubuntu-latest
steps:
- uses: holoviz-dev/holoviz_tasks/pixi_lock@pixi

# TODO: Upload the lock-file
139 changes: 45 additions & 94 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,10 @@ defaults:
shell: bash -el {0}

env:
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
DISPLAY: ":99.0"
PYTHONIOENCODING: "utf-8"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OMP_NUM_THREADS: 1
OPENBLAS_NUM_THREADS: 1
MKL_NUM_THREADS: 1
VECLIB_MAXIMUM_THREADS: 1
NUMEXPR_NUM_THREADS: 1
NUMBA_NUM_THREADS: 1
PYDEVD_DISABLE_FILE_VALIDATION: 1
Comment on lines -40 to -46
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have moved those to the install task.

DASK_DATAFRAME__QUERY_PLANNING: false

jobs:
pre_commit:
Expand All @@ -61,7 +54,7 @@ jobs:
code_change: ${{ steps.filter.outputs.code }}
matrix: ${{ env.MATRIX }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: github.event_name != 'pull_request'
- name: Check for code changes
uses: dorny/paths-filter@v3
Expand All @@ -71,7 +64,7 @@ jobs:
code:
- 'holoviews/**'
- 'examples/**'
- 'setup.py'
- 'pixi.toml'
- 'pyproject.toml'
- '.github/workflows/test.yaml'
- name: Set matrix option
Expand All @@ -90,153 +83,111 @@ jobs:
if: env.MATRIX_OPTION == 'default'
run: |
MATRIX=$(jq -nsc '{
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
"python-version": ["3.9", "3.12"]
"os": ["ubuntu-latest", "macos-14", "windows-latest"],
Copy link
Member Author

@hoxbro hoxbro Apr 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed to using Mac-arm64 as this is both faster and the newer architecture.

"environment": ["test-39", "test-312"]
}')
echo "MATRIX=$MATRIX" >> $GITHUB_ENV
- name: Set test matrix with 'full' option
if: env.MATRIX_OPTION == 'full'
run: |
MATRIX=$(jq -nsc '{
"os": ["ubuntu-latest", "macos-latest", "windows-latest"],
"python-version": ["3.9", "3.10", "3.11", "3.12"]
"os": ["ubuntu-latest", "macos-14", "windows-latest"],
"environment": ["test-39", "test-310", "test311", "test312"]
}')
echo "MATRIX=$MATRIX" >> $GITHUB_ENV
- name: Set test matrix with 'downstream' option
if: env.MATRIX_OPTION == 'downstream'
run: |
MATRIX=$(jq -nsc '{
"os": ["ubuntu-latest"],
"python-version": ["3.11"]
"environment": ["test-311"]
}')
echo "MATRIX=$MATRIX" >> $GITHUB_ENV

pixi_lock:
name: Pixi lock
runs-on: ubuntu-latest
steps:
- uses: holoviz-dev/holoviz_tasks/pixi_lock@pixi
with:
cache: ${{ github.event.inputs.cache == 'true' || github.event.inputs.cache == '' }}

unit_test_suite:
name: Unit tests on Python ${{ matrix.python-version }}, ${{ matrix.os }}
needs: [pre_commit, setup]
name: unit:${{ matrix.environment }}:${{ matrix.os }}
needs: [pre_commit, setup, pixi_lock]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup.outputs.matrix) }}
timeout-minutes: 120
env:
DESC: "Python ${{ matrix.python-version }}, ${{ matrix.os }} unit tests"
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- uses: holoviz-dev/holoviz_tasks/install@v0
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
if: needs.setup.outputs.code_change == 'true'
with:
name: unit_test_suite
python-version: ${{ matrix.python-version }}
channel-priority: flexible
channels: pyviz/label/dev,conda-forge,nodefaults
envs: "-o flakes -o tests -o examples_tests -o tests_ci"
cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }}
conda-update: true
id: install
environments: ${{ matrix.environment }}
- name: Check packages latest version
if: needs.setup.outputs.code_change == 'true'
run: |
conda activate test-environment
python scripts/check_latest_packages.py bokeh panel param datashader
- name: Download data
if: needs.setup.outputs.code_change == 'true'
run: |
conda activate test-environment
bash scripts/download_data.sh
- name: doit test_unit
pixi run -e ${{ matrix.environment }} check-latest-packages bokeh panel param datashader
- name: Test Unit
if: needs.setup.outputs.code_change == 'true'
run: |
conda activate test-environment
doit test_unit
- name: test examples
pixi run -e ${{ matrix.environment }} test-unit --cov=./holoviews --cov-report=xml
- name: Test Examples
if: needs.setup.outputs.code_change == 'true'
run: |
conda activate test-environment
doit test_examples
- name: codecov
pixi run -e ${{ matrix.environment }} test-example
- uses: codecov/codecov-action@v4
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not strictly related to the Pixi, but I noticed that it was failing. So I updated it to use the official workflow.

if: needs.setup.outputs.code_change == 'true'
run: |
conda activate test-environment
codecov
with:
token: ${{ secrets.CODECOV_TOKEN }}

ui_test_suite:
name: UI tests on Python ${{ matrix.python-version }}, ${{ matrix.os }}
needs: [pre_commit, setup]
name: ui:${{ matrix.environment }}:${{ matrix.os }}
needs: [pre_commit, setup, pixi_lock]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9"]
environment: ["test-ui"]
timeout-minutes: 60
env:
DESC: "Python ${{ matrix.python-version }}, ${{ matrix.os }} UI tests"
PANEL_LOG_LEVEL: info
# Without this env var `doit env_create ...` uses by default
# the `pyviz` channel, except that we don't want to configure
# it as one of the sources.
PYCTDEV_SELF_CHANNEL: "pyviz/label/dev"
steps:
- uses: holoviz-dev/holoviz_tasks/install@v0
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
if: needs.setup.outputs.code_change == 'true'
with:
name: ui_test_suite
python-version: ${{ matrix.python-version }}
channels: pyviz/label/dev,conda-forge,nodefaults
envs: "-o recommended -o tests -o build -o tests_ci"
cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }}
playwright: true
id: install
- name: doit test_ui
environments: ${{ matrix.environment }}
- name: Test UI
if: needs.setup.outputs.code_change == 'true'
run: |
conda activate test-environment
doit test_ui
- name: Upload coverage to Codecov
pixi run -e ${{ matrix.environment }} test-ui --cov=./holoviews --cov-report=xml
- uses: codecov/codecov-action@v4
if: needs.setup.outputs.code_change == 'true'
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
flags: ui-tests
fail_ci_if_error: false # optional (default = false)
token: ${{ secrets.CODECOV_TOKEN }}

core_test_suite:
name: Core tests on Python ${{ matrix.python-version }}, ${{ matrix.os }}
needs: [pre_commit, setup]
name: core:${{ matrix.environment }}:${{ matrix.os }}
needs: [pre_commit, setup, pixi_lock]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.12"]
environment: ["test-core"]
timeout-minutes: 120
env:
DESC: "Python ${{ matrix.python-version }}, ${{ matrix.os }} core tests"
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- uses: holoviz-dev/holoviz_tasks/install@v0
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
if: needs.setup.outputs.code_change == 'true'
with:
name: core_test_suite
python-version: ${{ matrix.python-version }}
# channel-priority: strict
channels: pyviz/label/dev,conda-forge,nodefaults
envs: "-o tests_core -o tests_ci"
cache: ${{ github.event.inputs.cache || github.event.inputs.cache == '' }}
id: install
- name: Download data
if: needs.setup.outputs.code_change == 'true'
run: |
conda activate test-environment
bash scripts/download_data.sh
environments: ${{ matrix.environment }}
- name: Check packages latest version
if: needs.setup.outputs.code_change == 'true'
run: |
conda activate test-environment
python scripts/check_latest_packages.py numpy pandas bokeh panel param
- name: doit test_unit
pixi run -e ${{ matrix.environment }} check-latest-packages numpy pandas bokeh panel param
- name: Test Unit
if: needs.setup.outputs.code_change == 'true'
run: |
conda activate test-environment
pytest holoviews
pixi run -e ${{ matrix.environment }} test-unit
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@
.ipynb_checkpoints
.coverage
.pytest_cache
.pixi
holoviews/_version.py

/release
/doc/Tutorials-WIP/*.ipynb
.idea
.vscode
holoviews.rc
/examples/assets/
philippjfr marked this conversation as resolved.
Show resolved Hide resolved
ghostdriver.log
holoviews/.version
.dir-locals.el
Expand Down
Loading
Loading