Skip to content

Commit 8967241

Browse files
authored
BLD: move metadata to setup.cfg (#38852)
1 parent 5239a4b commit 8967241

File tree

7 files changed

+97
-169
lines changed

7 files changed

+97
-169
lines changed

MANIFEST.in

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
include MANIFEST.in
2-
include LICENSE
31
include RELEASE.md
4-
include README.md
5-
include setup.py
6-
include pyproject.toml
72

83
graft doc
94
prune doc/build
@@ -16,10 +11,12 @@ global-exclude *.bz2
1611
global-exclude *.csv
1712
global-exclude *.dta
1813
global-exclude *.feather
14+
global-exclude *.tar
1915
global-exclude *.gz
2016
global-exclude *.h5
2117
global-exclude *.html
2218
global-exclude *.json
19+
global-exclude *.jsonl
2320
global-exclude *.pickle
2421
global-exclude *.png
2522
global-exclude *.pyc
@@ -40,6 +37,11 @@ global-exclude .DS_Store
4037
global-exclude .git*
4138
global-exclude \#*
4239

40+
# GH 39321
41+
# csv_dir_path fixture checks the existence of the directory
42+
# exclude the whole directory to avoid running related tests in sdist
43+
prune pandas/tests/io/parser/data
44+
4345
include versioneer.py
4446
include pandas/_version.py
4547
include pandas/io/formats/templates/*.tpl

conda.recipe/meta.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ requirements:
1919
- pip
2020
- cython
2121
- numpy
22-
- setuptools >=3.3
22+
- setuptools >=38.6.0
2323
- python-dateutil >=2.7.3
2424
- pytz
2525
run:

doc/source/getting_started/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ Dependencies
219219
================================================================ ==========================
220220
Package Minimum supported version
221221
================================================================ ==========================
222-
`setuptools <https://setuptools.readthedocs.io/en/latest/>`__ 24.2.0
222+
`setuptools <https://setuptools.readthedocs.io/en/latest/>`__ 38.6.0
223223
`NumPy <https://numpy.org>`__ 1.16.5
224224
`python-dateutil <https://dateutil.readthedocs.io/en/stable/>`__ 2.7.3
225225
`pytz <https://pypi.org/project/pytz/>`__ 2017.3

doc/source/whatsnew/v1.3.0.rst

+2
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ If installed, we now require:
164164
+-----------------+-----------------+----------+---------+
165165
| mypy (dev) | 0.800 | | X |
166166
+-----------------+-----------------+----------+---------+
167+
| setuptools | 38.6.0 | | X |
168+
+-----------------+-----------------+----------+---------+
167169

168170
For `optional libraries <https://pandas.pydata.org/docs/getting_started/install.html>`_ the general recommendation is to use the latest version.
169171
The following table lists the lowest version per library that is currently being tested throughout the development of pandas.

pyproject.toml

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
[build-system]
22
# Minimum requirements for the build system to execute.
3-
# See https://github.com/scipy/scipy/pull/10431 for the AIX issue.
3+
# See https://github.com/scipy/scipy/pull/12940 for the AIX issue.
44
requires = [
5-
"setuptools",
5+
"setuptools>=38.6.0",
66
"wheel",
77
"Cython>=0.29.21,<3", # Note: sync with setup.py
8-
"numpy==1.16.5; python_version=='3.7' and platform_system!='AIX'",
9-
"numpy==1.17.3; python_version=='3.8' and platform_system!='AIX'",
10-
"numpy==1.16.5; python_version=='3.7' and platform_system=='AIX'",
11-
"numpy==1.17.3; python_version=='3.8' and platform_system=='AIX'",
8+
"numpy==1.16.5; python_version=='3.7'",
9+
"numpy==1.17.3; python_version=='3.8'",
1210
"numpy; python_version>='3.9'",
1311
]
12+
# uncomment to enable pep517 after versioneer problem is fixed.
13+
# https://github.com/python-versioneer/python-versioneer/issues/193
14+
# build-backend = "setuptools.build_meta"
1415

1516
[tool.black]
1617
target-version = ['py37', 'py38']

setup.cfg

+75-21
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,65 @@
1+
[metadata]
2+
name = pandas
3+
description = Powerful data structures for data analysis, time series, and statistics
4+
long_description = file: README.md
5+
long_description_content_type = text/markdown
6+
url = https://pandas.pydata.org
7+
author = The Pandas Development Team
8+
author_email = [email protected]
9+
license = BSD-3-Clause
10+
license_file = LICENSE
11+
platforms = any
12+
classifiers =
13+
Development Status :: 5 - Production/Stable
14+
Environment :: Console
15+
Intended Audience :: Science/Research
16+
License :: OSI Approved :: BSD License
17+
Operating System :: OS Independen
18+
Programming Language :: Cython
19+
Programming Language :: Python
20+
Programming Language :: Python :: 3
21+
Programming Language :: Python :: 3 :: Only
22+
Programming Language :: Python :: 3.7
23+
Programming Language :: Python :: 3.8
24+
Programming Language :: Python :: 3.9
25+
Topic :: Scientific/Engineering
26+
project_urls =
27+
Bug Tracker = https://github.com/pandas-dev/pandas/issues
28+
Documentation = https://pandas.pydata.org/pandas-docs/stable
29+
Source Code = https://github.com/pandas-dev/pandas
30+
31+
[options]
32+
packages = find:
33+
install_requires =
34+
numpy>=1.16.5
35+
python-dateutil>=2.7.3
36+
pytz>=2017.3
37+
python_requires = >=3.7.1
38+
include_package_data = True
39+
zip_safe = False
40+
41+
[options.entry_points]
42+
pandas_plotting_backends =
43+
matplotlib = pandas:plotting._matplotlib
44+
45+
[options.extras_require]
46+
test =
47+
hypothesis>=3.58
48+
pytest>=5.0.1
49+
pytest-xdist
50+
51+
[options.package_data]
52+
* = templates/*, _libs/**/*.dll
153

254
[build_ext]
3-
inplace = 1
55+
inplace = True
56+
57+
[options.packages.find]
58+
include = pandas, pandas.*
459

560
# See the docstring in versioneer.py for instructions. Note that you must
661
# re-run 'versioneer.py setup' after changing this section, and commit the
762
# resulting files.
8-
963
[versioneer]
1064
VCS = git
1165
style = pep440
@@ -38,16 +92,16 @@ bootstrap =
3892
import pandas as pd
3993
np # avoiding error when importing again numpy or pandas
4094
pd # (in some cases we want to do it to show users)
41-
ignore = E203, # space before : (needed for how black formats slicing)
42-
E402, # module level import not at top of file
43-
W503, # line break before binary operator
44-
# Classes/functions in different blocks can generate those errors
45-
E302, # expected 2 blank lines, found 0
46-
E305, # expected 2 blank lines after class or function definition, found 0
47-
# We use semicolon at the end to avoid displaying plot objects
48-
E703, # statement ends with a semicolon
49-
E711, # comparison to none should be 'if cond is none:'
50-
95+
ignore =
96+
E203, # space before : (needed for how black formats slicing)
97+
E402, # module level import not at top of file
98+
W503, # line break before binary operator
99+
# Classes/functions in different blocks can generate those errors
100+
E302, # expected 2 blank lines, found 0
101+
E305, # expected 2 blank lines after class or function definition, found 0
102+
# We use semicolon at the end to avoid displaying plot objects
103+
E703, # statement ends with a semicolon
104+
E711, # comparison to none should be 'if cond is none:'
51105
exclude =
52106
doc/source/development/contributing_docstring.rst,
53107
# work around issue of undefined variable warnings
@@ -64,18 +118,18 @@ xfail_strict = True
64118
filterwarnings =
65119
error:Sparse:FutureWarning
66120
error:The SparseArray:FutureWarning
67-
junit_family=xunit2
121+
junit_family = xunit2
68122

69123
[codespell]
70-
ignore-words-list=ba,blocs,coo,hist,nd,ser
71-
ignore-regex=https://(\w+\.)+
124+
ignore-words-list = ba,blocs,coo,hist,nd,ser
125+
ignore-regex = https://(\w+\.)+
72126

73127
[coverage:run]
74128
branch = False
75129
omit =
76-
*/tests/*
77-
pandas/_typing.py
78-
pandas/_version.py
130+
*/tests/*
131+
pandas/_typing.py
132+
pandas/_version.py
79133
plugins = Cython.Coverage
80134

81135
[coverage:report]
@@ -130,10 +184,10 @@ warn_unused_ignores = True
130184
show_error_codes = True
131185

132186
[mypy-pandas.tests.*]
133-
check_untyped_defs=False
187+
check_untyped_defs = False
134188

135189
[mypy-pandas._version]
136-
check_untyped_defs=False
190+
check_untyped_defs = False
137191

138192
[mypy-pandas.io.clipboard]
139-
check_untyped_defs=False
193+
check_untyped_defs = False

setup.py

+4-135
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import sys
1919

2020
import numpy
21-
from setuptools import Command, Extension, find_packages, setup
21+
from setuptools import Command, Extension, setup
2222
from setuptools.command.build_ext import build_ext as _build_ext
2323

2424
import versioneer
@@ -34,7 +34,6 @@ def is_platform_mac():
3434
return sys.platform == "darwin"
3535

3636

37-
min_numpy_ver = "1.16.5"
3837
min_cython_ver = "0.29.21" # note: sync with pyproject.toml
3938

4039
try:
@@ -99,96 +98,6 @@ def build_extensions(self):
9998
super().build_extensions()
10099

101100

102-
DESCRIPTION = "Powerful data structures for data analysis, time series, and statistics"
103-
LONG_DESCRIPTION = """
104-
**pandas** is a Python package that provides fast, flexible, and expressive data
105-
structures designed to make working with structured (tabular, multidimensional,
106-
potentially heterogeneous) and time series data both easy and intuitive. It
107-
aims to be the fundamental high-level building block for doing practical,
108-
**real world** data analysis in Python. Additionally, it has the broader goal
109-
of becoming **the most powerful and flexible open source data analysis /
110-
manipulation tool available in any language**. It is already well on its way
111-
toward this goal.
112-
113-
pandas is well suited for many different kinds of data:
114-
115-
- Tabular data with heterogeneously-typed columns, as in an SQL table or
116-
Excel spreadsheet
117-
- Ordered and unordered (not necessarily fixed-frequency) time series data.
118-
- Arbitrary matrix data (homogeneously typed or heterogeneous) with row and
119-
column labels
120-
- Any other form of observational / statistical data sets. The data actually
121-
need not be labeled at all to be placed into a pandas data structure
122-
123-
The two primary data structures of pandas, Series (1-dimensional) and DataFrame
124-
(2-dimensional), handle the vast majority of typical use cases in finance,
125-
statistics, social science, and many areas of engineering. For R users,
126-
DataFrame provides everything that R's ``data.frame`` provides and much
127-
more. pandas is built on top of `NumPy <https://www.numpy.org>`__ and is
128-
intended to integrate well within a scientific computing environment with many
129-
other 3rd party libraries.
130-
131-
Here are just a few of the things that pandas does well:
132-
133-
- Easy handling of **missing data** (represented as NaN) in floating point as
134-
well as non-floating point data
135-
- Size mutability: columns can be **inserted and deleted** from DataFrame and
136-
higher dimensional objects
137-
- Automatic and explicit **data alignment**: objects can be explicitly
138-
aligned to a set of labels, or the user can simply ignore the labels and
139-
let `Series`, `DataFrame`, etc. automatically align the data for you in
140-
computations
141-
- Powerful, flexible **group by** functionality to perform
142-
split-apply-combine operations on data sets, for both aggregating and
143-
transforming data
144-
- Make it **easy to convert** ragged, differently-indexed data in other
145-
Python and NumPy data structures into DataFrame objects
146-
- Intelligent label-based **slicing**, **fancy indexing**, and **subsetting**
147-
of large data sets
148-
- Intuitive **merging** and **joining** data sets
149-
- Flexible **reshaping** and pivoting of data sets
150-
- **Hierarchical** labeling of axes (possible to have multiple labels per
151-
tick)
152-
- Robust IO tools for loading data from **flat files** (CSV and delimited),
153-
Excel files, databases, and saving / loading data from the ultrafast **HDF5
154-
format**
155-
- **Time series**-specific functionality: date range generation and frequency
156-
conversion, moving window statistics, date shifting and lagging.
157-
158-
Many of these principles are here to address the shortcomings frequently
159-
experienced using other languages / scientific research environments. For data
160-
scientists, working with data is typically divided into multiple stages:
161-
munging and cleaning data, analyzing / modeling it, then organizing the results
162-
of the analysis into a form suitable for plotting or tabular display. pandas is
163-
the ideal tool for all of these tasks.
164-
"""
165-
166-
DISTNAME = "pandas"
167-
LICENSE = "BSD"
168-
AUTHOR = "The PyData Development Team"
169-
170-
URL = "https://pandas.pydata.org"
171-
DOWNLOAD_URL = ""
172-
PROJECT_URLS = {
173-
"Bug Tracker": "https://github.com/pandas-dev/pandas/issues",
174-
"Documentation": "https://pandas.pydata.org/pandas-docs/stable/",
175-
"Source Code": "https://github.com/pandas-dev/pandas",
176-
}
177-
CLASSIFIERS = [
178-
"Development Status :: 5 - Production/Stable",
179-
"Environment :: Console",
180-
"Operating System :: OS Independent",
181-
"Intended Audience :: Science/Research",
182-
"Programming Language :: Python",
183-
"Programming Language :: Python :: 3",
184-
"Programming Language :: Python :: 3.7",
185-
"Programming Language :: Python :: 3.8",
186-
"Programming Language :: Python :: 3.9",
187-
"Programming Language :: Cython",
188-
"Topic :: Scientific/Engineering",
189-
]
190-
191-
192101
class CleanCommand(Command):
193102
"""Custom distutils command to clean the .so and .pyc files."""
194103

@@ -711,51 +620,11 @@ def srcpath(name=None, suffix=".pyx", subdir="src"):
711620
# ----------------------------------------------------------------------
712621

713622

714-
def setup_package():
715-
setuptools_kwargs = {
716-
"install_requires": [
717-
"python-dateutil >= 2.7.3",
718-
"pytz >= 2017.3",
719-
f"numpy >= {min_numpy_ver}",
720-
],
721-
"setup_requires": [f"numpy >= {min_numpy_ver}"],
722-
"zip_safe": False,
723-
}
724-
623+
if __name__ == "__main__":
624+
# Freeze to support parallel compilation when using spawn instead of fork
625+
multiprocessing.freeze_support()
725626
setup(
726-
name=DISTNAME,
727-
maintainer=AUTHOR,
728627
version=versioneer.get_version(),
729-
packages=find_packages(include=["pandas", "pandas.*"]),
730-
package_data={"": ["templates/*", "_libs/**/*.dll"]},
731628
ext_modules=maybe_cythonize(extensions, compiler_directives=directives),
732-
maintainer_email=EMAIL,
733-
description=DESCRIPTION,
734-
license=LICENSE,
735629
cmdclass=cmdclass,
736-
url=URL,
737-
download_url=DOWNLOAD_URL,
738-
project_urls=PROJECT_URLS,
739-
long_description=LONG_DESCRIPTION,
740-
classifiers=CLASSIFIERS,
741-
platforms="any",
742-
python_requires=">=3.7.1",
743-
extras_require={
744-
"test": [
745-
# sync with setup.cfg minversion & install.rst
746-
"pytest>=5.0.1",
747-
"pytest-xdist",
748-
"hypothesis>=3.58",
749-
]
750-
},
751-
entry_points={
752-
"pandas_plotting_backends": ["matplotlib = pandas:plotting._matplotlib"]
753-
},
754-
**setuptools_kwargs,
755630
)
756-
757-
758-
if __name__ == "__main__":
759-
# Freeze to support parallel compilation when using spawn instead of fork
760-
multiprocessing.freeze_support()
761-
setup_package()

0 commit comments

Comments
 (0)