Skip to content
Merged
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
44 changes: 0 additions & 44 deletions .github/release-drafter.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: Build / Release PyPI
name: Build Wheels

on:
push:
tags:
- v[0-9]*.[0-9]*.[0-9]*

workflow_call:

pull_request:
paths:
# When we change pyproject.toml, we want to ensure that the maturin builds still work.
- pyproject.toml
# And when we change this workflow itself...
- .github/workflows/build-wheels.yml

permissions: {}

jobs:
Expand Down Expand Up @@ -168,23 +171,3 @@ jobs:
with:
name: wheels-sdist
path: dist

release:
name: "release"

runs-on: ubuntu-latest

if: startsWith(github.ref, 'refs/tags/')

needs: [linux, musllinux, windows, macos, sdist]

steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0

- name: Publish to PyPI
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*
8 changes: 0 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,6 @@ jobs:
run: cargo codspeed run --bench ${{ matrix.project }}
mode: walltime

build-binaries:
name: "build binaries"

needs: determine_changes
if: ${{ (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }}

uses: ./.github/workflows/build.yml

project-diff:
name: "run project diff"

Expand Down
50 changes: 0 additions & 50 deletions .github/workflows/release-drafter.yml

This file was deleted.

144 changes: 122 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,146 @@
name: Release

on:
push:
tags:
- v[0-9]*.[0-9]*.[0-9]*
workflow_dispatch:
inputs:
tag:
description: "Tag to release (e.g., 1.0.0)"
required: true
default: dry-run
type: string

env:
PYTHON_VERSION: "3.14"

permissions: {}

jobs:
release_github:
generate-release:
name: Generate release metadata
runs-on: ubuntu-latest
outputs:
release-metadata: ${{ steps.seal-generate.outputs.metadata }}
tag: ${{ github.event.inputs.tag }}

steps:
- name: Checkout repository
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false

- name: Install seal
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/MatthewMckee4/seal/releases/download/0.0.1-alpha.5/seal-installer.sh | sh
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"

- name: Generate release metadata
id: seal-generate
run: |
METADATA=$(seal generate release)
{
echo "metadata<<EOF"
echo "$METADATA"
echo "EOF"
} >> "$GITHUB_OUTPUT"
echo "Release metadata:"
echo "$METADATA"

permissions:
contents: write
build-wheels:
name: Build wheels
needs: generate-release
if: github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/build-wheels.yml

create-release:
name: Create GitHub release
runs-on: ubuntu-latest
needs: [generate-release, build-wheels]
if: github.event_name == 'workflow_dispatch'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Checkout repository
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
persist-credentials: false

- name: Publish Latest Draft
- name: Download all wheels
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
pattern: wheels-*/*

- name: Parse release metadata
id: parse-metadata
env:
METADATA: ${{ needs.generate-release.outputs.release-metadata }}
run: |
if gh release list | grep Draft; then
old_version="$(gh release list | grep Draft | head -1 | cut -f1)"
new_version="${GITHUB_REF_NAME}"
body=$(gh release view "$old_version" --json body -q ".body" | sed "s/\.\.\.$old_version/...$new_version/g")
gh release delete "$old_version"
gh release create "$new_version" --title "${GITHUB_REF_NAME}" --notes "$body";
else
gh release create "$new_version" --title "${GITHUB_REF_NAME}";
fi
TITLE=$(echo "$METADATA" | jq -r '.title')
BODY=$(echo "$METADATA" | jq -r '.body')
PRERELEASE=$(echo "$METADATA" | jq -r '.prerelease')

{
echo "title=$TITLE"
echo "prerelease=$PRERELEASE"
} >> "$GITHUB_OUTPUT"

# Save body to file to handle multiline content
echo "$BODY" > "$RUNNER_TEMP/release-notes.txt"

- name: Create git tag
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ needs.generate-release.outputs.tag }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git tag "$TAG"
git push origin "$TAG"

publish-docs:
- name: Create GitHub release
env:
TAG: ${{ needs.generate-release.outputs.tag }}
TITLE: ${{ steps.parse-metadata.outputs.title }}
PRERELEASE: ${{ steps.parse-metadata.outputs.prerelease }}
run: |
ARGS=(
"$TAG"
--title "$TITLE"
--notes-file "$RUNNER_TEMP/release-notes.txt"
)

if [ "$PRERELEASE" = "true" ]; then
ARGS+=(--prerelease)
fi

ARGS+=(wheels-*/*)

gh release create "${ARGS[@]}"

publish-pypi:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [generate-release, build-wheels, create-release]
if: github.event_name == 'workflow_dispatch'

steps:
- name: Download all wheels
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
pattern: wheels-*

name: Docs builder and publisher
- name: Publish to PyPI
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*

permissions:
contents: write
publish-docs:
name: Publish documentation
runs-on: ubuntu-latest
needs: create-release
if: github.event_name == 'workflow_dispatch'

steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
Expand Down
Empty file added CHANGELOG.md
Empty file.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Karva (0.1.11)
# Karva (0.0.0)

[![codecov](https://codecov.io/gh/MatthewMckee4/karva/graph/badge.svg?token=VELHBTE1L9)](https://codecov.io/gh/MatthewMckee4/karva)
![PyPI - Version](https://img.shields.io/pypi/v/karva)

> [!NOTE]
>
> Sadly, this will not be very well maintained and should not be used for anything important.
> I wanted to see if I could make a better `pytest`. But unless I completely diverge from the
> I wanted to see if I could make a better `pytest`. But unless I completely diverge from the
> current architecture and basically start again, and try to make a better `pytest-xdist`, the
> performance of this will not be much better than `pytest`, let alone `pytest-xdist`.
>
> Thanks for taking an interest! Perhaps I will have a proper go at this in the future.
> Thanks for taking an interest! Perhaps I will have a proper go at this in the future.

A Python test framework, written in Rust.

Expand Down
2 changes: 1 addition & 1 deletion crates/karva/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "karva"
version = "0.1.11"
version = "0.0.0"

edition = { workspace = true }
rust-version = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/karva_cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "karva_cli"
version = "0.1.11"
version = "0.0.0"
default-run = "karva"

edition = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/karva_core/src/collection/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl CollectedModule {
pub struct CollectedPackage {
pub(crate) path: Utf8PathBuf,
pub(crate) modules: HashMap<Utf8PathBuf, CollectedModule>,
pub(crate) packages: HashMap<Utf8PathBuf, CollectedPackage>,
pub(crate) packages: HashMap<Utf8PathBuf, Self>,
pub(crate) configuration_module_path: Option<Utf8PathBuf>,
}

Expand Down
Loading
Loading