Skip to content

Commit b904188

Browse files
committed
Initial commit
0 parents  commit b904188

File tree

10 files changed

+166
-0
lines changed

10 files changed

+166
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"image": "mcr.microsoft.com/devcontainers/python:3.13",
3+
4+
"features": {
5+
"ghcr.io/jsburckhardt/devcontainer-features/uv:1": {},
6+
"ghcr.io/jsburckhardt/devcontainer-features/ruff:1": {},
7+
},
8+
9+
"customizations": {
10+
"vscode": {
11+
"extensions": [
12+
"ms-python.python",
13+
"ms-toolsai.jupyter"
14+
]
15+
}
16+
}
17+
}

.github/workflows/python_app.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Python app
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
run_ci:
11+
name: Lint/Format/Test
12+
runs-on: ubuntu-latest
13+
steps:
14+
- id: checkout
15+
name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v5
20+
21+
- name: Linting
22+
run: uvx ruff check
23+
24+
- name: Formatting
25+
run: uvx ruff format --check
26+
27+
- name: Testing
28+
run: uv run pytest tests

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Python-generated files
2+
__pycache__/
3+
*.py[oc]
4+
build/
5+
dist/
6+
wheels/
7+
*.egg-info
8+
9+
# Virtual environments
10+
.venv
11+
12+
# Vs Code settings
13+
.vscode

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM python:3.13-slim
2+
3+
## Install uv
4+
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates
5+
ADD https://astral.sh/uv/install.sh /uv-installer.sh
6+
RUN sh /uv-installer.sh && rm /uv-installer.sh
7+
ENV PATH="/root/.local/bin/:$PATH"
8+
9+
# Configure uv
10+
ENV UV_LINK_MODE=copy \
11+
UV_COMPILE_BYTECODE=1 \
12+
UV_PYTHON_DOWNLOADS=never \
13+
UV_PYTHON=python3.13 \
14+
UV_PROJECT_ENVIRONMENT=/usr/local/
15+
16+
## Install package
17+
WORKDIR /app
18+
ADD pyproject.toml uv.lock /app/
19+
RUN uv sync --no-dev --locked --no-install-package sligro
20+
ADD src /app
21+
RUN uv sync --no-dev --locked --no-editable

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# python-project-setup-with-uv

pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[project]
2+
name = "python-project-setup-with-uv"
3+
version = "0.1.0"
4+
description = "Add your description here"
5+
readme = "README.md"
6+
requires-python = ">=3.13"
7+
dependencies = []
8+
9+
[dependency-groups]
10+
dev = [
11+
"pytest>=8.3.5",
12+
]

src/example_project/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def main():
2+
print("Hello from python-project-setup-with-uv!")

tests/test_main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
def test_main():
2+
assert True

uv.lock

Lines changed: 69 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)