Skip to content

Commit 31f9972

Browse files
committed
Update the dense-python blog post
1 parent 57b1cb2 commit 31f9972

File tree

1 file changed

+46
-12
lines changed

1 file changed

+46
-12
lines changed

content/blog/post/2025-07-01-dense-python-template.md

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,65 @@ type: post
33
title: Introducing dense-python
44
author: Andrew Wray
55
subtitle: A convenient template for new Python projects
6-
date: 2025-07-01
6+
date: 2025-07-06
77
summary: The dense-python repository provides a reusable template for starting Python projects quickly.
88
tags: ["python", "template"]
99
---
1010

11-
Dense Analysis has released **dense-python**, a template repository designed to help developers spin up new Python projects with minimal setup. The repository collects a set of best practices used across Dense Analysis projects and packages them into a starting point you can clone and modify.
11+
Dense Analysis has released
12+
[dense-python](https://github.com/dense-analysis/dense-python), a template
13+
repository designed to help developers spin up new Python projects with minimal
14+
setup. The repository collects a set of best practices used across Dense
15+
Analysis projects and packages them into a starting point you can clone and
16+
modify.
1217

13-
Available on [GitHub](https://github.com/dense-analysis/dense-python), the template comes preconfigured with modern tooling for formatting, linting, static type checks, and continuous integration. By cloning the repository and customizing it for your work, you can skip much of the boilerplate configuration typically required when starting from scratch.
18+
Available on [GitHub](https://github.com/dense-analysis/dense-python), the
19+
template comes preconfigured with modern tooling for formatting, linting, static
20+
type checks, and continuous integration. By cloning the repository and
21+
customizing it for your work, you can skip much of the boilerplate configuration
22+
typically required when starting from scratch.
1423

1524
### Distroless Python containers
1625

17-
For containerized deployments, dense-python includes a reproducible build pipeline that produces distroless images. Distroless containers ship only the Python runtime and your project code, resulting in smaller and more secure images than traditional distributions. The provided `Dockerfile` demonstrates how to compile wheels with the `uv` build tool and copy them into the final distroless image. Read more about the advantages in [this article on distroless Python images](https://pythonspeed.com/articles/distroless-python/).
26+
For containerized deployments, `dense-python` includes a reproducible build
27+
pipeline that produces distroless images. Distroless containers ship only the
28+
Python runtime and your project code, resulting in smaller and more secure
29+
images than traditional distributions. The provided `Dockerfile` demonstrates
30+
how to compile wheels with the `uv` build tool and copy them into the final
31+
distroless image. Read more about the advantages in [this article on distroless
32+
Python images](https://alex-moss.medium.com/creating-an-up-to-date-python-distroless-container-image-e3da728d7a80).
1833

19-
### Testing with network isolation
34+
### Testing with Network Isolation By Default
2035

21-
The template configures **pytest** so that tests run with socket access disabled by default. This makes it easy to catch accidental network calls in unit tests. Strict marker checking is also enabled, ensuring that every custom marker is declared in your configuration. Together, these settings help keep tests fast and deterministic.
36+
The template configures **pytest** so that tests run with socket access disabled
37+
by default. This makes it easy to catch accidental network calls in unit tests.
38+
Strict marker checking is also enabled, ensuring that every custom marker is
39+
declared in your configuration. You can decorate tests with
40+
`@pytest.mark.allow_network` to enable network access for them explictly.
41+
Together, these settings help keep tests fast and deterministic.
2242

23-
### Pyright type checking
43+
### Pyright Type Checking
2444

25-
Static type checking is handled by [**Pyright**](https://github.com/microsoft/pyright), the engine behind Pylance in VS Code and also used by Cursor. It offers quick feedback on type annotations without slowing down development. A ready-to-use `pyrightconfig.json` is included so that type errors are caught early.
45+
Static type checking is handled by
46+
[**Pyright**](https://github.com/microsoft/pyright), the engine behind
47+
[Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance)
48+
in VSCode and also used by [Cursor](https://cursor.com). It offers quick
49+
feedback on type annotations without slowing down development. A ready-to-use
50+
`pyproject.toml` configuration is included so that type errors are caught early.
51+
As ever Dense Analysis recommends using [the
52+
DAFT](https://denseanalysis.org/projects/daft/) for programming over proprietary
53+
editors, but they may also be easily configured.
2654

27-
### Package builds with uv
55+
### Package Builds with uv
2856

29-
Instead of `pip`, dense-python relies on the lightning-fast `uv` tool to create virtual environments and build distribution packages. This speeds up the packaging process and ensures consistent builds across platforms.
57+
Instead of naked `pip`, `dense-python` relies on the lightning-fast
58+
[uv](https://github.com/astral-sh/uv) tool to create virtual environments and
59+
build distribution packages. This speeds up the packaging process and ensures
60+
consistent builds across platforms.
3061

31-
### Open for contributions
62+
### Open for Contributions!
3263

33-
Dense-python is open source and welcomes contributions. If you find a useful improvement or fix, open a pull request or start a discussion on the project page. We hope this template saves you time on setup so you can focus on writing code.
64+
`dense-python` is FOSS and welcomes contributions. If you find a useful
65+
improvement or fix, open a pull request or start a discussion on the project
66+
page. We hope this template saves you time on setup so you can focus on writing
67+
code.

0 commit comments

Comments
 (0)