Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Support local version identifiers

オープン
#57 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
release

調査の方向性

Start with PEP 440 local version identifiers and incremental's Version implementation, especially public() and short(). Compare the proposed local argument with the existing version behavior; done means a value such as local='lp1' produces 20.3.0+lp1 for distribution files without a subclass or downstream workaround.

索引モデルが issue の本文から書いたものです。

説明

enhancement

PEP 440 defines local version identifiers which can be used when applying local patches to upstream projects. For example, in Launchpad we occasionally have to backport fixes from later releases that we can't upgrade to wholesale yet, or apply patches that haven't been integrated yet upstream; we do this by making distributions with local version identifiers that we commit to a git repository containing our dependencies.

This works fine with most Python projects, but it's awkward for ones that use incremental because incremental doesn't directly support local version identifiers: there's a Version.local, but it's just equal to Version.public. Let's say we're making a fork of Twisted 20.3.0, which has:

__version__ = Version('Twisted', 20, 3, 0)

Ideally we'd just be able to change that to something like:

__version__ = Version('Twisted', 20, 3, 0, local='lp1')

... and have that generate 20.3.0+lp1. However, since incremental doesn't support local version identifiers and since Twisted uses __version__.short(), I guess we end up doing something like this (obviously incomplete, but just for the purpose of getting distribution files with the right version number in them):

class LocalVersion(Version):
    def __init__(self, *args, **kwargs):
        self._local = kwargs.pop('local')
        super(LocalVersion, self).__init__(*args, **kwargs)

    def public(self):
        public = super(LocalVersion, self).public()
        if self._local:
            public += '+%s' % self._local
        return public

__version__ = LocalVersion('Twisted', 20, 3, 0, local='lp1')

Or alternatively I suppose that we could make src/twisted/__init__.py say:

__version__ = version.short() + '+lp1'

Either way, this seems like a lot of awkwardness just to make a temporary local backport distribution! I think incremental could usefully help to make this easier.

主要言語
Python
スター
144
フォーク
21
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

twisted/incremental のほかの issue

twisted/incremental の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。