You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/develop.md
+61Lines changed: 61 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,4 +30,65 @@ writing to INFO level to show what is starting and stopping, respectively.
30
30
Detailed messages should be logged to DEBUG level so they will not appear on the
31
31
console by default.
32
32
33
+
## Building the project
34
+
35
+
The project uses [Hatch](https://hatch.pypa.io/) as its build system with [hatchling](https://hatch.pypa.io/latest/plugins/builder/wheel/) as the build backend. The build configuration is defined in `pyproject.toml`.
36
+
37
+
### Development installation
38
+
39
+
For development, you can install the project in editable mode:
40
+
41
+
```bash
42
+
# You can spawn a shell within an environment by using the hatch shell command.
43
+
# It installs the project in editable/development mode.
44
+
hatch shell
45
+
46
+
# Check if fromager is installed and available in the path
47
+
which fromager
48
+
```
49
+
50
+
Note: When a package is installed in editable/development mode, you can make changes to its source code directly. These changes are immediately reflected in your Python environment without needing to reinstall the package.
51
+
52
+
### Quick build
53
+
54
+
To build the project (both source distribution and wheel), use:
55
+
56
+
```bash
57
+
hatch build
58
+
```
59
+
60
+
This will create both `.tar.gz` (source distribution) and `.whl` (wheel) files in the `dist/` directory.
61
+
62
+
You can build specific formats by using `hatch build -t wheel` or `hatch build -t sdist`.
63
+
64
+
Alternatively, you can use the standard `build` module (which is included in the `[project.optional-dependencies.build]` section):
65
+
66
+
```bash
67
+
# Install build dependencies first
68
+
pip install build twine
69
+
70
+
# Build the project
71
+
python -m build
72
+
```
73
+
74
+
### Package validation
75
+
76
+
To validate the built packages, you can use the package linting script:
77
+
78
+
```bash
79
+
hatch run lint:pkglint
80
+
```
81
+
82
+
This command will:
83
+
84
+
1. Build the project using `python -m build`
85
+
2. Check the built packages with `twine check dist/*.tar.gz dist/*.whl`
86
+
3. Validate Python version consistency between `pyproject.toml` and GitHub Actions workflows
87
+
88
+
The validation will fail if:
89
+
90
+
- The package metadata is malformed
91
+
- Required files are missing from the distribution
92
+
- Python version requirements are inconsistent across configuration files
0 commit comments