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

Specify build requirements in pyproject.toml (PEP 517) #25227

Closed
wants to merge 12 commits into from
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ include LICENSE
include RELEASE.md
include README.md
include setup.py
include pyproject.toml

graft doc
prune doc/build
Expand Down
3 changes: 2 additions & 1 deletion doc/source/whatsnew/v0.25.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ Reshaping
- Bug in :func:`pandas.cut` where large bins could incorrectly raise an error due to an integer overflow (:issue:`26045`)
- Bug in :func:`DataFrame.sort_index` where an error is thrown when a multi-indexed DataFrame is sorted on all levels with the initial level sorted last (:issue:`26053`)
- Bug in :meth:`Series.nlargest` treats ``True`` as smaller than ``False`` (:issue:`26154`)
- Bug in :func:`factorize` when passing an ``ExtensionArray`` with a custom ``na_sentinel`` (:issue:`25696`).
Copy link
Member

Choose a reason for hiding this comment

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

some merge left-overs?


Sparse
^^^^^^
Expand All @@ -427,8 +428,8 @@ Sparse
Other
^^^^^

- Specify build-time requirement in ``pyproject.toml`` (:issue:`25193`)
- Removed unused C functions from vendored UltraJSON implementation (:issue:`26198`)
- Bug in :func:`factorize` when passing an ``ExtensionArray`` with a custom ``na_sentinel`` (:issue:`25696`).


.. _whatsnew_0.250.contributors:
Expand Down
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# When changing the version numbers here, also adjust them in `setup.py`
[build-system]
requires = [
"setuptools",
"wheel",
"Cython >= 0.28.2", # required for VCS build, optional for released source
"numpy==1.13.3; python_version<'3.7'",
"numpy==1.14.5; python_version>='3.7'",
]
21 changes: 17 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@
from distutils.version import LooseVersion
from setuptools import setup, Command, find_packages

# Taken from https://github.com/jupyterhub/traefik-proxy/
# commit: 0f16dc307b72e613e71067b6498f82728461434a
#
# ensure cwd is on sys.path
# workaround bug in pip 19.0
Copy link
Member

Choose a reason for hiding this comment

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

I think all of this can be removed now, see also discussion below

# This is needed to load versioneer that lies alongside the setup.py
here = os.path.dirname(__file__)
if here not in sys.path:
sys.path.insert(0, here)
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed?
For versioneer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, added a comment

Copy link
Member

@jorisvandenbossche jorisvandenbossche Feb 8, 2019

Choose a reason for hiding this comment

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

BTW, this workaround might not be needed any more, as it should be fixed in setuptools/pip (pypa/pip#6212), which will be released in the coming hours it seems

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would keep this in here for a bit as the pip release for that was not done. (From another bug report it seems like it will be in the release coming out this weekend but I won't count on that).

Copy link
Member

Choose a reason for hiding this comment

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

New Pip/Setuptools to fix this have been released in the meantime.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed this again


# versioning
import versioneer
cmdclass = versioneer.get_cmdclass()
Expand All @@ -30,14 +40,17 @@ def is_platform_mac():
return sys.platform == 'darwin'


min_numpy_ver = '1.13.3'
# When changing the version numbers here, also adjust them in `pyproject.toml`
numpy_requires = [
"numpy>=1.13.3; python_version<'3.7'",
"numpy>=1.14; python_version>='3.7'",
]
setuptools_kwargs = {
'install_requires': [
'python-dateutil >= 2.5.0',
'pytz >= 2015.4',
'numpy >= {numpy_ver}'.format(numpy_ver=min_numpy_ver),
],
'setup_requires': ['numpy >= {numpy_ver}'.format(numpy_ver=min_numpy_ver)],
] + numpy_requires,
'setup_requires': numpy_requires,
'zip_safe': False,
}

Expand Down