Skip to content

Raise with message for 3.5.2 and earlier #27288

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

Closed
wants to merge 1 commit into from

Conversation

TomAugspurger
Copy link
Contributor

Closes #27247

@TomAugspurger TomAugspurger added this to the 0.25.0 milestone Jul 8, 2019
def test_old_python_raises():
code = "import sys; sys.version_info = (3, 5, 2); import pandas"
# match = 'pandas requires Python >=3.5.3 but 3.5.2 is installed'
out = subprocess.run(["python", "-c", code], check=False, capture_output=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

capture_output I don't think is available until 3.7 so source of CI errors. Maybe not needed at all?

@jreback jreback added the Build Library building on various platforms label Jul 8, 2019
@@ -150,3 +150,11 @@ def test_missing_required_dependency():
output = exc.value.stdout.decode()
for name in ["numpy", "pytz", "dateutil"]:
assert name in output


def test_old_python_raises():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could move the import of just pandas.compat at the beginning of init and define PY35 there (and import here); would put the code more logically together.

@jreback jreback mentioned this pull request Jul 13, 2019
@shoyer
Copy link
Member

shoyer commented Jul 13, 2019

Would it work to put this error in setup.py instead? Install time errors seem better than import time errors. Or are there cases where that doesn’t get run?

@jreback
Copy link
Contributor

jreback commented Jul 13, 2019

Would it work to put this error in setup.py instead? Install time errors seem better than import time errors. Or are there cases where that doesn’t get run?

i think if you have a old pip and install from a wheel this wont be hit in setup.py
only at import time

@TomAugspurger
Copy link
Contributor Author

Agreed that this should be in setup.py, but after thinking about it more, I'm hesitant to duplicate things that pip is doing (when used correctly).

The reported fail case in #27247 was from (incorrectly) using python setup.py develop directly. I'd rather educate users on how pip says it should be done, rather than add duplicative checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Release 0.25.0rc0 cannot import DataFrame on Python 3.5.2
4 participants