Skip to content

Commit 1d14934

Browse files
authored
Merge pull request #71 from biocommons/70-adopt-cookiecutter-uv
Closes #70: Adopt cookiecutter-uv as foundation
2 parents aa17fd8 + 8192899 commit 1d14934

34 files changed

+2757
-637
lines changed

.devcontainer/devcontainer.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/python
3+
{
4+
"name": "python-package",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye",
7+
"runArgs": [
8+
// avoid UID/GID remapping under rootless Podman
9+
"--userns=keep-id"
10+
],
11+
"features": {},
12+
13+
// Use 'postCreateCommand' to run commands after the container is created.
14+
"postCreateCommand": "./.devcontainer/postCreateCommand.sh",
15+
16+
// Configure tool-specific properties.
17+
"customizations": {
18+
"vscode": {
19+
"extensions": ["ms-python.python", "editorconfig.editorconfig"],
20+
"settings": {
21+
"python.testing.pytestArgs": ["tests"],
22+
"python.testing.unittestEnabled": false,
23+
"python.testing.pytestEnabled": true,
24+
"python.defaultInterpreterPath": "/workspaces/python-package/.venv/bin/python",
25+
"python.testing.pytestPath": "/workspaces/python-package/.venv/bin/pytest"
26+
}
27+
}
28+
}
29+
}

.devcontainer/postCreateCommand.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#! /usr/bin/env bash
2+
3+
# Install uv
4+
curl -LsSf https://astral.sh/uv/install.sh | sh
5+
6+
# Install Dependencies
7+
uv sync
8+
9+
# Install pre-commit hooks
10+
uv run pre-commit install --install-hooks
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "Setup Python Environment"
2+
description: "Set up Python environment for the given Python version"
3+
4+
inputs:
5+
python-version:
6+
description: "Python version to use"
7+
required: true
8+
default: "3.12"
9+
uv-version:
10+
description: "uv version to use"
11+
required: true
12+
default: "0.6.14"
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: ${{ inputs.python-version }}
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v6
23+
with:
24+
version: ${{ inputs.uv-version }}
25+
enable-cache: 'true'
26+
cache-suffix: ${{ matrix.python-version }}
27+
28+
- name: Install Python dependencies
29+
run: uv sync --frozen
30+
shell: bash

.github/workflows/labels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ jobs:
2626
https://raw.githubusercontent.com/biocommons/.github/main/etc/labels.yml
2727
.github/labels.yml
2828
29-
delete-other-labels: false
29+
delete-other-labels: false

.github/workflows/python-ci-cd.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Python CI/CD
2+
permissions:
3+
contents: write
4+
id-token: write
5+
6+
on:
7+
pull_request:
8+
branches: [ "main" ]
9+
push:
10+
tags:
11+
- "[0-9]+.[0-9]+.[0-9]+"
12+
13+
jobs:
14+
python-ci-cd:
15+
name: python-ci-cd
16+
permissions:
17+
contents: write
18+
id-token: write
19+
uses: biocommons/.github/.github/workflows/python-ci-cd.yml@main
20+
with:
21+
run-deploy: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
22+
secrets: inherit

.github/workflows/python-package.yml

Lines changed: 0 additions & 139 deletions
This file was deleted.

.github/workflows/stale.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# https://github.com/actions/stale
2-
31
name: 'Close stale issues and PRs'
42
on:
53
workflow_dispatch:
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: validate-codecov-config
2+
3+
on:
4+
pull_request:
5+
paths: [codecov.yaml]
6+
push:
7+
branches: [main]
8+
9+
jobs:
10+
validate-codecov-config:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Validate codecov configuration
17+
run: curl -sSL --fail-with-body --data-binary @codecov.yaml https://codecov.io/validate

0 commit comments

Comments
 (0)