Skip to content

Commit f0cf667

Browse files
authored
Revert "BLD: Add pyproject.toml to wheels (#50330)"
This reverts commit 8023225.
1 parent d22d1f2 commit f0cf667

File tree

8 files changed

+14
-33
lines changed

8 files changed

+14
-33
lines changed

.github/workflows/wheels.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ jobs:
173173
pip install hypothesis>=6.34.2 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17
174174
cd .. # Not a good idea to test within the src tree
175175
python -c "import pandas; print(pandas.__version__);
176-
pandas.test(extra_args=['-m not clipboard and not single_cpu and not slow and not network and not db', '-n 2', '--no-strict-data-files']);
177-
pandas.test(extra_args=['-m not clipboard and single_cpu and not slow and not network and not db', '--no-strict-data-files'])"
176+
pandas.test(extra_args=['-m not clipboard and not single_cpu and not slow and not network and not db', '-n 2']);
177+
pandas.test(extra_args=['-m not clipboard and single_cpu and not slow and not network and not db'])"
178178
- uses: actions/upload-artifact@v3
179179
with:
180180
name: sdist

ci/test_wheels.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,10 @@
4141
multi_args = [
4242
"-m not clipboard and not single_cpu and not slow and not network and not db",
4343
"-n 2",
44-
"--no-strict-data-files",
4544
]
4645
pd.test(extra_args=multi_args)
4746
pd.test(
4847
extra_args=[
4948
"-m not clipboard and single_cpu and not slow and not network and not db",
50-
"--no-strict-data-files",
5149
]
5250
)

ci/test_wheels_windows.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set test_command=import pandas as pd; print(pd.__version__); ^
2-
pd.test(extra_args=['-m not clipboard and not single_cpu and not slow and not network and not db', '--no-strict-data-files', '-n=2']); ^
3-
pd.test(extra_args=['-m not clipboard and single_cpu and not slow and not network and not db', '--no-strict-data-files'])
2+
pd.test(extra_args=['-m not clipboard and not single_cpu and not slow and not network and not db', '-n 2']); ^
3+
pd.test(extra_args=['-m not clipboard and single_cpu and not slow and not network and not db'])
44

55
python --version
66
pip install pytz six numpy python-dateutil tzdata>=2022.1

pandas/conftest.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@
103103

104104
def pytest_addoption(parser) -> None:
105105
parser.addoption(
106-
"--no-strict-data-files",
107-
action="store_false",
108-
help="Don't fail if a test is skipped for missing data file.",
106+
"--strict-data-files",
107+
action="store_true",
108+
help="Fail if a test is skipped for missing data file.",
109109
)
110110

111111

@@ -1112,9 +1112,9 @@ def all_numeric_accumulations(request):
11121112
@pytest.fixture
11131113
def strict_data_files(pytestconfig):
11141114
"""
1115-
Returns the configuration for the test setting `--no-strict-data-files`.
1115+
Returns the configuration for the test setting `--strict-data-files`.
11161116
"""
1117-
return pytestconfig.getoption("--no-strict-data-files")
1117+
return pytestconfig.getoption("--strict-data-files")
11181118

11191119

11201120
@pytest.fixture
@@ -1134,7 +1134,7 @@ def datapath(strict_data_files: str) -> Callable[..., str]:
11341134
Raises
11351135
------
11361136
ValueError
1137-
If the path doesn't exist and the --no-strict-data-files option is not set.
1137+
If the path doesn't exist and the --strict-data-files option is set.
11381138
"""
11391139
BASE_PATH = os.path.join(os.path.dirname(__file__), "tests")
11401140

@@ -1143,7 +1143,7 @@ def deco(*args):
11431143
if not os.path.exists(path):
11441144
if strict_data_files:
11451145
raise ValueError(
1146-
f"Could not find file {path} and --no-strict-data-files is not set."
1146+
f"Could not find file {path} and --strict-data-files is set."
11471147
)
11481148
pytest.skip(f"Could not find {path}.")
11491149
return path

pandas/tests/frame/indexing/test_setitem.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ class mystring(str):
6161
"dtype", ["int32", "int64", "uint32", "uint64", "float32", "float64"]
6262
)
6363
def test_setitem_dtype(self, dtype, float_frame):
64-
# Use randint since casting negative floats to uints is undefined
65-
arr = np.random.randint(1, 10, len(float_frame))
64+
arr = np.random.randn(len(float_frame))
6665

6766
float_frame[dtype] = np.array(arr, dtype=dtype)
6867
assert float_frame[dtype].dtype.name == dtype

pandas/tests/series/methods/test_nlargest.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,7 @@ def test_nlargest_boolean(self, data, expected):
217217
def test_nlargest_nullable(self, any_numeric_ea_dtype):
218218
# GH#42816
219219
dtype = any_numeric_ea_dtype
220-
if dtype.startswith("UInt"):
221-
# Can't cast from negative float to uint on some platforms
222-
arr = np.random.randint(1, 10, 10)
223-
else:
224-
arr = np.random.randn(10)
225-
arr = arr.astype(dtype.lower(), copy=False)
220+
arr = np.random.randn(10).astype(dtype.lower(), copy=False)
226221

227222
ser = Series(arr.copy(), dtype=dtype)
228223
ser[1] = pd.NA

pandas/tests/test_common.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import collections
22
from functools import partial
3-
import os
43
import string
54

65
import numpy as np
@@ -175,12 +174,6 @@ def test_version_tag():
175174
)
176175

177176

178-
def test_pyproject_present():
179-
# Check pyproject.toml is present(relevant for wheels)
180-
pyproject_loc = os.path.join(os.path.dirname(__file__), "../../pyproject.toml")
181-
assert os.path.exists(pyproject_loc)
182-
183-
184177
@pytest.mark.parametrize(
185178
"obj", [(obj,) for obj in pd.__dict__.values() if callable(obj)]
186179
)

pyproject.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ include-package-data = true
125125
include = ["pandas", "pandas.*"]
126126
namespaces = false
127127

128-
[tool.setuptools.package-data]
129-
pandas = ["../pyproject.toml"]
130-
131128
[tool.setuptools.exclude-package-data]
132129
"*" = ["*.c", "*.h"]
133130

@@ -409,7 +406,7 @@ disable = [
409406
[tool.pytest.ini_options]
410407
# sync minversion with pyproject.toml & install.rst
411408
minversion = "7.0"
412-
addopts = "--strict-markers --strict-config --capture=no --durations=30 --junitxml=test-data.xml"
409+
addopts = "--strict-data-files --strict-markers --strict-config --capture=no --durations=30 --junitxml=test-data.xml"
413410
empty_parameter_set_mark = "fail_at_collect"
414411
xfail_strict = true
415412
testpaths = "pandas"
@@ -419,7 +416,6 @@ doctest_optionflags = [
419416
"ELLIPSIS",
420417
]
421418
filterwarnings = [
422-
"error::_pytest.warning_types.PytestUnknownMarkWarning",
423419
"error:::pandas",
424420
"error::ResourceWarning",
425421
"error::pytest.PytestUnraisableExceptionWarning",

0 commit comments

Comments
 (0)