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 all 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: 1 addition & 1 deletion ci/deps/azure-27-compat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies:
- numexpr=2.6.1
- numpy=1.12.0
- openpyxl=2.5.5
- pytables=3.4.2
- pytables>=3.5.2
- python-dateutil=2.5.0
- python=2.7*
- pytz=2013b
Expand Down
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
2 changes: 1 addition & 1 deletion doc/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ Optional Dependencies
version. Version 0.28.2 or higher.
* `SciPy <http://www.scipy.org>`__: miscellaneous statistical functions, Version 0.18.1 or higher
* `xarray <http://xarray.pydata.org>`__: pandas like handling for > 2 dims, needed for converting Panels to xarray objects. Version 0.7.0 or higher is recommended.
* `PyTables <http://www.pytables.org>`__: necessary for HDF5-based storage, Version 3.4.2 or higher
* `PyTables <http://www.pytables.org>`__: necessary for HDF5-based storage, Version 3.5.2 or higher
* `pyarrow <http://arrow.apache.org/docs/python/>`__ (>= 0.9.0): necessary for feather-based storage.
* `Apache Parquet <https://parquet.apache.org/>`__, either `pyarrow <http://arrow.apache.org/docs/python/>`__ (>= 0.7.0) or `fastparquet <https://fastparquet.readthedocs.io/en/latest>`__ (>= 0.2.1) for parquet-based storage. The `snappy <https://pypi.org/project/python-snappy>`__ and `brotli <https://pypi.org/project/brotlipy>`__ are available for compression support.
* `SQLAlchemy <http://www.sqlalchemy.org>`__: for SQL database support. Version 0.8.1 or higher recommended. Besides SQLAlchemy, you also need a database specific driver. You can find an overview of supported drivers for each SQL dialect in the `SQLAlchemy docs <http://docs.sqlalchemy.org/en/latest/dialects/index.html>`__. Some common drivers are:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.24.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ If installed, we now require:
+-----------------+-----------------+----------+
| pyarrow | 0.9.0 | |
+-----------------+-----------------+----------+
| pytables | 3.4.2 | |
| pytables | 3.5.2 | |
+-----------------+-----------------+----------+
| scipy | 0.18.1 | |
+-----------------+-----------------+----------+
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dependencies:
- numexpr>=2.6.8
- openpyxl
- pyarrow>=0.9.0
- pytables>=3.4.2
- pytables>=3.5.2
- pytest-cov
- pytest-xdist
- s3fs
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2522,7 +2522,7 @@ def memory_usage(self, index=True, deep=False):
----------
index : bool, default True
Specifies whether to include the memory usage of the DataFrame's
index in returned Series. If ``index=True``, the memory usage of
index in returned Series. If ``index=True``, the memory usage of
the index is the first item in the output.
deep : bool, default False
If True, introspect the data deeply by interrogating
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ nbsphinx
numexpr>=2.6.8
openpyxl
pyarrow>=0.9.0
tables>=3.4.2
tables>=3.5.2
Copy link
Contributor

Choose a reason for hiding this comment

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

i don't think this would work because it would require a newer numpy than is allowed in this version (1.13)

pytest-cov
pytest-xdist
s3fs
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