h4-hello 0.1.8__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.
h4_hello-0.1.8/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 heiwa4126@gmail.com
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,257 @@
1
+ Metadata-Version: 2.3
2
+ Name: h4-hello
3
+ Version: 0.1.8
4
+ Summary: A simple hello world example
5
+ Keywords: demo,hello
6
+ Author: heiwa4126
7
+ Author-email: heiwa4126 <heiwa4126@gmail.com>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2025 heiwa4126@gmail.com
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ Classifier: License :: OSI Approved :: MIT License
30
+ Classifier: Operating System :: OS Independent
31
+ Classifier: Programming Language :: Python :: 3
32
+ Requires-Python: >=3.10
33
+ Project-URL: Documentation, https://github.com/heiwa4126/h4-hello#readme
34
+ Project-URL: Issues, https://github.com/heiwa4126/h4-hello/issues
35
+ Project-URL: Source, https://github.com/heiwa4126/h4-hello
36
+ Description-Content-Type: text/markdown
37
+
38
+ # h4-hello
39
+
40
+ **Table of Contents**
41
+
42
+ - [Installation](#installation)
43
+ - [License](#license)
44
+ - [---ここまではテンプレ、以下メモ---](#---ここまではテンプレ以下メモ---)
45
+ - [これは何か](#これは何か)
46
+ - [参考](#参考)
47
+ - [ビルド関連](#ビルド関連)
48
+ - [パブリッシュ関連](#パブリッシュ関連)
49
+ - [testPyPI のトークン取得](#testpypi-のトークン取得)
50
+ - [testPyPI への手動パブリッシュ](#testpypi-への手動パブリッシュ)
51
+ - [GitHub Actions でビルドとパブリッシュ (uv 版)](#github-actions-でビルドとパブリッシュ-uv-版)
52
+ - [PyPI(testPyPI)で "Trusted Publisher Management" のページまで行く方法](#pypitestpypiで-trusted-publisher-management-のページまで行く方法)
53
+ - [既存のプロジェクトの場合](#既存のプロジェクトの場合)
54
+ - [新プロジェクトの場合](#新プロジェクトの場合)
55
+ - [GitHub Actions 用の各フィールド](#github-actions-用の各フィールド)
56
+ - [(新プロジェクトの場合のみ) PyPI Project Name](#新プロジェクトの場合のみ-pypi-project-name)
57
+ - [Owner (=リポジトリの所有者)](#owner-リポジトリの所有者)
58
+ - [Repository name (=リポジトリ名)](#repository-name-リポジトリ名)
59
+ - [Workflow name(=ワークフローファイルのパス)](#workflow-nameワークフローファイルのパス)
60
+ - [Environment (任意)](#environment-任意)
61
+ - [以上をまとめると](#以上をまとめると)
62
+ - [`uv deploy` は PEP740 はまだ駄目 (2025-09)](#uv-deploy-は-pep740-はまだ駄目-2025-09)
63
+
64
+ ## Installation
65
+
66
+ ```console
67
+ pip install h4-hello
68
+ ```
69
+
70
+ ## License
71
+
72
+ `h4-hello` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
73
+
74
+ ## ---ここまではテンプレ、以下メモ---
75
+
76
+ (本当は別ページにする)
77
+
78
+ ## これは何か
79
+
80
+ 練習プロジェクト
81
+
82
+ 0. uv でパッケージを作る(build backend も uv)
83
+ 1. testPyPI で公開する(手動)。publish も `uv publish`で。twine を使わない
84
+ 2. GitHub Actions 経由で、testPyPI に公開する
85
+ - その過程で suzuki-shunsuke/pinact, rhysd/actionlint, nektos/act などを使う (あと aqua)
86
+ 3. Sigstore 署名をつけて testPyPI に公開する
87
+
88
+ ## 参考
89
+
90
+ ### ビルド関連
91
+
92
+ - [Building and publishing a package | uv](https://docs.astral.sh/uv/guides/package/)
93
+ - [Build backend | uv](https://docs.astral.sh/uv/concepts/build-backend/)
94
+ - [build\-backend](https://docs.astral.sh/uv/reference/settings/#build-backend)
95
+
96
+ ### パブリッシュ関連
97
+
98
+ - [Publishing your package](https://docs.astral.sh/uv/guides/package/#publishing-your-package)
99
+
100
+ ## testPyPI のトークン取得
101
+
102
+ 0. TestPyPI にアカウント作成\
103
+ https://test.pypi.org で PyPI とは別のアカウントを作成します
104
+ 1. 2 段階認証を有効化\
105
+ アカウント設定から 2FA を設定(Google Authenticator など)
106
+ 2. API トークンを発行
107
+ - TestPyPI の右上メニュー → Account Settings → API tokens →「Add API token」
108
+ - トークン名を入力し、Create token をクリック
109
+ - **表示されたトークンは一度しか表示されないので必ずコピーして保存**
110
+ ここでは .env に保存
111
+
112
+ ## testPyPI への手動パブリッシュ
113
+
114
+ 例:
115
+
116
+ ```sh
117
+ uv version --bump patch # このへんはアレンジ
118
+ git commit -am 'v9.9.9' # 上で表示されたやつ
119
+ git tag -a 'v9.9.9' -m 'v9.9.9'
120
+ rm dist/* -f
121
+ uv build
122
+ poe testpypi
123
+ ```
124
+
125
+ なんかめんどくさいね。自動化する。
126
+
127
+ パブリッシュできたら別環境でテストする。
128
+
129
+ ```sh
130
+ mkdir tmp1 && cd $!
131
+ uv init --python 3.12
132
+ uv sync
133
+ uv add --index-url https://test.pypi.org/simple/ h4-hello
134
+ . .venv/bin/activate
135
+ h4-hello
136
+ # -> hello!
137
+ ```
138
+
139
+ ## GitHub Actions でビルドとパブリッシュ (uv 版)
140
+
141
+ - [Publishing to PyPI - Using uv in GitHub Actions | uv](https://docs.astral.sh/uv/guides/integration/github/#publishing-to-pypi)
142
+ - [Commands | uv build](https://docs.astral.sh/uv/reference/cli/#uv-build)
143
+ - [Commands | uv publish](https://docs.astral.sh/uv/reference/cli/#uv-publish)
144
+ - [Adding a Trusted Publisher to an Existing PyPI Project - PyPI Docs](https://docs.pypi.org/trusted-publishers/adding-a-publisher/)
145
+ - [Publishing with a Trusted Publisher - PyPI Docs](https://docs.pypi.org/trusted-publishers/using-a-publisher/)
146
+ - [Trusted publishing support for GitHub Actions + TestPyPI via \`uv publish\` · Issue #8584 · astral-sh/uv](https://github.com/astral-sh/uv/issues/8584)
147
+
148
+ ## PyPI(testPyPI)で "Trusted Publisher Management" のページまで行く方法
149
+
150
+ (2025-09) UI なんでよく変わる
151
+
152
+ ### 既存のプロジェクトの場合
153
+
154
+ すでに PyPI/TestPyPI 上にプロジェクトがあるとき。
155
+
156
+ 1. **PyPI(testPyPI)にログイン**\
157
+ <https://pypi.org> (<https://test.pypi.org>) にアクセスし、アカウントでログインします
158
+ 2. **対象プロジェクトを選択**\
159
+ 右上のメニューから「Your projects (自分のプロジェクト)」をクリックし、設定したいプロジェクトを選びます
160
+ 3. **「Manage」ページへ移動**\
161
+ プロジェクト一覧で対象プロジェクトの「Manage (管理)」ボタンをクリック
162
+ 4. **「Publishing」メニューを開く**\
163
+ 左サイドバーの「Publishing」をクリックします
164
+ 5. **"Trusted Publisher Management"に着いたので Trusted Publisher を追加**\
165
+ GitHub タブを選択すると、必要な入力フィールドが表示されます
166
+
167
+ ### 新プロジェクトの場合
168
+
169
+ PyPI/TestPyPI には、「空のプロジェクトを作る」機能はない。でも Trusted Publishing の設定はできる。
170
+
171
+ 1. **PyPI(testPyPI)にログイン**\
172
+ <https://pypi.org> (<https://test.pypi.org>) にアクセスし、アカウントでログインします
173
+ 2. **対象プロジェクトを選択**\
174
+ 右上のメニューから「Your projects (自分のプロジェクト)」をクリックし、設定したいプロジェクトを選びます
175
+ 3. **「Publishing」メニューを開く**\
176
+ 左サイドバーの「Publishing」をクリックします
177
+ 4. **"Trusted Publisher Management"に着いたので Trusted Publisher を追加**\
178
+ GitHub タブを選択すると、必要な入力フィールドが表示されます
179
+
180
+ ### GitHub Actions 用の各フィールド
181
+
182
+ 参照: [warehouse/docs/user/trusted-publishers/adding-a-publisher.md at main · pypi/warehouse · GitHub](https://github.com/pypi/warehouse/blob/main/docs/user/trusted-publishers/adding-a-publisher.md)
183
+
184
+ #### (新プロジェクトの場合のみ) PyPI Project Name
185
+
186
+ このパブリッシャーを使用すると PyPI/TestPyPI で作成されるプロジェクト名
187
+
188
+ #### Owner (=リポジトリの所有者)
189
+
190
+ **意味:** GitHub 上の組織またはユーザー名(リポジトリの最初の要素)。
191
+
192
+ 例: `https://github.com/octo-org/sampleproject` の場合、
193
+ Owner = octo-org
194
+
195
+ **注意:**
196
+
197
+ - チーム名や表示名ではなく、オーナーのハンドル (org/ユーザー名)を入力します。
198
+ - フォークではなく本家の所有者を指定してください (PyPI が信頼するのは指定オーナー配下のワークフローです)
199
+ - リポジトリを別オーナーへ Transfer した場合は、この Owner も更新が必要です
200
+
201
+ #### Repository name (=リポジトリ名)
202
+
203
+ **例:** `octo-org/sampleproject` の `sampleproject` に相当
204
+
205
+ #### Workflow name(=ワークフローファイルのパス)
206
+
207
+ **例:** `.github/workflows/example.yml` だったら `example.yml` を指定。
208
+
209
+ #### Environment (任意)
210
+
211
+ GitHub Actions の Environment 名 (例:testpypi)。
212
+ PyPI の UI では任意ですが、セキュリティと運用上の理由で利用が強く推奨されています。
213
+
214
+ #### 以上をまとめると
215
+
216
+ [publish-testpypi.yml](.github/workflows/publish-testpypi.yml) の場合は
217
+
218
+ - Owner: heiwa4126
219
+ - Repository name: h4-hello
220
+ - Workflow name: publish-testpypi.yml
221
+ - Environment: testpypi
222
+
223
+ [publish-pypi.yml](.github/workflows/publish-pypi.yml) の場合は (こっちは新規プロジェクト)
224
+
225
+ - PyPI Project Name: h4-hello
226
+ - Owner: heiwa4126
227
+ - Repository name: h4-hello
228
+ - Workflow name: publish-pypi.yml
229
+ - Environment: pypi
230
+
231
+ ## `uv deploy` は PEP740 はまだ駄目 (2025-09)
232
+
233
+ - [uv publish: create attestations · Issue #15618 · astral-sh/uv](https://github.com/astral-sh/uv/issues/15618)
234
+
235
+ [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish)
236
+ に入れ替える。
237
+
238
+ ...あっさりできた。GitHub Actions のログがなんかえらいことに。
239
+ Docker イメージ `ghcr.io/pypa/gh-action-pypi-publish:release-v1` で実行されるらしい。
240
+ GitHub Container Registry (GHCR)
241
+ これ [Package gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish/pkgs/container/gh-action-pypi-publish)
242
+
243
+ 比較
244
+
245
+ 前:
246
+
247
+ - [h4-hello v0.1.3 · TestPyPI](https://test.pypi.org/project/h4-hello/0.1.3/) - Verified マークは過去のにも着くなあ..
248
+ - [h4_hello-0.1.0-py3-none-any.whl · TestPyPI](https://test.pypi.org/project/h4-hello/0.1.0/#h4_hello-0.1.0-py3-none-any.whl)
249
+
250
+ 後:
251
+
252
+ - [h4-hello v0.1.4 · TestPyPI](https://test.pypi.org/project/h4-hello/0.1.4/)
253
+ - [h4_hello-0.1.4-py3-none-any.whl · TestPyPI](https://test.pypi.org/project/h4-hello/#h4_hello-0.1.4-py3-none-any.whl)
254
+
255
+ どうやら "Verified details" の横のチェックマークは Sigstore 署名とは無関係に付くみたい。
256
+
257
+ そのパッケージが Sigstore 署名されているかを確認するには、個別の tgz や whl のページに行って確認するしかない
@@ -0,0 +1,220 @@
1
+ # h4-hello
2
+
3
+ **Table of Contents**
4
+
5
+ - [Installation](#installation)
6
+ - [License](#license)
7
+ - [---ここまではテンプレ、以下メモ---](#---ここまではテンプレ以下メモ---)
8
+ - [これは何か](#これは何か)
9
+ - [参考](#参考)
10
+ - [ビルド関連](#ビルド関連)
11
+ - [パブリッシュ関連](#パブリッシュ関連)
12
+ - [testPyPI のトークン取得](#testpypi-のトークン取得)
13
+ - [testPyPI への手動パブリッシュ](#testpypi-への手動パブリッシュ)
14
+ - [GitHub Actions でビルドとパブリッシュ (uv 版)](#github-actions-でビルドとパブリッシュ-uv-版)
15
+ - [PyPI(testPyPI)で "Trusted Publisher Management" のページまで行く方法](#pypitestpypiで-trusted-publisher-management-のページまで行く方法)
16
+ - [既存のプロジェクトの場合](#既存のプロジェクトの場合)
17
+ - [新プロジェクトの場合](#新プロジェクトの場合)
18
+ - [GitHub Actions 用の各フィールド](#github-actions-用の各フィールド)
19
+ - [(新プロジェクトの場合のみ) PyPI Project Name](#新プロジェクトの場合のみ-pypi-project-name)
20
+ - [Owner (=リポジトリの所有者)](#owner-リポジトリの所有者)
21
+ - [Repository name (=リポジトリ名)](#repository-name-リポジトリ名)
22
+ - [Workflow name(=ワークフローファイルのパス)](#workflow-nameワークフローファイルのパス)
23
+ - [Environment (任意)](#environment-任意)
24
+ - [以上をまとめると](#以上をまとめると)
25
+ - [`uv deploy` は PEP740 はまだ駄目 (2025-09)](#uv-deploy-は-pep740-はまだ駄目-2025-09)
26
+
27
+ ## Installation
28
+
29
+ ```console
30
+ pip install h4-hello
31
+ ```
32
+
33
+ ## License
34
+
35
+ `h4-hello` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
36
+
37
+ ## ---ここまではテンプレ、以下メモ---
38
+
39
+ (本当は別ページにする)
40
+
41
+ ## これは何か
42
+
43
+ 練習プロジェクト
44
+
45
+ 0. uv でパッケージを作る(build backend も uv)
46
+ 1. testPyPI で公開する(手動)。publish も `uv publish`で。twine を使わない
47
+ 2. GitHub Actions 経由で、testPyPI に公開する
48
+ - その過程で suzuki-shunsuke/pinact, rhysd/actionlint, nektos/act などを使う (あと aqua)
49
+ 3. Sigstore 署名をつけて testPyPI に公開する
50
+
51
+ ## 参考
52
+
53
+ ### ビルド関連
54
+
55
+ - [Building and publishing a package | uv](https://docs.astral.sh/uv/guides/package/)
56
+ - [Build backend | uv](https://docs.astral.sh/uv/concepts/build-backend/)
57
+ - [build\-backend](https://docs.astral.sh/uv/reference/settings/#build-backend)
58
+
59
+ ### パブリッシュ関連
60
+
61
+ - [Publishing your package](https://docs.astral.sh/uv/guides/package/#publishing-your-package)
62
+
63
+ ## testPyPI のトークン取得
64
+
65
+ 0. TestPyPI にアカウント作成\
66
+ https://test.pypi.org で PyPI とは別のアカウントを作成します
67
+ 1. 2 段階認証を有効化\
68
+ アカウント設定から 2FA を設定(Google Authenticator など)
69
+ 2. API トークンを発行
70
+ - TestPyPI の右上メニュー → Account Settings → API tokens →「Add API token」
71
+ - トークン名を入力し、Create token をクリック
72
+ - **表示されたトークンは一度しか表示されないので必ずコピーして保存**
73
+ ここでは .env に保存
74
+
75
+ ## testPyPI への手動パブリッシュ
76
+
77
+ 例:
78
+
79
+ ```sh
80
+ uv version --bump patch # このへんはアレンジ
81
+ git commit -am 'v9.9.9' # 上で表示されたやつ
82
+ git tag -a 'v9.9.9' -m 'v9.9.9'
83
+ rm dist/* -f
84
+ uv build
85
+ poe testpypi
86
+ ```
87
+
88
+ なんかめんどくさいね。自動化する。
89
+
90
+ パブリッシュできたら別環境でテストする。
91
+
92
+ ```sh
93
+ mkdir tmp1 && cd $!
94
+ uv init --python 3.12
95
+ uv sync
96
+ uv add --index-url https://test.pypi.org/simple/ h4-hello
97
+ . .venv/bin/activate
98
+ h4-hello
99
+ # -> hello!
100
+ ```
101
+
102
+ ## GitHub Actions でビルドとパブリッシュ (uv 版)
103
+
104
+ - [Publishing to PyPI - Using uv in GitHub Actions | uv](https://docs.astral.sh/uv/guides/integration/github/#publishing-to-pypi)
105
+ - [Commands | uv build](https://docs.astral.sh/uv/reference/cli/#uv-build)
106
+ - [Commands | uv publish](https://docs.astral.sh/uv/reference/cli/#uv-publish)
107
+ - [Adding a Trusted Publisher to an Existing PyPI Project - PyPI Docs](https://docs.pypi.org/trusted-publishers/adding-a-publisher/)
108
+ - [Publishing with a Trusted Publisher - PyPI Docs](https://docs.pypi.org/trusted-publishers/using-a-publisher/)
109
+ - [Trusted publishing support for GitHub Actions + TestPyPI via \`uv publish\` · Issue #8584 · astral-sh/uv](https://github.com/astral-sh/uv/issues/8584)
110
+
111
+ ## PyPI(testPyPI)で "Trusted Publisher Management" のページまで行く方法
112
+
113
+ (2025-09) UI なんでよく変わる
114
+
115
+ ### 既存のプロジェクトの場合
116
+
117
+ すでに PyPI/TestPyPI 上にプロジェクトがあるとき。
118
+
119
+ 1. **PyPI(testPyPI)にログイン**\
120
+ <https://pypi.org> (<https://test.pypi.org>) にアクセスし、アカウントでログインします
121
+ 2. **対象プロジェクトを選択**\
122
+ 右上のメニューから「Your projects (自分のプロジェクト)」をクリックし、設定したいプロジェクトを選びます
123
+ 3. **「Manage」ページへ移動**\
124
+ プロジェクト一覧で対象プロジェクトの「Manage (管理)」ボタンをクリック
125
+ 4. **「Publishing」メニューを開く**\
126
+ 左サイドバーの「Publishing」をクリックします
127
+ 5. **"Trusted Publisher Management"に着いたので Trusted Publisher を追加**\
128
+ GitHub タブを選択すると、必要な入力フィールドが表示されます
129
+
130
+ ### 新プロジェクトの場合
131
+
132
+ PyPI/TestPyPI には、「空のプロジェクトを作る」機能はない。でも Trusted Publishing の設定はできる。
133
+
134
+ 1. **PyPI(testPyPI)にログイン**\
135
+ <https://pypi.org> (<https://test.pypi.org>) にアクセスし、アカウントでログインします
136
+ 2. **対象プロジェクトを選択**\
137
+ 右上のメニューから「Your projects (自分のプロジェクト)」をクリックし、設定したいプロジェクトを選びます
138
+ 3. **「Publishing」メニューを開く**\
139
+ 左サイドバーの「Publishing」をクリックします
140
+ 4. **"Trusted Publisher Management"に着いたので Trusted Publisher を追加**\
141
+ GitHub タブを選択すると、必要な入力フィールドが表示されます
142
+
143
+ ### GitHub Actions 用の各フィールド
144
+
145
+ 参照: [warehouse/docs/user/trusted-publishers/adding-a-publisher.md at main · pypi/warehouse · GitHub](https://github.com/pypi/warehouse/blob/main/docs/user/trusted-publishers/adding-a-publisher.md)
146
+
147
+ #### (新プロジェクトの場合のみ) PyPI Project Name
148
+
149
+ このパブリッシャーを使用すると PyPI/TestPyPI で作成されるプロジェクト名
150
+
151
+ #### Owner (=リポジトリの所有者)
152
+
153
+ **意味:** GitHub 上の組織またはユーザー名(リポジトリの最初の要素)。
154
+
155
+ 例: `https://github.com/octo-org/sampleproject` の場合、
156
+ Owner = octo-org
157
+
158
+ **注意:**
159
+
160
+ - チーム名や表示名ではなく、オーナーのハンドル (org/ユーザー名)を入力します。
161
+ - フォークではなく本家の所有者を指定してください (PyPI が信頼するのは指定オーナー配下のワークフローです)
162
+ - リポジトリを別オーナーへ Transfer した場合は、この Owner も更新が必要です
163
+
164
+ #### Repository name (=リポジトリ名)
165
+
166
+ **例:** `octo-org/sampleproject` の `sampleproject` に相当
167
+
168
+ #### Workflow name(=ワークフローファイルのパス)
169
+
170
+ **例:** `.github/workflows/example.yml` だったら `example.yml` を指定。
171
+
172
+ #### Environment (任意)
173
+
174
+ GitHub Actions の Environment 名 (例:testpypi)。
175
+ PyPI の UI では任意ですが、セキュリティと運用上の理由で利用が強く推奨されています。
176
+
177
+ #### 以上をまとめると
178
+
179
+ [publish-testpypi.yml](.github/workflows/publish-testpypi.yml) の場合は
180
+
181
+ - Owner: heiwa4126
182
+ - Repository name: h4-hello
183
+ - Workflow name: publish-testpypi.yml
184
+ - Environment: testpypi
185
+
186
+ [publish-pypi.yml](.github/workflows/publish-pypi.yml) の場合は (こっちは新規プロジェクト)
187
+
188
+ - PyPI Project Name: h4-hello
189
+ - Owner: heiwa4126
190
+ - Repository name: h4-hello
191
+ - Workflow name: publish-pypi.yml
192
+ - Environment: pypi
193
+
194
+ ## `uv deploy` は PEP740 はまだ駄目 (2025-09)
195
+
196
+ - [uv publish: create attestations · Issue #15618 · astral-sh/uv](https://github.com/astral-sh/uv/issues/15618)
197
+
198
+ [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish)
199
+ に入れ替える。
200
+
201
+ ...あっさりできた。GitHub Actions のログがなんかえらいことに。
202
+ Docker イメージ `ghcr.io/pypa/gh-action-pypi-publish:release-v1` で実行されるらしい。
203
+ GitHub Container Registry (GHCR)
204
+ これ [Package gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish/pkgs/container/gh-action-pypi-publish)
205
+
206
+ 比較
207
+
208
+ 前:
209
+
210
+ - [h4-hello v0.1.3 · TestPyPI](https://test.pypi.org/project/h4-hello/0.1.3/) - Verified マークは過去のにも着くなあ..
211
+ - [h4_hello-0.1.0-py3-none-any.whl · TestPyPI](https://test.pypi.org/project/h4-hello/0.1.0/#h4_hello-0.1.0-py3-none-any.whl)
212
+
213
+ 後:
214
+
215
+ - [h4-hello v0.1.4 · TestPyPI](https://test.pypi.org/project/h4-hello/0.1.4/)
216
+ - [h4_hello-0.1.4-py3-none-any.whl · TestPyPI](https://test.pypi.org/project/h4-hello/#h4_hello-0.1.4-py3-none-any.whl)
217
+
218
+ どうやら "Verified details" の横のチェックマークは Sigstore 署名とは無関係に付くみたい。
219
+
220
+ そのパッケージが Sigstore 署名されているかを確認するには、個別の tgz や whl のページに行って確認するしかない
@@ -0,0 +1,49 @@
1
+ [project]
2
+ name = "h4-hello"
3
+ version = "0.1.8"
4
+ description = "A simple hello world example"
5
+ keywords = ["demo", "hello"]
6
+ classifiers = [
7
+ "License :: OSI Approved :: MIT License",
8
+ "Operating System :: OS Independent",
9
+ "Programming Language :: Python :: 3",
10
+ ]
11
+ readme = "README.md"
12
+ license.file = "LICENSE"
13
+ authors = [
14
+ { name = "heiwa4126", email = "heiwa4126@gmail.com" },
15
+ ]
16
+ requires-python = ">=3.10"
17
+
18
+ dependencies = []
19
+
20
+ [project.urls]
21
+ Documentation = "https://github.com/heiwa4126/h4-hello#readme"
22
+ Issues = "https://github.com/heiwa4126/h4-hello/issues"
23
+ Source = "https://github.com/heiwa4126/h4-hello"
24
+
25
+ [project.scripts]
26
+ h4-hello = "h4_hello:main"
27
+
28
+ [build-system]
29
+ requires = ["uv_build>=0.8.17,<0.9.0"]
30
+ build-backend = "uv_build"
31
+
32
+ [dependency-groups]
33
+ dev = [
34
+ "mypy>=1.18.1",
35
+ "poethepoet>=0.37.0",
36
+ "pytest>=8.4.2",
37
+ "ruff>=0.13.0",
38
+ "validate-pyproject>=0.24.1",
39
+ ]
40
+
41
+ [tool.uv.build-backend]
42
+ source-exclude = [
43
+ "**/*_test.py",
44
+ "tests/**",
45
+ ]
46
+ wheel-exclude = [
47
+ "**/*_test.py",
48
+ "tests/**",
49
+ ]
@@ -0,0 +1,4 @@
1
+ from h4_hello.hello import hello
2
+ from h4_hello.main import main
3
+
4
+ __all__ = ["hello", "main"]
@@ -0,0 +1,2 @@
1
+ def hello() -> str:
2
+ return "Hello!"
@@ -0,0 +1,9 @@
1
+ from h4_hello.hello import hello
2
+
3
+
4
+ def main() -> None:
5
+ print(hello())
6
+
7
+
8
+ if __name__ == "__main__":
9
+ main()