Skip to content

Commit

Permalink
Merge branch 'main' into test/msvc
Browse files Browse the repository at this point in the history
  • Loading branch information
robomics committed Nov 29, 2024
2 parents 39c2006 + 51f5f0b commit 134d8ac
Show file tree
Hide file tree
Showing 65 changed files with 2,436 additions and 733 deletions.
36 changes: 32 additions & 4 deletions .github/workflows/build-conan-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

env:
CONAN_HOME: "${{ github.workspace }}/.conan2"
IMAGE: quay.io/pypa/manylinux_2_28_${{ inputs.arch }}
IMAGE: quay.io/pypa/manylinux_2_28_${{ inputs.arch }}:2024.11.09-1

outputs:
conan-key: ${{ steps.generate-cache-key.outputs.conan-key }}
Expand Down Expand Up @@ -107,6 +107,30 @@ jobs:
path: ${{ env.CONAN_HOME }}/p
lookup-only: true

- name: Configure Conan
if: steps.cache-conan.outputs.cache-hit != 'true'
run: |
cat << 'EOF' | tee script.sh > /dev/null
#!usr/bin/env bash
set -u
set -e
conan_version="$1"
PATH="/opt/python/cp312-cp312/bin:$PATH"
pip install "conan==$conan_version"
conan remote update conancenter --url https://center2.conan.io
EOF
chmod 755 script.sh
docker run \
-e "CONAN_HOME=$CONAN_HOME" \
-v "$PWD/script.sh:/tmp/script.sh:ro" \
-v "$CONAN_HOME:$CONAN_HOME" \
"$IMAGE" /tmp/script.sh '${{ inputs.conan-version }}'
- name: Clean Conan cache (pre-build)
if: steps.cache-conan.outputs.cache-hit != 'true'
run: |
Expand Down Expand Up @@ -261,15 +285,17 @@ jobs:
- uses: actions/setup-python@v5
if: steps.cache-conan.outputs.cache-hit != 'true'
with:
python-version: "3.12"
python-version: "3.13"

- name: Update build deps
if: steps.cache-conan.outputs.cache-hit != 'true'
run: pip install "conan==${{ inputs.conan-version }}"

- name: Configure Conan
if: steps.cache-conan.outputs.cache-hit != 'true'
run: conan profile detect --force
run: |
conan profile detect --force
conan remote update conancenter --url https://center2.conan.io
- name: Clean Conan cache (pre-build)
if: steps.cache-conan.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -366,7 +392,7 @@ jobs:
- uses: actions/setup-python@v5
if: steps.cache-conan.outputs.cache-hit != 'true'
with:
python-version: "3.12"
python-version: "3.13"

- name: Update build deps
if: steps.cache-conan.outputs.cache-hit != 'true'
Expand All @@ -380,6 +406,8 @@ jobs:
sed -i 's/compiler\.cppstd=.*/compiler.cppstd=${{ inputs.cppstd }}/' "$conan_profile"
conan remote update conancenter --url https://center2.conan.io
- name: Clean Conan cache (pre-build)
if: steps.cache-conan.outputs.cache-hit != 'true'
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/fuzzy-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ on:
- "cmake/**"
- "src/**"
- "test/scripts/fuzzer.py"
- "utils/devel/stubgen.py"
- "utils/devel/symlink_pyarrow_libs.py"
- "CMakeLists.txt"
- "conanfile.py"
- "pyproject.toml"
Expand All @@ -22,8 +20,6 @@ on:
- "cmake/**"
- "src/**"
- "test/scripts/fuzzer.py"
- "utils/devel/stubgen.py"
- "utils/devel/symlink_pyarrow_libs.py"
- "CMakeLists.txt"
- "conanfile.py"
- "pyproject.toml"
Expand Down Expand Up @@ -147,6 +143,10 @@ jobs:
key: conan-${{ steps.cache-key.outputs.key }}
path: ${{ env.CONAN_HOME }}/p

- name: Configure Conan
if: steps.cache-conan.outputs.cache-hit != 'true'
run: conan remote update conancenter --url https://center2.conan.io

- name: Clean Conan cache (pre-build)
if: steps.cache-conan.outputs.cache-hit != 'true'
run: |
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/lint-cff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Copyright (C) 2024 Roberto Rossini <[email protected]>
# SPDX-License-Identifier: MIT

name: Lint CITATION.cff

on:
push:
branches: [main]
paths:
- ".github/workflows/lint-cff.yml"
- "CITATION.cff"

pull_request:
paths:
- ".github/workflows/lint-cff.yml"
- "CITATION.cff"

# https://stackoverflow.com/a/72408109
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
lint-cff:
runs-on: ubuntu-latest
name: Lint CITATION.cff

steps:
- uses: actions/checkout@v4
with:
sparse-checkout: CITATION.cff
sparse-checkout-cone-mode: false

- name: Generate DESCRIPTION file
run: |
cat << EOF > DESCRIPTION
Package: hictkpy
Title: What the Package Does (One Line, Title Case)
Version: 0.0.0.9000
Authors@R:
person("First", "Last", , "[email protected]", role = c("aut", "cre"))
Description: What the package does (one paragraph).
License: MIT
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
Imports:
cffr
EOF
- name: Setup R
uses: r-lib/actions/setup-r@v2

