diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cc6875589c691..6c8e068b5565c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -270,6 +270,7 @@ repos: entry: python scripts/validate_min_versions_in_sync.py language: python files: ^(ci/deps/actions-.*-minimum_versions\.yaml|pandas/compat/_optional\.py)$ + additional_dependencies: [tomli] - id: validate-errors-locations name: Validate errors locations description: Validate errors are in appropriate locations. diff --git a/pyproject.toml b/pyproject.toml index ad180ff5d59d5..45fb8fad90f2f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ # Minimum requirements for the build system to execute. # See https://github.com/scipy/scipy/pull/12940 for the AIX issue. requires = [ - "setuptools>=51.0.0", + "setuptools>=61.0.0", "wheel", "Cython>=0.29.32,<3", # Note: sync with setup.py, environment.yml and asv.conf.json "oldest-supported-numpy>=2022.8.16", @@ -10,6 +10,128 @@ requires = [ ] # build-backend = "setuptools.build_meta" +[project] +name = 'pandas' +dynamic = [ + 'version' +] +description = 'Powerful data structures for data analysis, time series, and statistics' +readme = 'README.md' +authors = [ + { name = 'The Pandas Development Team', email='pandas-dev@python.org' }, +] +license = {file = 'LICENSE'} +requires-python = '>=3.8' +dependencies = [ + "numpy>=1.20.3; python_version<'3.10'", + "numpy>=1.21.0; python_version>='3.10'", + "numpy>=1.23.2; python_version>='3.11'", + "python-dateutil>=2.8.2", + "pytz>=2020.1" +] +classifiers = [ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Console', + 'Intended Audience :: Science/Research', + 'License :: OSI Approved :: BSD License', + 'Operating System :: OS Independent', + 'Programming Language :: Cython', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3 :: Only', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Topic :: Scientific/Engineering' +] + +[project.urls] +homepage = 'https://pandas.pydata.org' +documentation = 'https://pandas.pydata.org/pandas-docs/stable' +repository = 'https://github.com/pandas-dev/pandas' + +[project.entry-points."pandas_plotting_backends"] +matplotlib = "pandas:plotting._matplotlib" + +[project.optional-dependencies] +test = ['hypothesis>=5.5.3', 'pytest>=6.0', 'pytest-xdist>=1.31', 'pytest-asyncio>=0.17.0'] +performance = ['bottleneck>=1.3.2', 'numba>=0.53.1', 'numexpr>=2.7.1'] +timezone = ['tzdata>=2022.1'] +computation = ['scipy>=1.7.1', 'xarray>=0.19.0'] +fss = ['fsspec>=2021.07.0'] +aws = ['s3fs>=2021.08.0'] +gcp = ['gcsfs>=2021.07.0', 'pandas-gbq>=0.15.0'] +excel = ['odfpy>=1.4.1', 'openpyxl>=3.0.7', 'pyxlsb>=1.0.8', 'xlrd>=2.0.1', 'xlsxwriter>=1.4.3'] +parquet = ['pyarrow>=6.0.0'] +feather = ['pyarrow>=6.0.0'] +hdf5 = [# blosc only available on conda (https://github.com/Blosc/python-blosc/issues/297) + #'blosc>=1.20.1', + 'tables>=3.6.1'] +spss = ['pyreadstat>=1.1.2'] +postgresql = ['SQLAlchemy>=1.4.16', 'psycopg2>=2.8.6'] +mysql = ['SQLAlchemy>=1.4.16', 'pymysql>=1.0.2'] +sql-other = ['SQLAlchemy>=1.4.16'] +html = ['beautifulsoup4>=4.9.3', 'html5lib>=1.1', 'lxml>=4.6.3'] +xml = ['lxml>=4.6.3'] +plot = ['matplotlib>=3.6.1'] +output_formatting = ['jinja2>=3.0.0', 'tabulate>=0.8.9'] +clipboard = ['PyQt5>=5.15.1', 'qtpy>=2.2.0'] +compression = ['brotlipy>=0.7.0', 'python-snappy>=0.6.0', 'zstandard>=0.15.2'] +all = ['beautifulsoup4>=4.9.3', + # blosc only available on conda (https://github.com/Blosc/python-blosc/issues/297) + #'blosc>=1.21.0', + 'bottleneck>=1.3.2', + 'brotlipy>=0.7.0', + 'fastparquet>=0.6.3', + 'fsspec>=2021.07.0', + 'gcsfs>=2021.07.0', + 'html5lib>=1.1', + 'hypothesis>=6.13.0', + 'jinja2>=3.0.0', + 'lxml>=4.6.3', + 'matplotlib>=3.6.1', + 'numba>=0.53.1', + 'numexpr>=2.7.3', + 'odfpy>=1.4.1', + 'openpyxl>=3.0.7', + 'pandas-gbq>=0.15.0', + 'psycopg2>=2.8.6', + 'pyarrow>=6.0.0', + 'pymysql>=1.0.2', + 'PyQt5>=5.15.1', + 'pyreadstat>=1.1.2', + 'pytest>=6.0', + 'pytest-xdist>=1.31', + 'pytest-asyncio>=0.17.0', + 'python-snappy>=0.6.0', + 'pyxlsb>=1.0.8', + 'qtpy>=2.2.0', + 'scipy>=1.7.1', + 's3fs>=2021.08.0', + 'SQLAlchemy>=1.4.16', + 'tables>=3.6.1', + 'tabulate>=0.8.9', + 'tzdata>=2022.1', + 'xarray>=0.19.0', + 'xlrd>=2.0.1', + 'xlsxwriter>=1.4.3', + 'zstandard>=0.15.2'] + +# TODO: Remove after setuptools support is dropped. +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages.find] +include = ["pandas", "pandas.*"] +namespaces = false + +[tool.setuptools.exclude-package-data] +"*" = ["*.c", "*.h"] + +# See the docstring in versioneer.py for instructions. Note that you must +# re-run 'versioneer.py setup' after changing this section, and commit the +# resulting files. [tool.versioneer] VCS = "git" style = "pep440" diff --git a/requirements-dev.txt b/requirements-dev.txt index 78dddbe607084..c7395437ca8c0 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -98,4 +98,4 @@ feedparser pyyaml requests sphinx-toggleprompt -setuptools>=51.0.0 +setuptools>=61.0.0 diff --git a/scripts/validate_min_versions_in_sync.py b/scripts/validate_min_versions_in_sync.py index a69bdb95c0f9b..2186e7c8ff9ef 100755 --- a/scripts/validate_min_versions_in_sync.py +++ b/scripts/validate_min_versions_in_sync.py @@ -14,16 +14,20 @@ """ from __future__ import annotations -import configparser import pathlib import sys +if sys.version_info >= (3, 11): + import tomllib +else: + import tomli as tomllib + DOC_PATH = pathlib.Path("doc/source/getting_started/install.rst").resolve() CI_PATH = next( pathlib.Path("ci/deps").absolute().glob("actions-*-minimum_versions.yaml") ) CODE_PATH = pathlib.Path("pandas/compat/_optional.py").resolve() -SETUP_PATH = pathlib.Path("setup.cfg").resolve() +SETUP_PATH = pathlib.Path("pyproject.toml").resolve() EXCLUDE_DEPS = {"tzdata", "blosc"} # pandas package is not available # in pre-commit environment @@ -80,22 +84,20 @@ def get_versions_from_ci(content: list[str]) -> tuple[dict[str, str], dict[str, return required_deps, optional_deps -def get_versions_from_setup() -> dict[str, str]: - """Min versions in setup.cfg for pip install pandas[extra].""" +def get_versions_from_toml() -> dict[str, str]: + """Min versions in pyproject.toml for pip install pandas[extra].""" install_map = _optional.INSTALL_MAPPING + dependencies = set() optional_dependencies = {} - parser = configparser.ConfigParser() - parser.read(SETUP_PATH) - setup_optional = parser["options.extras_require"]["all"] - dependencies = setup_optional[1:].split("\n") + with open(SETUP_PATH, "rb") as pyproject_f: + pyproject_toml = tomllib.load(pyproject_f) + opt_deps = pyproject_toml["project"]["optional-dependencies"] + dependencies = set(opt_deps["all"]) - # remove test dependencies - test = parser["options.extras_require"]["test"] - test_dependencies = set(test[1:].split("\n")) - dependencies = [ - package for package in dependencies if package not in test_dependencies - ] + # remove test dependencies + test_deps = set(opt_deps["test"]) + dependencies = dependencies.difference(test_deps) for dependency in dependencies: package, version = dependency.strip().split(">=") @@ -111,7 +113,7 @@ def main(): with open(CI_PATH, encoding="utf-8") as f: _, ci_optional = get_versions_from_ci(f.readlines()) code_optional = get_versions_from_code() - setup_optional = get_versions_from_setup() + setup_optional = get_versions_from_toml() diff = (ci_optional.items() | code_optional.items() | setup_optional.items()) - ( ci_optional.items() & code_optional.items() & setup_optional.items() diff --git a/setup.cfg b/setup.cfg index c3aaf7cf4e9ae..ef84dd7f9ce85 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,172 +1,3 @@ -[metadata] -name = pandas -description = Powerful data structures for data analysis, time series, and statistics -long_description = file: README.md -long_description_content_type = text/markdown -url = https://pandas.pydata.org -author = The Pandas Development Team -author_email = pandas-dev@python.org -license = BSD-3-Clause -license_files = LICENSE -platforms = any -classifiers = - Development Status :: 5 - Production/Stable - Environment :: Console - Intended Audience :: Science/Research - License :: OSI Approved :: BSD License - Operating System :: OS Independent - Programming Language :: Cython - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Topic :: Scientific/Engineering -project_urls = - Bug Tracker = https://github.com/pandas-dev/pandas/issues - Documentation = https://pandas.pydata.org/pandas-docs/stable - Source Code = https://github.com/pandas-dev/pandas - -[options] -packages = find: -install_requires = - numpy>=1.20.3; python_version<'3.10' - numpy>=1.21.0; python_version>='3.10' - numpy>=1.23.2; python_version>='3.11' - python-dateutil>=2.8.2 - pytz>=2020.1 -python_requires = >=3.8 -include_package_data = True -zip_safe = False - -[options.entry_points] -pandas_plotting_backends = - matplotlib = pandas:plotting._matplotlib - -[options.exclude_package_data] -* = - *.c - *.h - -[options.extras_require] -test = - hypothesis>=5.5.3 - pytest>=6.0 - pytest-xdist>=1.31 - pytest-asyncio>=0.17.0 -# optional extras for recommended dependencies -# see: doc/source/getting_started/install.rst -performance = - bottleneck>=1.3.2 - numba>=0.53.1 - numexpr>=2.7.1 -timezone = - tzdata>=2022.1 -computation = - scipy>=1.7.1 - xarray>=0.19.0 -fss = - fsspec>=2021.07.0 -aws = - s3fs>=2021.08.0 -gcp = - gcsfs>=2021.07.0 - pandas-gbq>=0.15.0 -excel = - odfpy>=1.4.1 - openpyxl>=3.0.7 - pyxlsb>=1.0.8 - xlrd>=2.0.1 - xlsxwriter>=1.4.3 -parquet = - pyarrow>=6.0.0 -feather = - pyarrow>=6.0.0 -hdf5 = - # blosc only available on conda (https://github.com/Blosc/python-blosc/issues/297) - # blosc>=1.20.1 - tables>=3.6.1 -spss = - pyreadstat>=1.1.2 -postgresql = - SQLAlchemy>=1.4.16 - psycopg2>=2.8.6 -mysql = - SQLAlchemy>=1.4.16 - pymysql>=1.0.2 -sql-other = - SQLAlchemy>=1.4.16 -html = - beautifulsoup4>=4.9.3 - html5lib>=1.1 - lxml>=4.6.3 -xml = - lxml>=4.6.3 -plot = - matplotlib>=3.6.1 -output_formatting = - jinja2>=3.0.0 - tabulate>=0.8.9 -clipboard= - PyQt5>=5.15.1 - qtpy>=2.2.0 -compression = - brotlipy>=0.7.0 - python-snappy>=0.6.0 - zstandard>=0.15.2 -# `all` supersets all the above options. -# Also adds the following redundant, superseded packages that are listed as supported: -# fastparquet (by pyarrow https://github.com/pandas-dev/pandas/issues/39164) -# `all ` should be kept as the complete set of pandas optional dependencies for general use. -all = - beautifulsoup4>=4.9.3 - # blosc only available on conda (https://github.com/Blosc/python-blosc/issues/297) - # blosc>=1.21.0 - bottleneck>=1.3.2 - brotlipy>=0.7.0 - fastparquet>=0.6.3 - fsspec>=2021.07.0 - gcsfs>=2021.07.0 - html5lib>=1.1 - hypothesis>=6.13.0 - jinja2>=3.0.0 - lxml>=4.6.3 - matplotlib>=3.6.1 - numba>=0.53.1 - numexpr>=2.7.3 - odfpy>=1.4.1 - openpyxl>=3.0.7 - pandas-gbq>=0.15.0 - psycopg2>=2.8.6 - pyarrow>=6.0.0 - pymysql>=1.0.2 - PyQt5>=5.15.1 - pyreadstat>=1.1.2 - pytest>=6.0 - pytest-xdist>=1.31 - pytest-asyncio>=0.17.0 - python-snappy>=0.6.0 - pyxlsb>=1.0.8 - qtpy>=2.2.0 - scipy>=1.7.1 - s3fs>=2021.08.0 - SQLAlchemy>=1.4.16 - tables>=3.6.1 - tabulate>=0.8.9 - tzdata>=2022.1 - xarray>=0.19.0 - xlrd>=2.0.1 - xlsxwriter>=1.4.3 - zstandard>=0.15.2 - -[build_ext] -inplace = True - -[options.packages.find] -include = pandas, pandas.* - [flake8] max-line-length = 88 ignore =