MagicStack / MagicStack/asyncpg
setup.py relies on deprecated pkg_resources
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 8.1k
- フォーク
- 468
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Summary
setup.py imports and uses the deprecated pkg_resources module (from setuptools) to validate the installed Cython version when building asyncpg from source:
- https://github.com/MagicStack/asyncpg/blob/db8ecc2/setup.py#L191
- https://github.com/MagicStack/asyncpg/blob/db8ecc2/setup.py#L204-L205
import pkg_resources
...
cython_dep = pkg_resources.Requirement.parse(CYTHON_DEPENDENCY)
if Cython.__version__ not in cython_dep:
...
Problem
pkg_resources has long been deprecated by setuptools: importing it emits DeprecationWarning: pkg_resources is deprecated as an API, and it is slated for removal. On recent setuptools/distro configurations it may no longer be importable at all, which can make source builds of asyncpg warn or fail.
Existing work / options
- Drop the check: open PR #1314 already proposes removing the Cython version check from
setup.pyentirely to eliminate thepkg_resourcesdependency. - Port to
packaging: alternatively the check can be preserved by switching to thepackaginglibrary, as the sister project uvloop did in MagicStack/uvloop@b377b7c6885a1eb63cb8cf19db5ab66a12c79e21 — replacingpkg_resources.Requirement.parse(...)withpackaging.requirements.Requirement(...)andx not in depwithdep.specifier.contains(x, prereleases=True)(addingpackagingtobuild-system.requires).pkg_resources.Requirement.__contains__usedprereleases=Trueinternally, so passingprereleases=Truepreserves the original behavior exactly.
Either approach removes the deprecated dependency. Filing this to track the deprecation as an issue alongside the in-flight PR #1314.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず 191 行目と 204-205 行目付近の setup.py を読み、次に既存の PR #1314 と uvloop で使われているパッケージングのアプローチを比較します。ソースからのビルドパスで pkg_resources がインポートされなくなり、意図された Cython 依存関係の動作が維持されていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- build-system
- issue の種類
- バグ
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 28/100