Skip to content

Commit f1a73ca

Browse files
committed
Merge branch 'main' into 20260415_ksf_surf_maps_data_visualisation
2 parents a97d947 + 60b7b5d commit f1a73ca

2 files changed

Lines changed: 72 additions & 1 deletion

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
21
### [20260415 KSF Surf Maps: Data Visualisation](articles/20260415_ksf_surf_maps_data_visualisation/20260415_ksf_surf_maps_data_visualisation.md)
32

43
> _Charts and insights for surf maps on KSF servers_
54
5+
### [20260204 Python Repo Practices](articles/20260204_python_repo_practices/20260204_python_repo_practices.md)
6+
7+
> _Rules of thumb for python repos_
8+
69
### [20260123 ANSI to UTF8 Part 1: Intro](articles/20260123_ansi_to_utf8_part_1_intro/20260123_ansi_to_utf8_part_1_intro.md)
710

811
> _My journey converting ANSI art files for my linux terminal_
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# 20260204 Python Repo Practices
2+
3+
- [Setting up a new Python repo](#setting-up-a-new-python-repo)
4+
- [Examples](#examples)
5+
- [Basic structure](#basic-structure)
6+
7+
---
8+
9+
## Setting up a new Python repo
10+
11+
12+
0. Create the repository via the Github web UI
13+
- This allows you to add a README.md, and a .gitignore for Python (super handy!)
14+
- Add a license if desired (BSD-3-Clause is a good default)
15+
- Clone the repo to your local machine
16+
17+
1. Install uv on your local machine
18+
- Follow the instructions at https://docs.astral.sh/uv/#installation
19+
20+
2. Create a `pyproject.toml` file
21+
- Define some basic dependencies in it
22+
23+
3. Run `uv sync` to create the `uv.lock` file
24+
25+
4. Create your dirs
26+
27+
- `ops/` - for Dockerfiles, CI/CD configs, etc.
28+
- `test/` - for your unit tests
29+
- `<your_package_name>/` - for your main package code
30+
- _make sure it's underscored, not hyphenated_
31+
- and matches the name in `pyproject.toml`
32+
33+
5. Add a Dockerfile in `ops/` if desired
34+
- Copy one of the templates from this repo: https://github.com/astral-sh/uv-docker-example
35+
36+
5. Add a `Makefile` for common tasks
37+
- e.g., `make build`, `make test`, `make lint`, etc.
38+
39+
6. Make sure there is an `__init__.py` file in
40+
- the `test/` directory
41+
- This ensures that the tests can be discovered and run properly
42+
- the main package directory
43+
- This ensures that the package is recognized as a module
44+
45+
7. Commit and push your changes to GitHub
46+
47+
## Examples
48+
49+
### Basic structure
50+
51+
An example from one of my projects:
52+
53+
```
54+
.
55+
├── LICENSE
56+
├── Makefile
57+
├── README.md
58+
├── abn_lookup_service
59+
│   └── lookup.py
60+
├── ops
61+
│   ├── Dockerfile
62+
├── pyproject.toml
63+
├── test
64+
│   ├── __init__.py
65+
│   └── test_lookup.py
66+
└── uv.lock
67+
```
68+

0 commit comments

Comments
 (0)