From 0f6477afefcc20de225d2b1781855881f2cf4be8 Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Sun, 14 Nov 2021 20:16:41 +0800 Subject: [PATCH] Add PEP 517 build specification (#3495) --- cmake/PythonNumpyPybind11.cmake | 11 ----------- pyproject.toml | 3 +++ requirements.txt | 15 --------------- setup.cfg | 3 ++- setup.py | 1 - 5 files changed, 5 insertions(+), 28 deletions(-) create mode 100644 pyproject.toml delete mode 100644 requirements.txt diff --git a/cmake/PythonNumpyPybind11.cmake b/cmake/PythonNumpyPybind11.cmake index cbc998ed264d0..3c68d22b57eb6 100644 --- a/cmake/PythonNumpyPybind11.cmake +++ b/cmake/PythonNumpyPybind11.cmake @@ -77,17 +77,6 @@ message(" version: ${PYTHON_VERSION}") message(" include: ${PYTHON_INCLUDE_DIRS}") message(" library: ${PYTHON_LIBRARIES}") -execute_process(COMMAND ${PYTHON_EXECUTABLE} -c - "import git; from git import Repo; import sys;\ - sys.stdout.write(git.__version__)" - OUTPUT_VARIABLE GITPYTHON_VERSION - RESULT_VARIABLE GITPYTHON_IMPORT_RET) -if (NOT GITPYTHON_IMPORT_RET) - message(" gitpython version: ${GITPYTHON_VERSION}") -else () - message(FATAL_ERROR "Cannot import git. Please install. ([sudo] pip3 install --user gitpython)") -endif () - execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy.distutils, sys;\ sys.stdout.write(':'.join(numpy.distutils.misc_util.get_numpy_include_dirs()))" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000000..facad75d3914b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel", "numpy", "pybind11", "cmake"] +build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 93b7d71e9a97d..0000000000000 --- a/requirements.txt +++ /dev/null @@ -1,15 +0,0 @@ -GitPython -astor -autograd -colorama -coverage -isort -numpy -pybind11 -pylint -pytest -pytest-rerunfailures -pytest-xdist -setuptools -sourceinspect -yapf==0.31.0 diff --git a/setup.cfg b/setup.cfg index bd804696ecc4f..e48864773ecf0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,3 @@ [metadata] -description_file = README +long_description = file: README.md +long_description_content_type = text/markdown; charset=UTF-8 diff --git a/setup.py b/setup.py index d2e93ef1bc9ee..d411177898e94 100644 --- a/setup.py +++ b/setup.py @@ -238,7 +238,6 @@ def run(self): python_requires=">=3.6,<3.10", install_requires=[ 'numpy', - 'pybind11>=2.5.0', 'sourceinspect>=0.0.4', 'colorama', 'astor',