`incremental update --rc` treats rc0 as not being a release candidate
まだ誰も着手していません。
評価
調査の方向性
src/incremental/update.py から始めます。if existing.release_candidate: の L105(--rc の bump)、L156(フルリリースの経路)、L180(既存の rc 参照の書き換え)付近のチェックは、rc0 ではすべて false です。それらを is not None のテストに変更し、Version.__init__ の prerelease の扱いを src/incremental/_version.py でついでに確認してください。まず issue の再現を実行して 30.6.0rc1 を確認し、次に src/incremental/tests/test_update.py の既存のテストの隣に回帰テストを追加してください。完了とは、rc0 の場合に 24.1.0rc1 が出てスイートが通ることです。
索引モデルが issue の本文から書いたものです。
説明
When the current version is a release candidate with number 0 (e.g. 24.1.0rc0), incremental update <pkg> --rc starts a new calendar version instead of bumping to rc1. With rc1 the bump works as documented.
Environment: incremental 24.11.0, Python 3.12
Reproduction (calls the function behind the CLI so the date is fixed; equivalent to incremental update Shrubbery --rc)
import datetime, json, pathlib, tempfile
from incremental.update import _run
result = []
for rc in [0, 1]:
with tempfile.TemporaryDirectory() as t:
p = pathlib.Path(t)
f = p / '_version.py'
f.write_text(
'from incremental import Version\n'
f'__version__ = Version("Shrubbery", 24, 1, 0, release_candidate={rc})\n'
)
_run('Shrubbery', str(p), None, False, True, False, False, False,
_date=datetime.date(2030, 6, 1), _print=lambda x: None)
ns = {}
exec(f.read_text(), ns)
result.append(ns['__version__'].public())
print(json.dumps(result))
Actual
["30.6.0rc1", "24.1.0rc2"]
Expected
["24.1.0rc1", "24.1.0rc2"]
The README says release_candidate can be "set to 0 or higher to mark this Version being of a release candidate", and that --rc will "bump the release candidate number by 1 if it is" one. An rc0 version can come from --newversion 24.1.0rc0 (or 24.1.0rc, which PEP 440 normalizes to rc0).
Likely cause: if existing.release_candidate: is false for 0. From reading the code, the same check is used for the no-argument "make a full release" path (L156) and when rewriting existing rc references (L180), so those probably mis-handle rc0 as well (I have not run them); is not None would fix all three. Version(..., prerelease=0) has a similar truthiness check in __init__, though that argument is deprecated.
Found while testing the library with an automated exploration tool; the reproduction above was re-run on 24.11.0 before filing.
- 主要言語
- Python
- スター
- 145
- フォーク
- 22
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
twisted/incremental のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
twisted/incremental#209 ·
-
[24.11.0] Incorrect Version and GIT Tag for 25.11.0?対応中かも @twm が 267 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
twisted/incremental#185 · コメント 3 件 · リアクション 1 件 ·
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
twisted/incremental#111 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
twisted/incremental#110 · コメント 8 件 ·
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
twisted/incremental#109 · コメント 3 件 ·
twisted/incremental の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
OpenFreeEnergy/openfe#2371 ·
メンテナーはふだん 2 日以内に返信
-
HMDB's smiles file writes "None" for metabolites with an empty <smiles/> (file not currently used)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
NCATSTranslator/Babel#1269 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
404 on sample dataオープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
bcgov/nr-hydrometric-rating-curve#443 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100