google / google/python-fire

Missing enum34 dependency requirement when installing for python2.7

オープン
#191 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
28.2k
フォーク
1.5k
PR マージ指標
30日以内にマージされた PR はありません

説明

Hi,

While updating python-fire in [NixOS](https://github.com/NixOS/nixpkgs), we have realized that it should depend on [enum34](https://pypi.org/project/enum34/) when installing for python version older than 3.4.

https://github.com/google/python-fire/blob/master/fire/docstrings.py#L61 has `import enum` which was introduced in python3.4. This is available to other versions of python via `enum34`, but not stated in [setup.py](https://github.com/google/python-fire/blob/master/setup.py#L32-L35).

Something like this should solve the problem:

```diff
diff --git a/setup.py b/setup.py
index 5ddbb48..86bb171 100644
--- a/setup.py
+++ b/setup.py
@@ -15,6 +15,7 @@
"""The setup.py file for Python Fire."""

from setuptools import setup
+import sys


LONG_DESCRIPTION = """
@@ -32,7 +33,7 @@ A library for automatically generating command line interfaces.""".strip()
DEPENDENCIES = [
'six',
'termcolor',
-]
+] + (['enum34'] if sys.version < (3.4) else [])

TEST_DEPENDENCIES = [
'hypothesis',
```

Hope this helps.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

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

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