Skip to content

Commit 66d95a4

Browse files
committed
feat: add python
0 parents  commit 66d95a4

9 files changed

Lines changed: 290 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: "Setup Python Workspace"
3+
description: "Configure Python tools with UV"
4+
5+
runs:
6+
using: composite
7+
steps:
8+
- name: Install uv
9+
uses: astral-sh/setup-uv@v6
10+
11+
- name: Set up Python
12+
uses: actions/setup-python@v5
13+
with:
14+
python-version-file: "pyproject.toml"
15+
16+
- name: Install requirements
17+
shell: bash
18+
run: uv sync --locked --all-extras --dev
19+
20+
- name: Install Just
21+
uses: extractions/setup-just@v2

.github/release_notes_template.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# vX.Y.Z
2+
3+
## Changes
4+
5+
- _Type your changes here_
6+
- _Type your changes here_

.github/workflows/pre-commit.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Linting
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Install linters
18+
run: |
19+
pip install --upgrade pip
20+
pip install pre-commit
21+
22+
- name: Run linters
23+
run: pre-commit run --all-files

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Python-generated files
2+
__pycache__/
3+
*.py[oc]
4+
build/
5+
dist/
6+
wheels/
7+
*.egg-info
8+
.python-version
9+
10+
# Testing
11+
.coverage
12+
htmlcov/
13+
.pytest_cache/
14+
15+
# Virtual environments
16+
*venv
17+
18+
# Local development
19+
.vscode
20+
.idea
21+
.DS_Store

.pre-commit-config.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
fail_fast: false
3+
4+
repos:
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v6.0.0
7+
hooks:
8+
- id: trailing-whitespace
9+
- id: end-of-file-fixer
10+
- id: check-yaml
11+
- id: check-added-large-files
12+
- id: check-merge-conflict
13+
- id: detect-private-key
14+
15+
- repo: https://github.com/astral-sh/uv-pre-commit
16+
rev: 0.8.18
17+
hooks:
18+
- id: uv-lock
19+
20+
- repo: https://github.com/codespell-project/codespell.git
21+
rev: v2.4.1
22+
hooks:
23+
- id: codespell
24+
args: [-w]
25+
files: ^.*\.(md|py|jinja|yaml|yml|sh|feature)$
26+
27+
- repo: https://github.com/pre-commit/mirrors-prettier
28+
rev: v4.0.0-alpha.8
29+
# Otherwise will fail on commit-msg hook
30+
hooks:
31+
- id: prettier
32+
stages: [pre-commit]
33+
exclude: Pipfile.lock
34+
35+
- repo: https://github.com/pycqa/isort
36+
rev: 6.0.1
37+
hooks:
38+
- id: isort
39+
args: ["--profile", "black", "--skip-glob", "/builds/*"]
40+
41+
# Python code formatting
42+
- repo: https://github.com/psf/black
43+
rev: 25.9.0
44+
hooks:
45+
- id: black
46+
47+
# Python code formatting in code blocks inside docs
48+
- repo: https://github.com/asottile/blacken-docs
49+
rev: 1.20.0
50+
hooks:
51+
- id: blacken-docs
52+
additional_dependencies: [black==22.3.0]
53+
54+
# Security
55+
- repo: https://github.com/Yelp/detect-secrets
56+
rev: v1.5.0
57+
hooks:
58+
- id: detect-secrets
59+
60+
# Ensure version sync
61+
- repo: https://github.com/zricethezav/gitleaks
62+
rev: v8.28.0
63+
hooks:
64+
- id: gitleaks

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# DevOps Actions
2+
3+
This repository contains a collection of GitHub Actions that can be used to automate
4+
various aspects of your development workflow.

pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[project]
2+
name = "devops-actions"
3+
version = "0.1.0"
4+
description = "Common GitHub Actions for DevOps operations"
5+
readme = "README.md"
6+
requires-python = ">=3.12"
7+
dependencies = [
8+
"pre-commit>=4.3.0",
9+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: "Setup UV"
3+
description: "Configure Python tools with UV"
4+
5+
runs:
6+
using: composite
7+
steps:
8+
- name: Install uv
9+
uses: astral-sh/setup-uv@v6
10+
11+
- name: Set up Python
12+
uses: actions/setup-python@v5
13+
with:
14+
python-version-file: "pyproject.toml"
15+
16+
- name: Install requirements
17+
shell: bash
18+
run: uv sync --locked --all-extras --dev

uv.lock

Lines changed: 124 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)