Skip to content

switch to uv #195

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

Merged
merged 41 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1121e44
move to uv #185
bckohan Mar 9, 2025
627886c
fix missing install uv in CI #185
bckohan Mar 9, 2025
f2cafdc
add tomlkit dev dependency for version locking
bckohan Mar 9, 2025
aa00a71
try fix just tests
bckohan Mar 9, 2025
c168576
fix shell completion tests
bckohan Mar 9, 2025
b09c2b1
try fix windows tests
bckohan Mar 10, 2025
9fe0d8e
fix shell detection test on windows
bckohan Mar 10, 2025
c4c4631
fix windows pwsh test
bckohan Mar 10, 2025
33aaabd
try fix windows powershell tests
bckohan Mar 10, 2025
f5826e6
fix win shell failure test
bckohan Mar 10, 2025
ef95744
fix #173
bckohan Mar 10, 2025
397118e
test against django 5.2 beta #173
bckohan Mar 10, 2025
7a6169f
bump ver, fix coverage
bckohan Mar 10, 2025
c13956f
update contributing
bckohan Mar 10, 2025
a5fb7e4
update contributing
bckohan Mar 10, 2025
ea8558e
try fix test
bckohan Mar 10, 2025
ef4286f
fix env verify
bckohan Mar 10, 2025
9d264b0
try fix shell tests
bckohan Mar 10, 2025
b1ace78
fix just manage so that arguments with spaces are wrapped and passed …
bckohan Mar 10, 2025
45bb8d5
remove positional arguments, it does not work on windows
bckohan Mar 11, 2025
d739d3f
fix #192 fix #193
bckohan Mar 11, 2025
e9cbeb4
split powershell tests up so they run faster
bckohan Mar 11, 2025
d300e60
try fix just test-all for coverage
bckohan Mar 11, 2025
f4de560
install all extras by default
bckohan Mar 11, 2025
8b7a6f6
try fix shell detection failure coverage
bckohan Mar 11, 2025
bf854c1
try fix CI
bckohan Mar 11, 2025
9d90e34
fix just test-all
bckohan Mar 11, 2025
1f4137e
fix postgres test
bckohan Mar 11, 2025
5b21500
try fix CI shelltest for coverage
bckohan Mar 11, 2025
fc6b8b3
try fix coverage
bckohan Mar 11, 2025
54e9d28
try fix CI
bckohan Mar 11, 2025
40ed6e4
try fix win shell tests for coverage
bckohan Mar 11, 2025
a5d9d1b
try fix windows shell tests in CI
bckohan Mar 11, 2025
33fdd89
fix pwsh shell detection tests in CI
bckohan Mar 11, 2025
cc150bc
try propogate error
bckohan Mar 11, 2025
39e7ba1
try fix test failures in CI
bckohan Mar 11, 2025
150cbd9
fix #194
bckohan Mar 11, 2025
3a16e3f
add test to CI for coverage
bckohan Mar 11, 2025
54b216f
fix doc build, update LICENSE dates
bckohan Mar 11, 2025
c77bc5a
fix doc build
bckohan Mar 11, 2025
a20bc87
try fix docs build
bckohan Mar 11, 2025
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
13 changes: 10 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ permissions: read-all

