|
1 | 1 | # python-uv-devcontainer
|
2 | 2 |
|
3 |
| -[](https://github.com/astral-sh/uv) [](https://github.com/astral-sh/ruff) [](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/dunnkers/python-uv-devcontainer.git) |
| 3 | +[](https://github.com/astral-sh/ruff) [](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/dunnkers/python-uv-devcontainer.git) |
4 | 4 |
|
5 | 5 |
|
6 | 6 | Python project setup using a [Devcontainer](https://containers.dev) and [uv](https://github.com/astral-sh/uv).
|
7 | 7 |
|
8 | 8 | ## Features
|
9 | 9 |
|
10 | 10 | - [x] [Devcontainer](https://github.com/devcontainers/images/tree/main/src/python) running Python 3.13
|
11 |
| -- [x] [uv](https://github.com/astral-sh/uv) for dependency management and virtual environment management |
12 |
| -- [x] [pytest](https://docs.pytest.org/en/stable/) for testing |
| 11 | +- [x] [uv](https://github.com/astral-sh/uv) for dependency management and virtual environment management [](https://github.com/astral-sh/uv) |
13 | 12 | - [x] [ruff](https://github.com/astral-sh/ruff) for formatting and linting
|
| 13 | +- [x] [pytest](https://docs.pytest.org/en/stable/) for testing |
14 | 14 | - [x] [GitHub Actions](https://github.com/dunnkers/python-uv-devcontainer/actions) for CI/CD
|
15 | 15 | - [x] [Dockerfile](https://github.com/dunnkers/python-uv-devcontainer/blob/main/Dockerfile) for easy deployment
|
16 | 16 |
|
17 | 17 | ## Setup
|
18 | 18 |
|
19 |
| -Setup is easy. Open this repo in a [GitHub Codespace](https://github.com/features/codespaces) or in a [VSCode Devcontainer](https://code.visualstudio.com/docs/devcontainers/create-dev-container). |
20 |
| - |
21 |
| -1. **GitHub Codespace** |
22 |
| - |
23 |
| - [](https://codespaces.new/dunnkers/python-uv-devcontainer?quickstart=1) |
| 19 | +Setup is easy. Follow these steps to setup using **VSCode**: |
24 | 20 |
|
25 |
| -2. **VSCode Devcontainer** |
| 21 | +1. **Use this template** |
26 | 22 |
|
27 |
| - 1. **Use this template** |
28 |
| - |
29 |
| - <a href="https://github.com/new?template_name=python-uv-devcontainer&template_owner=dunnkers"><img src="https://github.com/user-attachments/assets/45df28b9-9210-4cd4-a6c5-25ad3c8edb55" alt="Use this template and create new repository" width="250"/></a> |
30 |
| - |
31 |
| - [Create a new repository](https://github.com/new?template_name=python-uv-devcontainer&template_owner=dunnkers) based on this template. |
| 23 | + <a href="https://github.com/new?template_name=python-uv-devcontainer&template_owner=dunnkers"><img src="https://github.com/user-attachments/assets/45df28b9-9210-4cd4-a6c5-25ad3c8edb55" alt="Use this template and create new repository" width="250"/></a> |
| 24 | + |
| 25 | + [Create a new repository](https://github.com/new?template_name=python-uv-devcontainer&template_owner=dunnkers) based on this template. |
32 | 26 |
|
33 |
| - 2. **Clone repo** |
| 27 | + > Alternatively, you can also open the repository in a GitHub Codespace: |
| 28 | + > [](https://codespaces.new/dunnkers/python-uv-devcontainer?quickstart=1) |
34 | 29 |
|
35 |
| - <img src="https://github.com/user-attachments/assets/3aa1891b-d19b-4c8e-acad-b5e46eb18250" alt="Clone repository" width="375"/> |
| 30 | +2. **Clone repo** |
36 | 31 |
|
37 |
| - Open the repo in VSCode. |
| 32 | + <img src="https://github.com/user-attachments/assets/3aa1891b-d19b-4c8e-acad-b5e46eb18250" alt="Clone repository" width="375"/> |
38 | 33 |
|
39 |
| - > [!TIP] |
40 |
| - > This Devcontainer can also be directly used with a GitHub Codespace. |
41 |
| - > |
| 34 | + Open the repo in VSCode. |
42 | 35 |
|
43 |
| - 3. **Reopen in Container** |
| 36 | +3. **Reopen in Container** |
44 | 37 |
|
45 |
| - Click the button in the popup upon opening the repo: |
46 |
| - |
47 |
| - <img src="https://github.com/user-attachments/assets/c89c6643-768b-427d-b10f-a51ddbe76282" alt="Dev Containers: Reopen in Container" width="475"/> |
| 38 | + Click the button in the popup upon opening the repo: |
| 39 | + |
| 40 | + <img src="https://github.com/user-attachments/assets/c89c6643-768b-427d-b10f-a51ddbe76282" alt="Dev Containers: Reopen in Container" width="475"/> |
48 | 41 |
|
49 |
| - Alternatively, enter <kbd>Ctrl+Shift+P</kbd> and select **Dev Containers: Reopen in Container**. |
| 42 | + Alternatively, enter <kbd>Ctrl+Shift+P</kbd> and select **Dev Containers: Reopen in Container**. |
50 | 43 |
|
51 |
| - 4. **Wait for setup to finish** |
| 44 | +4. **Wait for setup to finish** |
52 | 45 |
|
53 |
| - Upon opening the Devcontainer, setup will start. Wait for the setup to finish before continuing. |
| 46 | + Upon opening the Devcontainer, setup will start. Wait for the setup to finish before continuing. |
54 | 47 |
|
55 |
| - <img src="https://github.com/user-attachments/assets/28dceed1-abb2-4be5-aa25-ff1c8ad38455" alt="Wait for postCreateCommand to finish" width="600"/> |
| 48 | + <img src="https://github.com/user-attachments/assets/28dceed1-abb2-4be5-aa25-ff1c8ad38455" alt="Wait for postCreateCommand to finish" width="600"/> |
56 | 49 |
|
57 |
| - 5. **Select Python interpreter** |
| 50 | +5. **Select Python interpreter** |
58 | 51 |
|
59 |
| - Enter <kbd>Ctrl+Shift+P</kbd> and select **Python: Select Interpreter**. |
| 52 | + Enter <kbd>Ctrl+Shift+P</kbd> and select **Python: Select Interpreter**. |
60 | 53 |
|
61 |
| - <img src="https://github.com/user-attachments/assets/3efa1de7-5bd3-4b1e-aaa8-455773396c81" alt="VSCode: Python Select Interpreter" width="500"/> |
| 54 | + <img src="https://github.com/user-attachments/assets/3efa1de7-5bd3-4b1e-aaa8-455773396c81" alt="VSCode: Python Select Interpreter" width="500"/> |
62 | 55 |
|
63 |
| - Select the **venv** (`./.venv/bin/python`). |
| 56 | + Select the **venv** (`./.venv/bin/python`). |
64 | 57 |
|
65 | 58 | 3. **Enjoy 🫶**
|
66 | 59 |
|
|
0 commit comments