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: CONTRIBUTING.md
+51-13Lines changed: 51 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ A collection of useful resources to reference when developing new features:
9
9
10
10
## Local Development
11
11
12
-
This package utilizes [flit](https://flit.readthedocs.io) as the build engine, and [tox](https://tox.readthedocs.io) for test automation.
12
+
This package utilizes [uv](https://docs.astral.sh/uv) as the build engine, and [tox](https://tox.readthedocs.io) for test automation.
13
13
14
14
To install these development dependencies:
15
15
@@ -35,7 +35,7 @@ The easiest way to write tests, is to edit `tests/fixtures.md`
35
35
To run the code formatting and style checks:
36
36
37
37
```bash
38
-
tox -e py312-pre-commit
38
+
tox -e py312-prek
39
39
```
40
40
41
41
or directly with [prek](https://github.com/j178/prek) (or pre-commit)
@@ -79,21 +79,59 @@ Or with pipx:
79
79
pipx install . --include-deps --force --editable
80
80
```
81
81
82
-
## Publish to PyPi
82
+
## Publish to PyPI
83
83
84
-
First, update the version in `mdformat_mkdocs/__init__.py`
84
+
This project uses [PyPI Trusted Publishers](https://docs.pypi.org/trusted-publishers) for secure, token-free publishing from GitHub Actions, with [uv](https://docs.astral.sh/uv) for building packages.
85
85
86
-
Then, either use the Github Action by committing the new version in `__init__.py` and pushing an associated tag in format: `v#.#.#` (e.g. `v1.3.2` for `__version__ = '1.3.2'`)
86
+
### Initial Setup (One-time)
87
87
88
-
Or run flit locally:
88
+
Before publishing for the first time, you need to configure Trusted Publishing on PyPI:
- Go to your repository's `Settings` → `Environments`
100
+
- Create an environment named `pypi`
101
+
- (Recommended) Enable "Required reviewers" for production safety
102
+
103
+
### Publishing a Release
104
+
105
+
#### Option 1: Using commitizen (Recommended)
106
+
107
+
Use commitizen to automatically bump versions and create a commit with tag:
108
+
109
+
```sh
110
+
# Dry run to preview the version bump
111
+
tox -e py312-cz -- --dry-run
112
+
113
+
# Automatically bump version based on conventional commits
114
+
tox -e py312-cz
94
115
95
-
flit publish
116
+
# Or manually specify the increment type
117
+
tox -e py312-cz -- --increment PATCH # or MINOR or MAJOR
118
+
119
+
# Push the commit and tag
120
+
git push origin main --tags
121
+
```
122
+
123
+
Commitizen will automatically update versions in `pyproject.toml` and `mdformat_mkdocs/__init__.py`.
124
+
125
+
#### Option 2: Manual Version Bump
126
+
127
+
Update the versions in both `pyproject.toml` under `[project].version` and `mdformat_mkdocs/__init__.py` for `__version__`. Commit the change and push a tag in the form `vX.Y.Z` (for example, `v1.3.2` when the project version is `1.3.2`):
0 commit comments