Skip to content

Pick and choose numpy version based on Python 2 or 3. #28511

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 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ci/incremental/setup_conda_environment.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ call deactivate
conda list
@rem Clean up any left-over from a previous build
conda remove --all -q -y -n pandas-dev
@rem free channel needed for older packages
conda config --set restore_free_channel true
@rem Scipy, CFFI, jinja2 and IPython are optional dependencies, but exercised in the test suite
conda env create --file=ci\deps\azure-windows-%CONDA_PY%.yaml

Expand Down
3 changes: 3 additions & 0 deletions ci/incremental/setup_conda_environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ conda list
# `conda env remove` issue)
conda remove --all -q -y -n pandas-dev

# free channel needed for older packages
conda config --set restore_free_channel true

echo
echo "[create env]"
time conda env create -q --file="${ENV_FILE}" || exit 1
Expand Down
3 changes: 3 additions & 0 deletions ci/install_travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ conda config --set ssl_verify false || exit 1
conda config --set quiet true --set always_yes true --set changeps1 false || exit 1
conda update -q conda

# free channel needed for older packages
conda config --set restore_free_channel true

# Useful for debugging any issues with conda
conda info -a || exit 1

Expand Down
13 changes: 11 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,22 @@ def is_platform_mac():


min_numpy_ver = '1.12.0'
max_numpy_ver = ''

if (sys.version_info < (3, 0)):
max_numpy_ver = '1.17'

numpy_install_rule = 'numpy >= {numpy_ver}'.format(numpy_ver=min_numpy_ver)
if max_numpy_ver:
numpy_install_rule += ', < {numpy_ver}'.format(numpy_ver=max_numpy_ver)
Copy link
Member

Choose a reason for hiding this comment

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

Just a style preference, but what fo you think about the less verbose option:

numpy_requires = 'numpy >= {min_numpy_ver}{max_numpy_rule}'.format(
    min_numpy_ver=min_numpy_ver,
    max_numpy_rule=', < {}'.format(max_numpy_ver_py2) if sys.version_info[0] < 3 else '')


setuptools_kwargs = {
'install_requires': [
'python-dateutil >= 2.5.0',
'pytz >= 2011k',
'numpy >= {numpy_ver}'.format(numpy_ver=min_numpy_ver),
numpy_install_rule,
],
'setup_requires': ['numpy >= {numpy_ver}'.format(numpy_ver=min_numpy_ver)],
'setup_requires': [numpy_install_rule],
'zip_safe': False,
}

Expand Down