on:
push:
branches: main
# branches: main
pull_request:
workflow_call:
workflow_dispatch:
inputs:
debug:
Expand Down Expand Up @@ -50,12 +51,18 @@ jobs:
id: sp
with:
python-version: ${{ matrix.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Install Just
uses: extractions/setup-just@v2
- name: Install Dependencies
run: |
just init ${{ steps.sp.outputs.python-path }} install-docs
just pin-dependency Django~=${{ matrix.django-version }}.0
just setup ${{ steps.sp.outputs.python-path }}
just test-lock Django~=${{ matrix.django-version }}.0
just install-docs
- name: Install Emacs
if: ${{ github.event.inputs.debug == 'true' }}
run: |
Expand Down
113 changes: 63 additions & 50 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,72 +1,96 @@
##
# Derived from:
# https://github.com/django-commons/django-commons-playground/blob/main/.github/workflows/release.yml
#

name: Publish Release

permissions: read-all

concurrency:
# stop previous release runs if tag is recreated
group: release-${{ github.ref }}
cancel-in-progress: true

on:
push:
tags:
- 'v*' # only publish on version tags (e.g. v1.0.0)
workflow_dispatch:
inputs:
pypi:
description: 'Publish to PyPi'
required: true
default: false
type: boolean
github:
description: 'Publish a GitHub Release'
required: true
default: false
type: boolean
testpypi:
description: 'Publish to TestPyPi'
required: true
default: true
type: boolean

env:
PYPI_URL: https://pypi.org/p/django-typer
PYPI_TEST_URL: https://test.pypi.org/project/django-typer

jobs:

lint:
permissions:
contents: read
actions: write
uses: ./.github/workflows/lint.yml
secrets: inherit

test:
permissions:
contents: read
actions: write
uses: ./.github/workflows/test.yml
secrets: inherit

build:
name: Build Package
runs-on: ubuntu-latest
permissions:
contents: read
actions: write

outputs:
PACKAGE_NAME: ${{ steps.set-package.outputs.package_name }}
RELEASE_VERSION: ${{ steps.set-package.outputs.release_version }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install pypa/build
run:
python3 -m pip install build --user
- name: Build a binary wheel and a source tarball
run: python3 -m build
python-version: ">=3.11" # for tomlib
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Setup Just
uses: extractions/setup-just@v2
- name: Verify Tag
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
echo "Verifying tag $TAG_NAME..."
# if a tag was deleted and recreated we may have the old one cached
# be sure that we're publishing the current tag!
git fetch --force origin refs/tags/$TAG_NAME:refs/tags/$TAG_NAME

# verify signature
curl -sL https://github.com/${{ github.actor }}.gpg | gpg --import
git tag -v "$TAG_NAME"

# verify version
RELEASE_VERSION=$(just validate_version $TAG_NAME)

# export the release version
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_ENV
- name: Build the binary wheel and a source tarball
run: just build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Set Package Name
id: set-package
run:
PACKAGE_NAME=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['name'])")
echo "PACKAGE_NAME=${PACKAGE_NAME}" >> $GITHUB_ENV

publish-to-pypi:
name: Publish to PyPI
if: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.pypi == 'true') || github.event_name != 'workflow_dispatch' }}
needs:
- build
- lint
- test
- build
- publish-to-testpypi
runs-on: ubuntu-latest
environment:
name: pypi
url: ${{ env.PYPI_URL }}
url: https://pypi.org/p/${{ needs.build.outputs.PACKAGE_NAME }}
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
Expand All @@ -80,10 +104,11 @@ jobs:

github-release:
name: Publish GitHub Release
if: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.github == 'true') || github.event_name != 'workflow_dispatch' }}
runs-on: ubuntu-latest
needs:
- build
- lint
- test
- build
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore
Expand Down Expand Up @@ -121,14 +146,13 @@ jobs:

publish-to-testpypi:
name: Publish to TestPyPI
if: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.testpypi == 'true') || github.event_name != 'workflow_dispatch' }}
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
url: ${{ env.PYPI_TEST_URL }}
url: https://test.pypi.org/project/${{ needs.build.outputs.PACKAGE_NAME }}

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
Expand All @@ -144,14 +168,3 @@ jobs:
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true

# TODO fetch-data requires login
# notify-django-packages:
# name: Notify Django Packages
# runs-on: ubuntu-latest
# needs:
# - publish-to-pypi
# steps:
# - name: Notify Django Packages
# run:
# curl -X GET "https://djangopackages.org/packages/django-typer/fetch-data/"
Loading
Loading