Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add python version requirement. #1

Merged
merged 1 commit into from
Apr 13, 2020
Merged

Conversation

nostachio
Copy link
Contributor

Currently one can install this using pip install -e . in a Python 2 environment, which succeeds. However, trying to run the program in a Python 2 environment via python -m workout examples/easy.yaml results in errors:

$ python -m workout examples/easy.yaml 

Traceback (most recent call last):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 163, in _run_module_as_main
    mod_name, _Error)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 111, in _get_module_details
    __import__(mod_name)  # Do not catch exceptions initializing package
  File "workout/__init__.py", line 5, in <module>
    from .workouts import workout
  File "workout/workouts.py", line 26
    display(f'\nrunning workout: "{self.name}" with sections:')

This change creates the requirement to use python 3 or better during pip install step, reducing confusion for those who have lower versions of python as the default (e.g. all OSX users) due to errors after a successful install. With the changes, if the pip install -e . command is run, error output is produced letting the user know Python >=3 is required:

$ pip install -e .
[...]
Obtaining file:///Users/xxxx/python_projects/Script_My_Workout
ERROR: Package 'workout' requires a different Python: 2.7.16 not in '>=3'

@twhughes twhughes merged commit 5bacead into twhughes:master Apr 13, 2020
@twhughes
Copy link
Owner

thanks for the PR!

@twhughes twhughes mentioned this pull request Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants