Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #111836 > unrolled thread
| Started by | Vasiliy Faronov <vfaronov@gmail.com> |
|---|---|
| First post | 2016-07-24 23:10 +0300 |
| Last post | 2016-07-24 23:10 +0300 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Depending on enum34 from a library Vasiliy Faronov <vfaronov@gmail.com> - 2016-07-24 23:10 +0300
| From | Vasiliy Faronov <vfaronov@gmail.com> |
|---|---|
| Date | 2016-07-24 23:10 +0300 |
| Subject | Depending on enum34 from a library |
| Message-ID | <mailman.98.1469391048.22221.python-list@python.org> |
Hi all, I'm building a Python library where I want to use Python 3.4-style enums. Because I need to support Python 2.7, I'm considering using enum34 [1]. But I'm not sure how to do this: If I simply depend on enum34, it will install a module named `enum` even in Python 3.4+ environments, and that could shadow the stdlib module. Personally I would be very surprised if installing a library caused an unrelated stdlib module to be replaced with a third-party one, even if it's "just" a backport. However, in my environments, `sys.path` is such that stdlib comes before site-packages -- perhaps this is normal enough that I can rely on it? Or I could change my setup.py to include enum34 in `install_requires` only if running on Python 2.7. But that will make my distribution's metadata dynamic, which doesn't sound like a good idea [2]. At the very least, I think it will prevent me from building a universal wheel. So, what's the best current practice here? [1] https://pypi.python.org/pypi/enum34 [2] https://mail.python.org/pipermail/distutils-sig/2009-July/012826.html -- Vasiliy
Back to top | Article view | comp.lang.python
csiph-web