- name: Add requirements
uses: r-lib/actions/setup-r-dependencies@v2

- name: Lint CITATION.cff
run: Rscript -e 'cffr::cff_validate("CITATION.cff")'
9 changes: 5 additions & 4 deletions .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:
- "src/**"
- "test/**"
- "utils/devel/stubgen.py"
- "utils/devel/symlink_pyarrow_libs.py"
- "CMakeLists.txt"
- "conanfile.py"
- "pyproject.toml"
Expand All @@ -25,7 +24,6 @@ on:
- "src/**"
- "test/**"
- "utils/devel/stubgen.py"
- "utils/devel/symlink_pyarrow_libs.py"
- "CMakeLists.txt"
- "conanfile.py"
- "pyproject.toml"
Expand All @@ -49,7 +47,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-2022, macos-latest, ubuntu-latest]
python-version: ["3.9", "3.12"]
python-version: ["3.9", "3.13"]

runs-on: ${{ matrix.os }}

Expand All @@ -62,7 +60,7 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Add requirements
run: python -m pip install --upgrade wheel setuptools
run: python -m pip install --upgrade conan wheel setuptools

- name: Generate cache key
id: cache-key
Expand All @@ -71,6 +69,9 @@ jobs:
echo "conan-key=pip-${{ matrix.os }}-$hash" >> $GITHUB_OUTPUT
- name: Configure Conan
run: conan remote update conancenter --url https://center2.conan.io

- name: Restore Conan cache
id: cache-conan
uses: actions/cache/restore@v4
Expand Down
58 changes: 46 additions & 12 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@ on:
- "src/**"
- "test/**"
- "utils/devel/stubgen.py"
- "utils/devel/symlink_pyarrow_libs.py"
- "CMakeLists.txt"
- "conanfile.py"
- "pyproject.toml"
tags:
- "v*.*.*"

pull_request:
paths:
Expand All @@ -29,7 +26,6 @@ on:
- "src/**"
- "test/**"
- "utils/devel/stubgen.py"
- "utils/devel/symlink_pyarrow_libs.py"
- "CMakeLists.txt"
- "conanfile.py"
- "pyproject.toml"
Expand All @@ -56,11 +52,13 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.13"

- name: Install cibuildwheel
run: pip install 'cibuildwheel>=2.21'
Expand Down Expand Up @@ -177,6 +175,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up QEMU
if: startsWith(matrix.os, 'ubuntu')
Expand Down Expand Up @@ -228,10 +228,11 @@ jobs:
fail-on-cache-miss: true

- name: Build wheels
uses: pypa/cibuildwheel@v2.21
uses: pypa/cibuildwheel@v2.22
with:
only: ${{ matrix.wheel-config }}
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_ENVIRONMENT_LINUX: >
PIP_VERBOSE=1
HICTK_CI=1
Expand All @@ -249,8 +250,6 @@ jobs:
CIBW_ENVIRONMENT_PASS_LINUX: >
CONAN_HOME
HICTKPY_CONAN_INSTALL_ARGS
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
- name: Verify clean directory
run: git diff --exit-code
Expand Down Expand Up @@ -290,7 +289,37 @@ jobs:
name: dist
path: dist.tar
if-no-files-found: error
retention-days: 30
retention-days: 7

pypi-publish:
name: Upload release to PyPI
if: github.event_name == 'release' && github.event.action == 'published'
needs: [package-artifacts]
environment:
name: PyPI
url: https://pypi.org/p/hictkpy
permissions:
id-token: write
runs-on: ubuntu-latest

steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: dist
merge-multiple: true

- name: Extract dist.tar
run: |
tar -xf dist.tar
rm dist.tar
- name: Upload wheels to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: true
print-hash: true
verbose: true

build-wheels-status-check:
name: Status Check (Build wheels)
Expand All @@ -300,11 +329,16 @@ jobs:
- build-sdist
- build-wheels
- package-artifacts
- pypi-publish

steps:
- name: Collect job results
if: |
needs.build-sdist.result != 'success' ||
needs.build-wheels.result != 'success' ||
needs.package-artifacts.result != 'success'
needs.build-sdist.result != 'success' ||
needs.build-wheels.result != 'success' ||
needs.package-artifacts.result != 'success' ||
(
needs.pypi-publish.result != 'success' &&
needs.pypi-publish.result != 'skipped'
)
run: exit 1
22 changes: 12 additions & 10 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@
version: 2

build:
os: ubuntu-22.04
apt_packages:
- librsvg2-bin
os: ubuntu-24.04
tools:
python: "3.11"
python: "3.12"

sphinx:
configuration: docs/conf.py

python:
install:
- requirements: docs/requirements.txt
commands:
- pip install -r docs/requirements.txt
- pip install . -v
- docs/update_index_links.py --root-dir "$PWD" --inplace
- make -C docs linkcheck
- make -C docs html
- make -C docs latexpdf
- mkdir -p "$READTHEDOCS_OUTPUT/pdf"
- cp -r docs/_build/html "$READTHEDOCS_OUTPUT/"
- cp docs/_build/latex/hictkpy.pdf "$READTHEDOCS_OUTPUT/pdf/"

formats:
- pdf
Loading

0 comments on commit 134d8ac

Please sign in to comment.