sherpa-ai / sherpa

Hyperparameter optimization that enables researchers to experiment, visualize, and scale quickly.
http://parameter-sherpa.readthedocs.io/
GNU General Public License v3.0
331 stars 53 forks source link

Only install enum34 for old versions of Python #91

Closed tpanza closed 4 years ago

tpanza commented 4 years ago

The requirements.txt file and setup.py will always install the enum34 package.

From what I understand about the enum34 package, it backports the Python 3.4 Enum to older versions of Python (3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4).

Therefore, if the user is running with a new enough version of Python, the enum34 package is not required.

Most importantly, having enum34 installed into a Python 3.4+ environment will cause problems since they are installed to the same location.

In the requirements.txt file, enum34 could easily be skipped for newer Python versions:

enum34; python_version < '3.4'

In the setup.py file, the Python version could easily be read from the sys.version_info tuple.

(As a separate question, why are the install requirements listed in both requirements.txt and setup.py?)

tpanza commented 4 years ago

@LarsHH thoughts on this?

LarsHH commented 4 years ago

Hey @tpanza , Thanks for pointing this out and sorry for the long time to get back to you.

enum34; python_version < '3.4'

Sounds like a good solution to me. Regarding your second question, I think that's a mistake. I will look into resolving these. Are you able to fix this locally for yourself right now?

tpanza commented 4 years ago

Hi @LarsHH . Yes, I am able to fix and workaround locally: pip uninstall enum34

LarsHH commented 4 years ago

Resolved in #91 and #94