simple-releaser 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+
6
+ # virtual environments / tool state
7
+ /.venv
8
+ /.pytest_cache
9
+ /.ruff_cache
10
+ /.coverage
11
+ /dist/
12
+ .env
13
+
14
+ # Ignore my dev stash directories
15
+ /_*
@@ -0,0 +1,65 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
+
8
+
9
+ ## Unreleased
10
+
11
+ ### Changed
12
+
13
+
14
+ ## 0.0.1 - 2026-09-08
15
+
16
+ ### Added & Changed
17
+
18
+ - Read the project check command from `releaser.toml`.
19
+ - Read the project build command from `releaser.toml`, with an `{output}`
20
+ placeholder for the temporary artifact directory.
21
+ - Read the project publish command from `releaser.toml`, with placeholders for
22
+ the archived release directory, wheel, and source distribution.
23
+ - Add GitHub support and use `repo_host` as the general configuration term for
24
+ services like Codeberg and GitHub.
25
+ - Split repository-host implementations into `simple_releaser.codeberg` and
26
+ `simple_releaser.github`.
27
+ - Split command-line handling, release workflow, and release exceptions into
28
+ `simple_releaser.cli`, `simple_releaser.releaser`, and
29
+ `simple_releaser.exceptions`.
30
+ - Discover Codeberg or GitHub automatically from the Git `origin`, while
31
+ retaining `repo_host` as an explicit override for unusual layouts.
32
+ - Read the Git release tag prefix from `releaser.toml`, defaulting to `v`.
33
+ - Require `releaser.toml` in the invocation directory and allow it to select a
34
+ separate Python project with `project_path`.
35
+ - Allow the `releaser.toml` filename to be overridden with `RELEASER_CONFIG`.
36
+ - Rename the publishing CLI tasks to `to_pypi` and `to_repo`, and expose
37
+ `clean` as a direct clean-repository check.
38
+ - Allow configured commands to be written as shell-like strings as well as TOML
39
+ arrays of argument strings.
40
+ - Make `commands.run` an ordered, configurable task sequence.
41
+ - Allow empty configurable commands to skip their corresponding tasks.
42
+ - Expose `clean` and `validate` as task names that may be included in a
43
+ configured run sequence, and prevent `run` from recursively invoking itself.
44
+ - Add global `--dry-run` support that performs release preflight while describing
45
+ configured commands, archive creation, tagging, and publication without making
46
+ changes.
47
+ - Use PyPA `build` and Twine for the default build and PyPI publish commands, and
48
+ expose `{python}` as the Python interpreter running Simple Releaser for command
49
+ overrides.
50
+ - Add `show-config` to display the current configuration and project metadata.
51
+ - Require confirmation before publishing distributions to PyPI, with an
52
+ `auto_confirm` configuration option for unattended releases.
53
+ - Print PyPI and repository release-page links around publication so the
54
+ published state is easy to inspect.
55
+ - Implement `init` to create minimal releaser configuration.
56
+ - Add documentation about GitHub Actions and PyPI Trusted Publishing.
57
+ - Add documentation about alternative release orchestration tools.
58
+
59
+
60
+ ## 0.0.0 - 2026-08-27 (Unreleased)
61
+
62
+ ### Added
63
+
64
+ - Initial copy from QRtsy project, https://codeberg.org/newbery/qrtsy
65
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ricardo Newbery
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,401 @@
1
+ Metadata-Version: 2.5
2
+ Name: simple-releaser
3
+ Version: 0.0.1
4
+ Summary: A small tool for prepping and publishing Python package releases.
5
+ Project-URL: repository, https://codeberg.org/newbery/simple-releaser
6
+ Project-URL: issues, https://codeberg.org/newbery/simple-releaser/issues
7
+ Author-email: Ricardo Newbery <ric@digitalmarbles.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Classifier: Topic :: Software Development :: Build Tools
19
+ Classifier: Topic :: System :: Software Distribution
20
+ Requires-Python: >=3.11
21
+ Requires-Dist: build<2.0.0,>=1.6.0
22
+ Requires-Dist: markdown-it-py<5.0.0,>=4.0.0
23
+ Requires-Dist: packaging<27.0,>=25.0
24
+ Requires-Dist: python-dotenv<2.0.0,>=1.1.0
25
+ Requires-Dist: twine<8.0.0,>=7.0.0
26
+ Description-Content-Type: text/markdown
27
+
28
+ > ⚠️ **Warning** ⚠️
29
+ > Simple Releaser is alpha software and probably not yet ready for general use.
30
+ > Expect rough edges, breaking changes, and an occasional gremlin.
31
+
32
+
33
+ # Simple Releaser
34
+
35
+ Simple Releaser is a configurable command-line tool for validating, building,
36
+ tagging, and publishing Python package releases.
37
+
38
+ The PyPI distribution is named `simple-releaser`. Once installed, it can be
39
+ invoked as either `simple-releaser` or `release`.
40
+
41
+ Simple Releaser grew out of a direct copy of the release workflow used by the
42
+ [QRtsy Project](https://codeberg.org/newbery/qrtsy) with significant changes
43
+ to generalize it to accommodate different release workflows. Simple Releaser
44
+ is deliberately designed to be ***simple*** and is unlikely to grow much beyond
45
+ this initial vision. If you've got more complex needs, you may wish to
46
+ [consider some alternatives](docs/alternative-release-tools.md).
47
+
48
+
49
+ ## Project assumptions
50
+
51
+ Run Simple Releaser from a directory containing the releaser configuration
52
+ (`releaser.toml` by default). This directory may also be the project root,
53
+ or the releaser configuration may point at a separate project directory.
54
+
55
+ The project being released is expected to have:
56
+
57
+ - Project configuration, including name and version, in `pyproject.toml`.
58
+ - A changelog file named `CHANGELOG.md`, with `Unreleased` and version sections.
59
+ - A Git repo with an `origin` remote.
60
+
61
+ When publishing a repository release locally, the project is also expected
62
+ to have:
63
+
64
+ - A repository hosted by Codeberg or GitHub.
65
+ - A .env file beside the releaser configuration when a host token or repository
66
+ override is needed.
67
+
68
+
69
+ ## Installation
70
+
71
+ A convenient way to install Simple Releaser as a standalone command-line
72
+ tool is with [`pipx`](https://pipx.pypa.io/):
73
+
74
+ ```console
75
+ pipx install simple-releaser
76
+ ```
77
+
78
+ Once installed, Simple Releaser can then be invoked as either:
79
+
80
+ ```console
81
+ release
82
+ ```
83
+
84
+ or:
85
+
86
+ ```console
87
+ simple-releaser
88
+ ```
89
+
90
+
91
+ ## Commands
92
+
93
+ The available CLI commands are:
94
+
95
+ ```console
96
+ release -h
97
+ usage: release [-h] [--dry-run] {init,show-config,clean,validate,build,tag,to_pypi,to_repo,run} ...
98
+
99
+ Validate, build, archive, and publish Python project releases.
100
+
101
+ A simple project release policy:
102
+ - Validate that release is ready
103
+ - Run any project-specific checks
104
+ - Build package and archive it
105
+ - Create release tag
106
+ - Publish package to PyPI
107
+ - Publish release and assets to repository host
108
+
109
+ positional arguments:
110
+ {init,show-config,clean,validate,build,tag,to_pypi,to_repo,run}
111
+ init initialize Simple Releaser configuration
112
+ show-config show resolved configuration and project metadata
113
+ clean check if project is a clean git repository
114
+ validate validate that a new release is ready
115
+ build build and archive the current version
116
+ tag create and push the current release tag
117
+ to_pypi publish the archived distributions to PyPI
118
+ to_repo publish the release to repository host
119
+ run run the configured release process
120
+
121
+ options:
122
+ -h, --help show this help message and exit
123
+ --dry-run show what would be done without making changes
124
+ ```
125
+
126
+ ### Dry run
127
+
128
+ Pass `--dry-run` before or after a command to perform the normal read-only
129
+ preflight and describe the release actions without making changes. For example:
130
+
131
+ ```console
132
+ release run --dry-run
133
+ release --dry-run tag
134
+ ```
135
+
136
+ Dry-run mode still reads project/repository metadata, checks that the Git working
137
+ tree is clean, validates the version and changelog, and inspects existing Git
138
+ tags. It does not run configured project commands, create the release archive,
139
+ create or push Git tags, publish to PyPI, or call the Codeberg/GitHub release
140
+ APIs. Because the build is simulated, later dry-run tasks use descriptive
141
+ artifact placeholders rather than requiring `_releases/<version>` to already
142
+ exist.
143
+
144
+ The read-only `show-config`, `clean`, and `validate` commands behave the same
145
+ with or without `--dry-run`.
146
+
147
+
148
+ ### Initialization
149
+
150
+ Run `release init` from the directory where the releaser configuration should
151
+ live:
152
+
153
+ ```console
154
+ release init
155
+ ```
156
+
157
+ If that directory contains the `pyproject.toml` for a project, Simple Releaser
158
+ creates a minimal `releaser.toml` for that project. Otherwise it prompts for
159
+ the project directory and then records the given `project_path` in the generated
160
+ configuration. Relative paths are used when possible. An existing releaser
161
+ configuration is never overwritten.
162
+
163
+ `release init --dry-run` performs the same project discovery but only reports
164
+ where the configuration would be created.
165
+
166
+
167
+ ## Configuration
168
+
169
+ Simple Releaser requires a configuration file in the current working directory.
170
+ By default it is named `releaser.toml`. To use a different filename, set the
171
+ `RELEASER_CONFIG` environment variable.
172
+
173
+ When the directory also contains the project's `pyproject.toml`, no project path
174
+ is needed:
175
+
176
+ ```toml
177
+ tag_prefix = "v"
178
+ auto_confirm = false
179
+
180
+ [commands]
181
+ run = "check build tag to_pypi to_repo"
182
+ ```
183
+
184
+ If the project lives elsewhere, `project_path` is required and must identify a
185
+ directory containing `pyproject.toml`. Relative paths are resolved from the
186
+ directory containing the releaser configuration; absolute paths are also
187
+ accepted. For example:
188
+
189
+ ```toml
190
+ project_path = "../my-project"
191
+ repo_host = "github"
192
+ tag_prefix = "v"
193
+ auto_confirm = false
194
+
195
+ [commands]
196
+ run = "check build tag to_pypi to_repo"
197
+ ```
198
+
199
+ Set `auto_confirm = true` at the top level to allow PyPI publication without an
200
+ interactive confirmation prompt, for example in a deliberately unattended
201
+ release workflow. It defaults to `false`; even with automatic confirmation,
202
+ Simple Releaser still prints the project/version/artifact summary and PyPI URL
203
+ before running the publish command.
204
+
205
+
206
+ ### Configurable commands
207
+
208
+ The `[commands]` section currently supports `check`, `build`, `publish`, and `run`.
209
+ A value may be either a shell-like string or a TOML array of argument strings.
210
+ The following forms are equivalent:
211
+
212
+ ```toml
213
+ check = "uv run pytest"
214
+ check = ["uv", "run", "pytest"]
215
+ ```
216
+
217
+ Quoting in a string may be used to preserve spaces within one argument:
218
+
219
+ ```toml
220
+ check = 'python -c "print(1 + 1)"'
221
+ ```
222
+
223
+ An empty string or empty array disables the task associated with that configured
224
+ command. For example:
225
+
226
+ ```toml
227
+ [commands]
228
+ check = ""
229
+ publish = ""
230
+ ```
231
+
232
+ causes the `check` and `to_pypi` tasks to be skipped. The `publish` configuration
233
+ name controls the `to_pypi` task.
234
+
235
+
236
+ ### Configuring `check`
237
+
238
+ The configured `check` command is the project's own test, lint, and quality
239
+ check. Since this is very project-specific, by default the `check` command
240
+ is disabled and must be customized for the project:
241
+
242
+ ```toml
243
+ [commands]
244
+ check = ""
245
+ ```
246
+
247
+ The `simple-releaser` project also uses its own tooling for releasing itself.
248
+ See the project's `releaser.toml` file for the configuration that it uses.
249
+ For this project, the releaser `check` command has been customized like so:
250
+
251
+ ```toml
252
+ [commands]
253
+ check = "hatch run poe check"
254
+ ```
255
+
256
+
257
+ ### Configuring `build` and `publish`
258
+
259
+ By default, Simple Releaser builds with `build` and publishes with `twine`:
260
+
261
+ ```toml
262
+ [commands]
263
+ build = "{python} -m build --outdir {output}"
264
+ publish = "{python} -m twine upload --skip-existing {wheel} {sdist}"
265
+ ```
266
+
267
+ Build and publish commands may use `{python}`, which expands to the absolute path
268
+ of the Python interpreter running Simple Releaser. This lets an override
269
+ deliberately use a tool installed alongside Simple Releaser rather than
270
+ whichever `python` happens to be on `PATH`.
271
+
272
+ The default publisher uses Twine's normal authentication mechanisms, including
273
+ keyring, `.pypirc`, and `TWINE_*` environment variables. The `.env` file read by
274
+ Simple Releaser for repository-host settings is not exported to subprocesses.
275
+
276
+ The `{output}` placeholder in `build` is replaced with the temporary directory
277
+ where the build command must write the wheel and source distribution. A
278
+ non-empty custom build command must include `{output}`. Publish commands may use
279
+ `{release_dir}`, `{wheel}`, and `{sdist}` to refer to the verified archived
280
+ release and its two distribution files. A custom publish command does not have
281
+ to use a placeholder when the command already knows how to locate the artifacts
282
+ it should publish.
283
+
284
+ The default build and publish commands work with most standards-compliant build
285
+ backends declared in the `[build-system]` section of a project's `pyproject.toml`
286
+ configuration. Projects that prefer their project-management tool's native build
287
+ and publish commands can override the defaults. Typical equivalents are:
288
+
289
+ ```toml
290
+ # Poetry
291
+ build = "poetry build --clean --output {output}"
292
+ publish = "poetry publish --skip-existing --dist-dir {release_dir}"
293
+
294
+ # Hatch
295
+ build = "hatch build --clean {output}"
296
+ publish = "hatch publish --no-prompt {wheel} {sdist}"
297
+
298
+ # uv
299
+ build = "uv build --no-sources --out-dir {output}"
300
+ publish = "uv publish {wheel} {sdist}"
301
+
302
+ # PDM
303
+ build = "pdm build --dest {output}"
304
+ publish = "pdm publish --no-build --skip-existing --dest {release_dir}"
305
+ ```
306
+
307
+
308
+ ### Configuring `run`
309
+
310
+ The `run` command is an ordered list of task names. Its default value is:
311
+
312
+ ```toml
313
+ [commands]
314
+ run = "check build tag to_pypi to_repo"
315
+ ```
316
+
317
+ The available run task names are `check`, `clean`, `validate`, `build`, `tag`,
318
+ `to_pypi`, and `to_repo`.
319
+
320
+ - `clean` is available for release flows that want an explicit clean-repository
321
+ check at a particular point, but this is usually unnecessary because release
322
+ validation already checks the working tree and tasks that require cleanliness
323
+ enforce it themselves.
324
+ - `validate` may also be included explicitly, but again this is usually unnecessary
325
+ since validation is already automatically done before `run` begins.
326
+
327
+ Both of these are included as options for custom release plans where revalidation
328
+ or additional clean checks might be useful.
329
+
330
+
331
+ #### Local and CI release strategies
332
+
333
+ The `run` sequence also determines where the release process stops.
334
+
335
+ The default sequence performs the complete release locally:
336
+
337
+ ```toml
338
+ [commands]
339
+ run = "check build tag to_pypi to_repo"
340
+ ```
341
+
342
+ For a project whose remote CI publishes after a release tag is pushed, omit the
343
+ local publication tasks:
344
+
345
+ ```toml
346
+ [commands]
347
+ run = "check build tag"
348
+ ```
349
+
350
+ Here the local `build` acts as a packaging preflight. Simple Releaser verifies
351
+ that the distributions can be built and archived before `tag` creates and pushes
352
+ the release tag. The remote workflow may then rebuild the tagged source and
353
+ publish its own artifacts.
354
+
355
+ Projects with expensive, platform-specific, or otherwise CI-authoritative builds
356
+ may omit the local build as well:
357
+
358
+ ```toml
359
+ [commands]
360
+ run = "check tag"
361
+ ```
362
+
363
+ In this form, Simple Releaser runs the project's configured `check` command and
364
+ then creates and pushes the release tag; the remote workflow is responsible for
365
+ both building and publishing. This avoids a duplicate local build, but a
366
+ packaging failure will not be discovered until after the release tag has been
367
+ pushed.
368
+
369
+ The configured `check` in these examples remains the project's own quality-check
370
+ command, such as its tests, linters, and type checks. It is separate from Simple
371
+ Releaser's release validation, which the CLI performs before the `run` sequence
372
+ begins.
373
+
374
+ Because `tag` pushes the tag to `origin`, it can serve directly as the handoff to
375
+ a tag-triggered CI workflow. Simple Releaser does not need to know which CI
376
+ system handles the tag or how that system builds and publishes the release.
377
+
378
+ For a concrete GitHub Actions workflow using PyPI Trusted Publishing, see
379
+ [GitHub Actions and PyPI Trusted Publishing](docs/github-trusted-publishing.md).
380
+
381
+
382
+ ### Repository host
383
+
384
+ The repository host and `owner/repo` coordinates are normally derived from the
385
+ configured project's Git `origin`. HTTPS and SSH origins on `codeberg.org` and
386
+ `github.com` are recognized automatically. `tag_prefix` controls the text
387
+ prepended to the project version when creating and locating Git tags; it defaults
388
+ to `"v"`. Set it to an empty string to use bare version tags such as `1.2.3`.
389
+
390
+ For unusual arrangements where the Git `origin` is not the repository that
391
+ receives releases, `repo_host` may explicitly select `codeberg` or `github`; pair
392
+ it with the corresponding repository override in `.env`.
393
+
394
+ For local Codeberg publication, set `CODEBERG_TOKEN` in `.env`. Set
395
+ `CODEBERG_REPOSITORY=owner/repo` to override the repository coordinates derived
396
+ from the Git `origin`.
397
+
398
+ For local GitHub publication, set `GITHUB_TOKEN` in `.env`. Set
399
+ `GITHUB_REPOSITORY=owner/repo` to override the derived repository coordinates.
400
+ The GitHub token must have permission to create releases and upload release
401
+ assets.