Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into nr/python-project
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasRosenstein committed Feb 27, 2024
2 parents 5e41c7c + 6de51b3 commit 9e8bfdd
Show file tree
Hide file tree
Showing 55 changed files with 963 additions and 727 deletions.
20 changes: 20 additions & 0 deletions .changelog/0.34.0.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
release-date = "2024-02-16"

[[entries]]
id = "c735fee0-cd87-47a6-8c6f-b52463f0f73e"
type = "feature"
description = "Add `workspace`, `all_features` and `deny_warnings` properties to `CargoClippyTask`."
author = "@tomkarw"
pr = "https://github.com/kraken-build/kraken/pull/182"

[[entries]]
id = "2df7db61-77d1-4498-abf2-c2f3bc853ec9"
type = "hygiene"
description = "Protect against NPE"
author = "[email protected]"

[[entries]]
id = "54303490-db52-403a-b02f-cc993a937f9f"
type = "feature"
description = "Add support for installing Kraken build environments with `uv` (https://astral.sh/blog/uv)"
author = "@NiklasRosenstein"
15 changes: 15 additions & 0 deletions .changelog/0.34.1.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
release-date = "2024-02-16"

[[entries]]
id = "e663a548-2495-475d-abf9-62a0b7d0d00b"
type = "fix"
description = "Fix warning about corrupt virtual environment also showing when there is no trace of any prior virtual environment"
author = "@NiklasRosenstein"
component = "kraken-wrapper"

[[entries]]
id = "daf69f05-c069-4172-9ef3-10219a926f53"
type = "fix"
description = "Fix using the default installer as configured with `krakenw config --installer=...`"
author = "@NiklasRosenstein"
component = "kraken-wrapper"
32 changes: 32 additions & 0 deletions .changelog/_unreleased.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
[[entries]]
id = "67c15e74-a142-482f-9d2e-972a50161129"
type = "feature"
description = "Make Rust builds respect Cargo.lock when present"
author = "[email protected]"

[[entries]]
id = "ebe30d77-1206-4437-8aa2-7373e9335926"
type = "improvement"
description = "Improve Windows support in `krakenw` by supporting the `PYENV` env-var and using the right `pyhon.exe` path on Windows"
author = "@NiklasRosenstein"
component = "kraken-wrapper"

[[entries]]
id = "a8200c89-b05a-46ce-895c-c4a4f5a736a6"
type = "fix"
description = "Do not use `dmypy` on Windows"
author = "@NiklasRosenstein"
component = "kraken-build"

[[entries]]
id = "db65bd12-a9d1-472c-a38b-6f889cdda683"
type = "improvement"
description = "Move bump version into publish"
author = "[email protected]"

[[entries]]
id = "31a52a49-8d26-4dd7-a4bc-84fe9fb37c19"
type = "improvement"
description = "Add task to login in all cargo registries"
author = "[email protected]"

[[entries]]
id = "fb3fcc4a-a38a-445f-b124-571395b7ac86"
type = "feature"
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/data.yaml

This file was deleted.

50 changes: 0 additions & 50 deletions .github/workflows/documentation.yaml

This file was deleted.

180 changes: 180 additions & 0 deletions .github/workflows/on-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
name: "On Commit"

on:
push: { branches: [ "develop" ], tags: [ "*" ] }
pull_request: { branches: [ "*" ] }

env:
COLUMNS: 200

jobs:

# == Validate data embedded in the Kraken standard library ==

gitignore-io-up-to-date:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: NiklasRosenstein/slap@gha/install/v1
- uses: actions/setup-python@v5
with: { python-version: "3.10" }
- run: slap install --link --no-venv-check ${{ matrix.only }}
- run: python -m kraken.std.git.gitignore.gitignore_io
- run: git diff --exit-code

# == Documentation ==

documentation:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: NiklasRosenstein/slap@gha/install/v1

- run: pipx install kraken-wrapper==0.34.1 && krakenw config --installer=UV
- run: pipx install mksync

- name: Restore Kraken build cache
uses: actions/cache/restore@v4
with:
path: build
key: build-cache:${{ runner.os }}:${{ hashFiles('.kraken.lock') }}

- run: |
cd docs
for fn in docs/cli/*.md; do mksync -i $fn; done
mksync -i docs/changelog.md
- run: krakenw run mkdocs.build --no-save

- name: Save Kraken build cache
uses: actions/cache/save@v4
with:
path: build
key: build-cache:${{ runner.os }}:${{ hashFiles('.kraken.lock') }}

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: build/docs/mkdocs/_site

- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/develop'
id: deployment
uses: actions/deploy-pages@v4

# == Unit tests, linting, and type checking ==

test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.x"]
steps:
- uses: actions/checkout@v4
- uses: NiklasRosenstein/slap@gha/install/v1
- uses: actions/setup-python@v5
with: { python-version: "${{ matrix.python-version }}" }
- run: pip install pipx && pipx install poetry && pipx install pdm && pipx install kraken-wrapper==0.34.1 && krakenw config --installer=UV
- run: rustup update

- name: Restore Kraken build cache
uses: actions/cache/restore@v4
with:
path: build
key: build-cache:${{ runner.os }}:${{ hashFiles('.kraken.lock') }}

- name: Restore Venv
uses: actions/cache/restore@v4
with:
path: .venvs/
key: build-cache:${{ runner.os }}:venv:${{ matrix.python-version }}

# Explicitly mention python.install to ensure that Pip install is rerun.
- run: krakenw run python.install check lint test -vv

- name: Save Venv
uses: actions/cache/save@v4
with:
path: .venvs/
key: build-cache:${{ runner.os }}:venv:${{ matrix.python-version }}

- name: Save Kraken build cache
uses: actions/cache/save@v4
with:
path: build
key: build-cache:${{ runner.os }}:${{ hashFiles('.kraken.lock') }}

# == Try running Kraken as defined in the kraken.yaml file ==

selftest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.10"
- python-version: "3.11"
- python-version: "3.12"
- python-version: "3.x"
steps:
- uses: actions/checkout@v4
- uses: NiklasRosenstein/slap@gha/install/v1
- uses: actions/setup-python@v5
with: { python-version: "${{ matrix.python-version }}" }
- run: pip install pipx && pipx install poetry && pipx install pdm
- run: rustup update

- name: Restore cache
uses: actions/cache/restore@v4
with:
path: |
build
.venvs
key: build-cache:${{ runner.os }}:selftest

- run: slap install --link --no-venv-check ${{ matrix.only }}

- run: kraken run python.install fmt lint test -vv
- run: kraken q ls
- run: kraken q tree
- run: kraken q viz
- run: kraken q d python.mypy

- name: Save cache
uses: actions/cache/save@v4
with:
path: |
build
.venvs
key: build-cache:${{ runner.os }}:selftest

uv-installer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: NiklasRosenstein/slap@gha/install/v1
- run: slap install --link --no-venv-check
- run: krakenw --reinstall --use=UV
- run: krakenw run fmt lint

examples-docker-manual:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python-version: "3.10"
- python-version: "3.11"
- python-version: "3.12"
- python-version: "3.x"
steps:
- uses: actions/checkout@v4
- uses: NiklasRosenstein/slap@gha/install/v1
- uses: actions/setup-python@v5
with: { python-version: "${{ matrix.python-version }}" }
- run: slap install --link --no-venv-check ${{ matrix.only }}
- run: cd examples/docker-manual && kraken run :dockerBuild :sub:helloWorld
Loading

0 comments on commit 9e8bfdd

Please sign in to comment.