From 8e9a50306ebb399137f5325cb7545c18231c5e1d Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Thu, 31 Dec 2020 09:19:19 -0600 Subject: [PATCH 01/20] BLD: move metadata to setup.cfg --- conda.recipe/meta.yaml | 2 +- doc/source/getting_started/install.rst | 2 +- pyproject.toml | 11 +- setup.cfg | 118 ++++++++++++++------- setup.py | 139 +------------------------ 5 files changed, 92 insertions(+), 180 deletions(-) diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml index e833ea1f1f398..53ee212360475 100644 --- a/conda.recipe/meta.yaml +++ b/conda.recipe/meta.yaml @@ -19,7 +19,7 @@ requirements: - pip - cython - numpy - - setuptools >=3.3 + - setuptools >=38.6.0 - python-dateutil >=2.7.3 - pytz run: diff --git a/doc/source/getting_started/install.rst b/doc/source/getting_started/install.rst index 49039f05b889a..0c9c22305d412 100644 --- a/doc/source/getting_started/install.rst +++ b/doc/source/getting_started/install.rst @@ -219,7 +219,7 @@ Dependencies ================================================================ ========================== Package Minimum supported version ================================================================ ========================== -`setuptools `__ 24.2.0 +`setuptools `__ 38.6.0 `NumPy `__ 1.16.5 `python-dateutil `__ 2.7.3 `pytz `__ 2017.3 diff --git a/pyproject.toml b/pyproject.toml index 2b78147e9294d..a4edbb4d9b8c4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,16 +1,17 @@ [build-system] # Minimum requirements for the build system to execute. -# See https://github.com/scipy/scipy/pull/10431 for the AIX issue. +# See https://github.com/scipy/scipy/pull/12940 for the AIX issue. requires = [ "setuptools", "wheel", "Cython>=0.29.21,<3", # Note: sync with setup.py - "numpy==1.16.5; python_version=='3.7' and platform_system!='AIX'", - "numpy==1.17.3; python_version=='3.8' and platform_system!='AIX'", - "numpy==1.16.5; python_version=='3.7' and platform_system=='AIX'", - "numpy==1.17.3; python_version=='3.8' and platform_system=='AIX'", + "numpy==1.16.5; python_version=='3.7'", + "numpy==1.17.3; python_version=='3.8'", "numpy; python_version>='3.9'", ] +# uncomment to enable pep517 after versioneer problem is fixed. +# https://github.com/python-versioneer/python-versioneer/issues/193 +# build-backend = "setuptools.build_meta" [tool.black] target-version = ['py37', 'py38'] diff --git a/setup.cfg b/setup.cfg index a91cd18694c33..d571bc68113f1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,13 +1,64 @@ +[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 PyData Development Team +author_email = pydata@googlegroups.com +license = BSD-3-Clause +license_file = LICENSE +platforms = any +classifiers = + Development Status :: 5 - Production/Stable + Environment :: Console + Intended Audience :: Science/Research + License :: OSI Approved :: BSD License + Operating System :: OS Independen + Programming Language :: Cython + Programming Language :: Python + Programming Language :: Python :: 3 + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + 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.16.5 + python-dateutil>=2.7.3 + pytz>=2017.3 +python_requires = >=3.7.1 +include_package_data = True +zip_safe = False + +[options.entry_points] +pandas_plotting_backends = + matplotlib = pandas:plotting._matplotlib + +[options.extras_require] +test = + hypothesis>=3.58 + pytest>=5.0.1 + pytest-xdist [build_ext] -inplace = 1 +inplace = True -# 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. +[optioins.package_data] +* = templates/*, _libs/**/*.dll + +[options.packages.find] +include = pandas, pandas.* [versioneer] -VCS = git +vcs = git style = pep440 versionfile_source = pandas/_version.py versionfile_build = pandas/_version.py @@ -38,21 +89,18 @@ bootstrap = import pandas as pd np # avoiding error when importing again numpy or pandas pd # (in some cases we want to do it to show users) -ignore = E203, # space before : (needed for how black formats slicing) - E402, # module level import not at top of file - W503, # line break before binary operator - # Classes/functions in different blocks can generate those errors - E302, # expected 2 blank lines, found 0 - E305, # expected 2 blank lines after class or function definition, found 0 - # We use semicolon at the end to avoid displaying plot objects - E703, # statement ends with a semicolon - E711, # comparison to none should be 'if cond is none:' - +ignore = + E203, # space before : (needed for how black formats slicing) + E402, # module level import not at top of file + W503, # line break before binary operator + E302, # expected 2 blank lines, found 0 + E305, # expected 2 blank lines after class or function definition, found 0 + E703, # statement ends with a semicolon + E711, # comparison to none should be 'if cond is none:' exclude = doc/source/development/contributing_docstring.rst [tool:pytest] -# sync minversion with setup.cfg & install.rst minversion = 5.0.1 testpaths = pandas doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ELLIPSIS @@ -61,14 +109,14 @@ xfail_strict = True filterwarnings = error:Sparse:FutureWarning error:The SparseArray:FutureWarning -junit_family=xunit2 +junit_family = xunit2 [coverage:run] branch = False omit = - */tests/* - pandas/_typing.py - pandas/_version.py + */tests/* + pandas/_typing.py + pandas/_version.py plugins = Cython.Coverage [coverage:report] @@ -76,30 +124,24 @@ ignore_errors = False show_missing = True omit = pandas/_version.py -# Regexes for lines to exclude from consideration -exclude_lines = - # Have to re-enable the standard pragma - pragma: no cover - - # Don't complain about missing debug-only code: - def __repr__ +exclude_lines = # Regexes for lines to exclude from consideration + pragma: no cover # Have to re-enable the standard pragma + + def __repr__ # Don't complain about missing debug-only code: if self\.debug - - # Don't complain if tests don't hit defensive assertion code: - raise AssertionError + + raise AssertionError # Don't complain if tests don't hit defensive assertion code: raise NotImplementedError AbstractMethodError - - # Don't complain if non-runnable code isn't run: - if 0: + + if 0: # Don't complain if non-runnable code isn't run if __name__ == .__main__.: if TYPE_CHECKING: [coverage:html] directory = coverage_html_report -# To be kept consistent with "Import Formatting" section in contributing.rst -[isort] +[isort] # To be kept consistent with "Import Formatting" section in contributing.rst known_pre_libs = pandas._config known_pre_core = pandas._libs,pandas._typing,pandas.util._*,pandas.compat,pandas.errors known_dtypes = pandas.core.dtypes @@ -123,10 +165,10 @@ warn_unused_ignores = True show_error_codes = True [mypy-pandas.tests.*] -check_untyped_defs=False +check_untyped_defs = False [mypy-pandas._version] -check_untyped_defs=False +check_untyped_defs = False [mypy-pandas.io.clipboard] -check_untyped_defs=False +check_untyped_defs = False diff --git a/setup.py b/setup.py index f9c4a1158fee0..34c80925a80a8 100755 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ import sys import numpy -from setuptools import Command, Extension, find_packages, setup +from setuptools import Command, Extension, setup from setuptools.command.build_ext import build_ext as _build_ext import versioneer @@ -34,7 +34,6 @@ def is_platform_mac(): return sys.platform == "darwin" -min_numpy_ver = "1.16.5" min_cython_ver = "0.29.21" # note: sync with pyproject.toml try: @@ -99,96 +98,6 @@ def build_extensions(self): super().build_extensions() -DESCRIPTION = "Powerful data structures for data analysis, time series, and statistics" -LONG_DESCRIPTION = """ -**pandas** is a Python package that provides fast, flexible, and expressive data -structures designed to make working with structured (tabular, multidimensional, -potentially heterogeneous) and time series data both easy and intuitive. It -aims to be the fundamental high-level building block for doing practical, -**real world** data analysis in Python. Additionally, it has the broader goal -of becoming **the most powerful and flexible open source data analysis / -manipulation tool available in any language**. It is already well on its way -toward this goal. - -pandas is well suited for many different kinds of data: - - - Tabular data with heterogeneously-typed columns, as in an SQL table or - Excel spreadsheet - - Ordered and unordered (not necessarily fixed-frequency) time series data. - - Arbitrary matrix data (homogeneously typed or heterogeneous) with row and - column labels - - Any other form of observational / statistical data sets. The data actually - need not be labeled at all to be placed into a pandas data structure - -The two primary data structures of pandas, Series (1-dimensional) and DataFrame -(2-dimensional), handle the vast majority of typical use cases in finance, -statistics, social science, and many areas of engineering. For R users, -DataFrame provides everything that R's ``data.frame`` provides and much -more. pandas is built on top of `NumPy `__ and is -intended to integrate well within a scientific computing environment with many -other 3rd party libraries. - -Here are just a few of the things that pandas does well: - - - Easy handling of **missing data** (represented as NaN) in floating point as - well as non-floating point data - - Size mutability: columns can be **inserted and deleted** from DataFrame and - higher dimensional objects - - Automatic and explicit **data alignment**: objects can be explicitly - aligned to a set of labels, or the user can simply ignore the labels and - let `Series`, `DataFrame`, etc. automatically align the data for you in - computations - - Powerful, flexible **group by** functionality to perform - split-apply-combine operations on data sets, for both aggregating and - transforming data - - Make it **easy to convert** ragged, differently-indexed data in other - Python and NumPy data structures into DataFrame objects - - Intelligent label-based **slicing**, **fancy indexing**, and **subsetting** - of large data sets - - Intuitive **merging** and **joining** data sets - - Flexible **reshaping** and pivoting of data sets - - **Hierarchical** labeling of axes (possible to have multiple labels per - tick) - - Robust IO tools for loading data from **flat files** (CSV and delimited), - Excel files, databases, and saving / loading data from the ultrafast **HDF5 - format** - - **Time series**-specific functionality: date range generation and frequency - conversion, moving window statistics, date shifting and lagging. - -Many of these principles are here to address the shortcomings frequently -experienced using other languages / scientific research environments. For data -scientists, working with data is typically divided into multiple stages: -munging and cleaning data, analyzing / modeling it, then organizing the results -of the analysis into a form suitable for plotting or tabular display. pandas is -the ideal tool for all of these tasks. -""" - -DISTNAME = "pandas" -LICENSE = "BSD" -AUTHOR = "The PyData Development Team" -EMAIL = "pydata@googlegroups.com" -URL = "https://pandas.pydata.org" -DOWNLOAD_URL = "" -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", -} -CLASSIFIERS = [ - "Development Status :: 5 - Production/Stable", - "Environment :: Console", - "Operating System :: OS Independent", - "Intended Audience :: Science/Research", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Cython", - "Topic :: Scientific/Engineering", -] - - class CleanCommand(Command): """Custom distutils command to clean the .so and .pyc files.""" @@ -711,51 +620,11 @@ def srcpath(name=None, suffix=".pyx", subdir="src"): # ---------------------------------------------------------------------- -def setup_package(): - setuptools_kwargs = { - "install_requires": [ - "python-dateutil >= 2.7.3", - "pytz >= 2017.3", - f"numpy >= {min_numpy_ver}", - ], - "setup_requires": [f"numpy >= {min_numpy_ver}"], - "zip_safe": False, - } - +if __name__ == "__main__": + # Freeze to support parallel compilation when using spawn instead of fork + multiprocessing.freeze_support() setup( - name=DISTNAME, - maintainer=AUTHOR, version=versioneer.get_version(), - packages=find_packages(include=["pandas", "pandas.*"]), - package_data={"": ["templates/*", "_libs/**/*.dll"]}, ext_modules=maybe_cythonize(extensions, compiler_directives=directives), - maintainer_email=EMAIL, - description=DESCRIPTION, - license=LICENSE, cmdclass=cmdclass, - url=URL, - download_url=DOWNLOAD_URL, - project_urls=PROJECT_URLS, - long_description=LONG_DESCRIPTION, - classifiers=CLASSIFIERS, - platforms="any", - python_requires=">=3.7.1", - extras_require={ - "test": [ - # sync with setup.cfg minversion & install.rst - "pytest>=5.0.1", - "pytest-xdist", - "hypothesis>=3.58", - ] - }, - entry_points={ - "pandas_plotting_backends": ["matplotlib = pandas:plotting._matplotlib"] - }, - **setuptools_kwargs, ) - - -if __name__ == "__main__": - # Freeze to support parallel compilation when using spawn instead of fork - multiprocessing.freeze_support() - setup_package() From 0199b1acb5ee8ac0a249fb32bd412c9047a3cbbb Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Thu, 31 Dec 2020 09:32:54 -0600 Subject: [PATCH 02/20] fix comment --- setup.cfg | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/setup.cfg b/setup.cfg index 4730156683b74..02faad1abd568 100644 --- a/setup.cfg +++ b/setup.cfg @@ -58,7 +58,7 @@ inplace = True include = pandas, pandas.* [versioneer] -vcs = git +VCS = git style = pep440 versionfile_source = pandas/_version.py versionfile_build = pandas/_version.py @@ -101,6 +101,7 @@ exclude = doc/source/development/contributing_docstring.rst [tool:pytest] +# sync minversion with install.rst minversion = 5.0.1 testpaths = pandas doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ELLIPSIS @@ -127,24 +128,30 @@ ignore_errors = False show_missing = True omit = pandas/_version.py -exclude_lines = # Regexes for lines to exclude from consideration - pragma: no cover # Have to re-enable the standard pragma +# Regexes for lines to exclude from consideration +exclude_lines = + # Have to re-enable the standard pragma + pragma: no cover - def __repr__ # Don't complain about missing debug-only code: + # Don't complain about missing debug-only code: + def __repr__ if self\.debug - raise AssertionError # Don't complain if tests don't hit defensive assertion code: + # Don't complain if tests don't hit defensive assertion code: + raise AssertionError raise NotImplementedError AbstractMethodError - - if 0: # Don't complain if non-runnable code isn't run + + # Don't complain if non-runnable code isn't run + if 0: if __name__ == .__main__.: if TYPE_CHECKING: [coverage:html] directory = coverage_html_report -[isort] # To be kept consistent with "Import Formatting" section in contributing.rst +# To be kept consistent with "Import Formatting" section in contributing.rst +[isort] known_pre_libs = pandas._config known_pre_core = pandas._libs,pandas._typing,pandas.util._*,pandas.compat,pandas.errors known_dtypes = pandas.core.dtypes From 0f737e4d2c25163d969f48c957b564e5b66a9674 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Thu, 31 Dec 2020 09:34:52 -0600 Subject: [PATCH 03/20] fix white space --- setup.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 02faad1abd568..3841108689561 100644 --- a/setup.cfg +++ b/setup.cfg @@ -132,11 +132,11 @@ omit = exclude_lines = # Have to re-enable the standard pragma pragma: no cover - + # Don't complain about missing debug-only code: def __repr__ if self\.debug - + # Don't complain if tests don't hit defensive assertion code: raise AssertionError raise NotImplementedError From 8191bc4b6b18d4f1985f4321d8d2ac373c06314a Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Thu, 31 Dec 2020 09:43:31 -0600 Subject: [PATCH 04/20] fix white space --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 3841108689561..6ebeb78183b80 100644 --- a/setup.cfg +++ b/setup.cfg @@ -89,7 +89,7 @@ bootstrap = import pandas as pd np # avoiding error when importing again numpy or pandas pd # (in some cases we want to do it to show users) -ignore = +ignore = E203, # space before : (needed for how black formats slicing) E402, # module level import not at top of file W503, # line break before binary operator From e9f7b84ff16741bf6e677c6d2a701a0c3e76a121 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Fri, 1 Jan 2021 23:24:30 -0600 Subject: [PATCH 05/20] add setup-cfg-fmt hook --- .pre-commit-config.yaml | 4 ++++ setup.cfg | 17 +++++------------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d78c2bacc4e44..042b4a8c35a0a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -174,3 +174,7 @@ repos: - id: codespell types_or: [python, rst, markdown] files: ^pandas/core/ +- repo: https://github.com/asottile/setup-cfg-fmt + rev: v1.16.0 + hooks: + - id: setup-cfg-fmt diff --git a/setup.cfg b/setup.cfg index 6ebeb78183b80..6571fd9f6e5fc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -58,7 +58,7 @@ inplace = True include = pandas, pandas.* [versioneer] -VCS = git +vcs = git style = pep440 versionfile_source = pandas/_version.py versionfile_build = pandas/_version.py @@ -101,7 +101,6 @@ exclude = doc/source/development/contributing_docstring.rst [tool:pytest] -# sync minversion with install.rst minversion = 5.0.1 testpaths = pandas doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ELLIPSIS @@ -113,7 +112,7 @@ filterwarnings = junit_family = xunit2 [codespell] -ignore-words-list=ba,blocs,coo,datas,fo,hist,nd,ser +ignore-words-list = ba,blocs,coo,datas,fo,hist,nd,ser [coverage:run] branch = False @@ -128,21 +127,16 @@ ignore_errors = False show_missing = True omit = pandas/_version.py -# Regexes for lines to exclude from consideration exclude_lines = - # Have to re-enable the standard pragma pragma: no cover - - # Don't complain about missing debug-only code: + def __repr__ if self\.debug - - # Don't complain if tests don't hit defensive assertion code: + raise AssertionError raise NotImplementedError AbstractMethodError - - # Don't complain if non-runnable code isn't run + if 0: if __name__ == .__main__.: if TYPE_CHECKING: @@ -150,7 +144,6 @@ exclude_lines = [coverage:html] directory = coverage_html_report -# To be kept consistent with "Import Formatting" section in contributing.rst [isort] known_pre_libs = pandas._config known_pre_core = pandas._libs,pandas._typing,pandas.util._*,pandas.compat,pandas.errors From ec33ac9e9f0572dcce29931c73e1a50730c0c01e Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Fri, 1 Jan 2021 23:57:30 -0600 Subject: [PATCH 06/20] white space --- setup.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index 6571fd9f6e5fc..ced67cf8d18a2 100644 --- a/setup.cfg +++ b/setup.cfg @@ -129,14 +129,14 @@ omit = pandas/_version.py exclude_lines = pragma: no cover - + def __repr__ if self\.debug - + raise AssertionError raise NotImplementedError AbstractMethodError - + if 0: if __name__ == .__main__.: if TYPE_CHECKING: From ea10a0ff59cd5725613300e81949f738cac5768c Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Sat, 2 Jan 2021 10:24:58 -0600 Subject: [PATCH 07/20] white space --- setup.cfg | 3 --- 1 file changed, 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index ced67cf8d18a2..cd3d5a6d95a43 100644 --- a/setup.cfg +++ b/setup.cfg @@ -129,14 +129,11 @@ omit = pandas/_version.py exclude_lines = pragma: no cover - def __repr__ if self\.debug - raise AssertionError raise NotImplementedError AbstractMethodError - if 0: if __name__ == .__main__.: if TYPE_CHECKING: From 50edbd828ebe2416c00045d997145eac79c9a9a5 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Sun, 3 Jan 2021 08:21:00 -0600 Subject: [PATCH 08/20] fix typo --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index cd3d5a6d95a43..eda4a9349e350 100644 --- a/setup.cfg +++ b/setup.cfg @@ -51,7 +51,7 @@ test = [build_ext] inplace = True -[optioins.package_data] +[options.package_data] * = templates/*, _libs/**/*.dll [options.packages.find] From 24c4e29b4c0750ce362ee8d14cdea72b526a8cba Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Sun, 3 Jan 2021 08:31:45 -0600 Subject: [PATCH 09/20] reformat --- setup.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.cfg b/setup.cfg index eda4a9349e350..7c4153aa8bdef 100644 --- a/setup.cfg +++ b/setup.cfg @@ -48,12 +48,12 @@ test = pytest>=5.0.1 pytest-xdist -[build_ext] -inplace = True - [options.package_data] * = templates/*, _libs/**/*.dll +[build_ext] +inplace = True + [options.packages.find] include = pandas, pandas.* From b25bf9018057d842a0594a583309b6a138a2bf55 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Sun, 3 Jan 2021 20:39:14 -0600 Subject: [PATCH 10/20] fix format --- setup.cfg | 2 -- 1 file changed, 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 104b4b0f28a17..e2c2c449d4279 100644 --- a/setup.cfg +++ b/setup.cfg @@ -99,8 +99,6 @@ ignore = E711, # comparison to none should be 'if cond is none:' exclude = doc/source/development/contributing_docstring.rst, - # work around issue of undefined variable warnings - # https://github.com/pandas-dev/pandas/pull/38837#issuecomment-752884156 doc/source/getting_started/comparison/includes/*.rst [tool:pytest] From 75f3e270d849e342aac40ebaa161f17b82b249b7 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Mon, 4 Jan 2021 13:10:32 -0600 Subject: [PATCH 11/20] add whatsnew note, set min version --- doc/source/whatsnew/v1.3.0.rst | 2 ++ pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v1.3.0.rst b/doc/source/whatsnew/v1.3.0.rst index b4b98ec0403a8..d71cdb3b91526 100644 --- a/doc/source/whatsnew/v1.3.0.rst +++ b/doc/source/whatsnew/v1.3.0.rst @@ -88,6 +88,8 @@ If installed, we now require: +-----------------+-----------------+----------+---------+ | mypy (dev) | 0.782 | | | +-----------------+-----------------+----------+---------+ +| setuptools | 38.6.0 | | X | ++-----------------+-----------------+----------+---------+ For `optional libraries `_ the general recommendation is to use the latest version. The following table lists the lowest version per library that is currently being tested throughout the development of pandas. diff --git a/pyproject.toml b/pyproject.toml index a4edbb4d9b8c4..9f11475234566 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", + "setuptools>=38.6.0", "wheel", "Cython>=0.29.21,<3", # Note: sync with setup.py "numpy==1.16.5; python_version=='3.7'", From 2840c65e94b68ae6eab6bf154a13163a2cb87cef Mon Sep 17 00:00:00 2001 From: Simon Hawkins Date: Tue, 5 Jan 2021 18:14:08 +0000 Subject: [PATCH 12/20] add github workflow to test sdist --- .github/workflows/ci.yml | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e8834bd509bf0..a9a73393180be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,3 +132,50 @@ jobs: - name: Upload dev docs run: rsync -az --delete doc/build/html/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas/pandas-docs/dev if: github.event_name == 'push' + + build-sdist: + name: Build from source distribution + runs-on: ubuntu-latest + steps: + - name: Update for build environment + run: | + sudo apt-get update + sudo apt-get install -y build-essential + sudo apt-get clean + - name: Setting conda path + run: echo "$CONDA/bin" >> $GITHUB_PATH + - name: Update conda + run: | + conda config --set quiet true --set always_yes true + conda update -n base -c defaults conda + conda list + - name: Checkout pandas + uses: actions/checkout@v2 + - name: Fetch git tags + run: | + git remote -v + git fetch --all --tags + - name: Setup conda environment for build + run: | + conda create --name build-sdist python=3.8 numpy + - name: Build the sdist + run: | + source activate build-sdist + conda list + rm -rf dist + git clean -xfd + python setup.py clean --quiet + python setup.py sdist --formats=gztar --quiet + - name: Setup conda environment for test + run: | + conda create --name pip-test python=3.8 pytest pytest-xdist pytest-mock hypothesis + - name: Install pandas and test + run: | + pwd + cd .. + pwd + source activate pip-test + conda list + pip install pandas/dist/*.gz + conda list + python3 -c "import pandas; pandas.test(extra_args=['-m not clipboard', '--skip-slow', '--skip-network', '--skip-db', '-n=2'])" From 5752a0953931b7b49e9c59b81ce603ac4f675bb7 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Tue, 5 Jan 2021 20:15:39 -0600 Subject: [PATCH 13/20] update author and author email --- setup.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index e2c2c449d4279..fa8181a2a360f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,8 +4,8 @@ description = Powerful data structures for data analysis, time series, and stati long_description = file: README.md long_description_content_type = text/markdown url = https://pandas.pydata.org -author = The PyData Development Team -author_email = pydata@googlegroups.com +author = The Pandas Development Team +author_email = pandas-dev@python.org license = BSD-3-Clause license_file = LICENSE platforms = any From 20da426d0a05e7bcd05ebd62b43ee4d38a14dd8e Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Wed, 6 Jan 2021 09:01:03 -0600 Subject: [PATCH 14/20] remove setup-cfg-fmt, add comments back --- .pre-commit-config.yaml | 4 ---- setup.cfg | 12 ++++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e33ec6b392f5b..52f923c41cbd4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -179,7 +179,3 @@ repos: - id: codespell types_or: [python, rst, markdown] files: ^pandas/core/ -- repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.16.0 - hooks: - - id: setup-cfg-fmt diff --git a/setup.cfg b/setup.cfg index fa8181a2a360f..23b40feb42a81 100644 --- a/setup.cfg +++ b/setup.cfg @@ -99,9 +99,12 @@ ignore = E711, # comparison to none should be 'if cond is none:' exclude = doc/source/development/contributing_docstring.rst, + # work around issue of undefined variable warnings + # https://github.com/pandas-dev/pandas/pull/38837#issuecomment-752884156 doc/source/getting_started/comparison/includes/*.rst [tool:pytest] +# sync minversion with setup.cfg & install.rst minversion = 5.0.1 testpaths = pandas doctest_optionflags = NORMALIZE_WHITESPACE IGNORE_EXCEPTION_DETAIL ELLIPSIS @@ -128,13 +131,21 @@ ignore_errors = False show_missing = True omit = pandas/_version.py +# Regexes for lines to exclude from consideration exclude_lines = + # Have to re-enable the standard pragma pragma: no cover + + # Don't complain about missing debug-only code: def __repr__ if self\.debug + + # Don't complain if tests don't hit defensive assertion code: raise AssertionError raise NotImplementedError AbstractMethodError + + # Don't complain if tests don't hit defensive assertion code: if 0: if __name__ == .__main__.: if TYPE_CHECKING: @@ -142,6 +153,7 @@ exclude_lines = [coverage:html] directory = coverage_html_report +# To be kept consistent with "Import Formatting" section in contributing.rst [isort] known_pre_libs = pandas._config known_pre_core = pandas._libs,pandas._typing,pandas.util._*,pandas.compat,pandas.errors From 3377c1ffeb98e597b9fafc0d8cdaa7090ad1cea2 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Wed, 6 Jan 2021 09:04:18 -0600 Subject: [PATCH 15/20] remove setup-cfg-fmt, add comments back --- setup.cfg | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 23b40feb42a81..efabc4f5f64f6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -57,6 +57,9 @@ inplace = True [options.packages.find] include = pandas, pandas.* +# 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. [versioneer] vcs = git style = pep440 @@ -145,7 +148,7 @@ exclude_lines = raise NotImplementedError AbstractMethodError - # Don't complain if tests don't hit defensive assertion code: + # Don't complain if non-runnable code isn't run: if 0: if __name__ == .__main__.: if TYPE_CHECKING: From 21b87977a4095c281b4c8be2d05d607ab34a7a0a Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Fri, 15 Jan 2021 08:02:30 -0600 Subject: [PATCH 16/20] add sdist back --- .github/workflows/ci.yml | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b551e7ded0178..cf7c40dcd4e64 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -157,3 +157,50 @@ jobs: run: | source activate pandas-dev pytest pandas/tests/frame/methods --array-manager + + build-sdist: + name: Build from source distribution + runs-on: ubuntu-latest + steps: + - name: Update for build environment + run: | + sudo apt-get update + sudo apt-get install -y build-essential + sudo apt-get clean + - name: Setting conda path + run: echo "$CONDA/bin" >> $GITHUB_PATH + - name: Update conda + run: | + conda config --set quiet true --set always_yes true + conda update -n base -c defaults conda + conda list + - name: Checkout pandas + uses: actions/checkout@v2 + - name: Fetch git tags + run: | + git remote -v + git fetch --all --tags + - name: Setup conda environment for build + run: | + conda create --name build-sdist python=3.8 numpy + - name: Build the sdist + run: | + source activate build-sdist + conda list + rm -rf dist + git clean -xfd + python setup.py clean --quiet + python setup.py sdist --formats=gztar --quiet + - name: Setup conda environment for test + run: | + conda create --name pip-test python=3.8 pytest pytest-xdist pytest-mock hypothesis + - name: Install pandas and test + run: | + pwd + cd .. + pwd + source activate pip-test + conda list + pip install pandas/dist/*.gz + conda list + python3 -c "import pandas; pandas.test(extra_args=['-m not clipboard', '--skip-slow', '--skip-network', '--skip-db', '-n=2'])" From 68e34f337977ad35d0cbc88f5ed980a4f1a7e7f1 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Fri, 15 Jan 2021 12:44:39 -0600 Subject: [PATCH 17/20] clean MANIFEST.in and exclude data dir --- MANIFEST.in | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index cf6a1835433a4..5e9530f9e2aa3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,9 +1,4 @@ -include MANIFEST.in -include LICENSE include RELEASE.md -include README.md -include setup.py -include pyproject.toml graft doc prune doc/build @@ -16,10 +11,12 @@ global-exclude *.bz2 global-exclude *.csv global-exclude *.dta global-exclude *.feather +global-exclude *.tar global-exclude *.gz global-exclude *.h5 global-exclude *.html global-exclude *.json +global-exclude *.jsonl global-exclude *.pickle global-exclude *.png global-exclude *.pyc @@ -40,6 +37,8 @@ global-exclude .DS_Store global-exclude .git* global-exclude \#* +prune pandas/tests/io/parser/data + include versioneer.py include pandas/_version.py include pandas/io/formats/templates/*.tpl From 1156724ed60a35cdb3c7c9f2458ff543a77202b2 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Fri, 15 Jan 2021 15:11:12 -0600 Subject: [PATCH 18/20] revert lower case --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index efabc4f5f64f6..ee5fc2686d3a7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -61,7 +61,7 @@ include = pandas, pandas.* # re-run 'versioneer.py setup' after changing this section, and commit the # resulting files. [versioneer] -vcs = git +VCS = git style = pep440 versionfile_source = pandas/_version.py versionfile_build = pandas/_version.py From e3b0cd2930987c68fdbc35c0bee743c667ea984a Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Thu, 21 Jan 2021 12:00:34 -0600 Subject: [PATCH 19/20] add comment, remove sdist ci --- .github/workflows/ci.yml | 47 ---------------------------------------- MANIFEST.in | 1 + 2 files changed, 1 insertion(+), 47 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf7c40dcd4e64..b551e7ded0178 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -157,50 +157,3 @@ jobs: run: | source activate pandas-dev pytest pandas/tests/frame/methods --array-manager - - build-sdist: - name: Build from source distribution - runs-on: ubuntu-latest - steps: - - name: Update for build environment - run: | - sudo apt-get update - sudo apt-get install -y build-essential - sudo apt-get clean - - name: Setting conda path - run: echo "$CONDA/bin" >> $GITHUB_PATH - - name: Update conda - run: | - conda config --set quiet true --set always_yes true - conda update -n base -c defaults conda - conda list - - name: Checkout pandas - uses: actions/checkout@v2 - - name: Fetch git tags - run: | - git remote -v - git fetch --all --tags - - name: Setup conda environment for build - run: | - conda create --name build-sdist python=3.8 numpy - - name: Build the sdist - run: | - source activate build-sdist - conda list - rm -rf dist - git clean -xfd - python setup.py clean --quiet - python setup.py sdist --formats=gztar --quiet - - name: Setup conda environment for test - run: | - conda create --name pip-test python=3.8 pytest pytest-xdist pytest-mock hypothesis - - name: Install pandas and test - run: | - pwd - cd .. - pwd - source activate pip-test - conda list - pip install pandas/dist/*.gz - conda list - python3 -c "import pandas; pandas.test(extra_args=['-m not clipboard', '--skip-slow', '--skip-network', '--skip-db', '-n=2'])" diff --git a/MANIFEST.in b/MANIFEST.in index 5e9530f9e2aa3..dd4e03b1f2f83 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -37,6 +37,7 @@ global-exclude .DS_Store global-exclude .git* global-exclude \#* +# GH 39321 prune pandas/tests/io/parser/data include versioneer.py From defcccbdee40cb5198e631de10e9b1dd3de5a20f Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Sun, 24 Jan 2021 23:20:02 -0600 Subject: [PATCH 20/20] add comments --- MANIFEST.in | 2 ++ setup.cfg | 2 ++ 2 files changed, 4 insertions(+) diff --git a/MANIFEST.in b/MANIFEST.in index dd4e03b1f2f83..494ad69efbc56 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -38,6 +38,8 @@ global-exclude .git* global-exclude \#* # GH 39321 +# csv_dir_path fixture checks the existence of the directory +# exclude the whole directory to avoid running related tests in sdist prune pandas/tests/io/parser/data include versioneer.py diff --git a/setup.cfg b/setup.cfg index 12169089fbbdf..5093ff81ad17f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -96,8 +96,10 @@ ignore = E203, # space before : (needed for how black formats slicing) E402, # module level import not at top of file W503, # line break before binary operator + # Classes/functions in different blocks can generate those errors E302, # expected 2 blank lines, found 0 E305, # expected 2 blank lines after class or function definition, found 0 + # We use semicolon at the end to avoid displaying plot objects E703, # statement ends with a semicolon E711, # comparison to none should be 'if cond is none:' exclude =