Skip to content

Commit

Permalink
chore: migrate project to rye
Browse files Browse the repository at this point in the history
  • Loading branch information
vivienm committed Aug 20, 2024
1 parent faa2e63 commit f14b112
Show file tree
Hide file tree
Showing 19 changed files with 995 additions and 169 deletions.
28 changes: 12 additions & 16 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
# Changes here will be overwritten by Copier. NEVER EDIT MANUALLY.

_commit: '4398304'
_src_path: gh:vivienm/copier-python-pdm
_commit: 0b74ec2
_src_path: https://github.com/vivienm/copier-python-rye
author_email: [email protected]
author_fullname: Vivien Maisonneuve
author_name: Vivien Maisonneuve
build_system: maturin
copyright_holder: Vivien Maisonneuve
copyright_license: MIT
copyright_year: 2022
distribution_name: tdigest-ch
module_name: tdigest_ch
pages_enabled: true
pages_provider: github.io
pages_url: https://vivienm.github.io/python-tdigest-ch
github_account: vivienm
github_pages: true
hosting_platform: github
license: MIT
package_name: tdigest_ch
project_description: A Python library for estimating quantiles in a stream, using
ClickHouse t-digest data structure.
project_name: tdigest-ch
project_type: lib
python_version: '3.8'
repository_hosted: true
repository_name: python-tdigest-ch
repository_namespace: vivienm
repository_provider: github.com
repository_url: https://github.com/vivienm/python-tdigest-ch
project_type: library
python_version: '3.9'
repo_name: python-tdigest-ch
104 changes: 75 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,77 @@
name: "Continuous integration"
name: "CI"

on:
push:
pull_request:

concurrency:
group: "ci-${{ github.ref }}"
cancel-in-progress: true

jobs:
nox:
just:
name: "Just"
runs-on: "ubuntu-latest"
steps:
- uses: "pdm-project/setup-pdm@main"
with:
python-version: "3.8"
- uses: "actions/checkout@v3"
- run: "pdm venv create 3.8"
- run: "pdm install"
- uses: "actions/upload-artifact@v3"
with:
name: "pdm-lockfile"
path: "./pdm.lock"
retention-days: 7
- run: "pdm run nox"
- uses: "actions/upload-artifact@v3"
with:
name: "sphinx"
path: "./docs/_build/html"
retention-days: 7
- name: "Checkout"
uses: "actions/checkout@v4"
- name: "Install the Rust toolchain"
uses: "dtolnay/rust-toolchain@stable"
with:
components: "clippy, rustfmt"
- name: "Install sccache"
uses: "mozilla-actions/[email protected]"
- name: "Set up sccache"
run: |
echo "RUSTC_WRAPPER=sccache" >> "${GITHUB_ENV}"
echo "SCCACHE_GHA_ENABLED=true" >> "${GITHUB_ENV}"
- name: "Install development tools"
uses: "taiki-e/install-action@v2"
with:
tool: "just, cargo-audit, typos"
- name: "Install Rye"
run: |
curl -sSf https://rye.astral.sh/get | RYE_INSTALL_OPTION="--yes" RYE_TOOLCHAIN_VERSION="$(cat .python-version)" bash
echo "${HOME}/.rye/shims" >> $GITHUB_PATH
- name: "Cache Cargo directories"
uses: "actions/cache@v4"
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/advisory-db/
target/
key: "${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml', 'Cargo.lock') }}"
restore-keys: "${{ runner.os }}-cargo-"
- name: "Cache Rye directories"
uses: "actions/cache@v4"
with:
path: |
~/.cache/uv/
.venv/
key: "${{ runner.os }}-rye-${{ hashFiles('pyproject.toml', 'requirements.lock', 'requirements-dev.lock') }}"
restore-keys: "${{ runner.os }}-rye-"
- name: "Update the virtualenv"
run: "rye sync"
- name: "Run Just"
run: "just ci"
env:
RUSTFLAGS: "-D warnings"
RUSTDOCFLAGS: "-D warnings"
- name: "Upload docs artifact"
uses: "actions/upload-artifact@v4"
with:
name: "docs"
path: "./docs/_build/html"
retention-days: 7

pages:
name: "Pages"
if: "github.ref == format('refs/heads/{0}', github.event.repository.default_branch)"
needs: "nox"
needs: "just"
permissions:
pages: "write"
id-token: "write"
Expand All @@ -37,12 +80,15 @@ jobs:
url: "${{ steps.deployment.outputs.page_url }}"
runs-on: "ubuntu-latest"
steps:
- uses: "actions/download-artifact@v3"
with:
name: "sphinx"
path: "${{ runner.temp }}/pages/docs"
- uses: "actions/upload-pages-artifact@v1"
with:
path: "${{ runner.temp }}/pages"
- id: "deployment"
uses: "actions/deploy-pages@v1"
- name: "Download docs artifact"
uses: "actions/download-artifact@v4"
with:
name: "docs"
path: "${{ runner.temp }}/pages/docs"
- name: "Upload pages artifact"
uses: "actions/upload-pages-artifact@v3"
with:
path: "${{ runner.temp }}/pages"
- name: "Deploy pages"
id: "deployment"
uses: "actions/deploy-pages@v4"
9 changes: 2 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
__pycache__/
/.benchmarks/
/.mypy_cache/
/.nox/
/.pdm-python
/.pytest_cache/
/.ruff_cache/
/.venv/
/build/
/dist/
/pdm.lock
/setup.py
/src/*.egg-info/
/src/**/*.cpython-*.so
/target/
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.9
Loading

0 comments on commit f14b112

Please sign in to comment.