Skip to content

BLD: Split out tests into pandas_tests package #53007

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 56 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
d3edcdf
BLD: Split out tests into pandas_tests package
lithomas1 Apr 29, 2023
8e0d861
Merge branch 'main' of https://github.com/pandas-dev/pandas into remo…
lithomas1 Aug 23, 2023
bd83272
update for meson
lithomas1 Aug 23, 2023
339dacc
adjust cibuildwheel command?
lithomas1 Aug 23, 2023
eea0220
Merge branch 'main' of https://github.com/pandas-dev/pandas into remo…
lithomas1 Aug 23, 2023
a5a89b3
update
lithomas1 Aug 23, 2023
48df264
try again
lithomas1 Aug 23, 2023
d00e471
fix more
lithomas1 Aug 23, 2023
a43c9fe
update
lithomas1 Aug 23, 2023
b2c2b8c
Merge branch 'main' of github.com:pandas-dev/pandas into remove-tests
lithomas1 Feb 11, 2024
d6ac87c
Update wheels.yml
lithomas1 Feb 11, 2024
427ea4e
try fix paths
lithomas1 Feb 11, 2024
7174249
try something
lithomas1 Feb 11, 2024
f50f110
try something
lithomas1 Feb 11, 2024
9cbbb66
typo
lithomas1 Feb 11, 2024
053ad48
try again
lithomas1 Feb 11, 2024
f2573ee
another error
lithomas1 Feb 11, 2024
547dcc1
try github.workspace
lithomas1 Feb 11, 2024
1044441
working?
lithomas1 Feb 11, 2024
f3c182a
go for green on GHA
lithomas1 Feb 11, 2024
06d3697
try build from sdist on circleci
lithomas1 Feb 11, 2024
13063d8
debug circleci
lithomas1 Feb 12, 2024
8254943
debug circleci
lithomas1 Feb 12, 2024
9ed91e0
try exporting?
lithomas1 Feb 12, 2024
d4502af
green everything except musl?
lithomas1 Feb 12, 2024
b61a6a4
add missing deps?
lithomas1 Feb 12, 2024
1a6531c
upload wheels
lithomas1 Feb 12, 2024
e00ecf5
Merge branch 'main' of github.com:pandas-dev/pandas into remove-tests
lithomas1 Mar 16, 2024
799687f
try something
lithomas1 Mar 16, 2024
1d6137b
change pytest target
lithomas1 Mar 17, 2024
792c011
go for green
lithomas1 Mar 17, 2024
2a78345
fix import redirects
lithomas1 Mar 17, 2024
16f5964
try something
lithomas1 Mar 17, 2024
b911945
go for green take 2
lithomas1 Mar 17, 2024
beb64dc
try fixing windows
lithomas1 Mar 17, 2024
3135e67
try again to fix windows
lithomas1 Mar 17, 2024
d17ddaf
Update wheels.yml
lithomas1 Mar 18, 2024
50410ad
Update config.yml
lithomas1 Mar 18, 2024
554d478
Merge branch 'main' into remove-tests
lithomas1 Mar 18, 2024
8d68f7d
try for green again
lithomas1 Mar 18, 2024
98ec61a
try to fix doctests?
lithomas1 Mar 18, 2024
b8e3588
try doctests again
lithomas1 Mar 18, 2024
a19f2e6
get rid of cython doctests
lithomas1 Mar 18, 2024
b4aa062
try again
lithomas1 Mar 18, 2024
a2ba3bf
add back some config options to pyproject.toml
lithomas1 Mar 18, 2024
7ee6adc
meson changes
lithomas1 Mar 18, 2024
19fa7f9
try moving back stuff to the original conftest
lithomas1 Mar 18, 2024
be64699
fix typing?
lithomas1 Mar 18, 2024
f1c18cc
Merge branch 'main' into remove-tests
lithomas1 Mar 18, 2024
e835993
add pyright ignore
lithomas1 Mar 18, 2024
5bdc0d1
Merge branch 'remove-tests' of github.com:lithomas1/pandas into remov…
lithomas1 Mar 18, 2024
2cf3911
last ignore
lithomas1 Mar 18, 2024
e9ba935
fix musl
lithomas1 Mar 18, 2024
e53ad08
Update code_checks.sh
lithomas1 Mar 20, 2024
23952aa
Merge branch 'main' into remove-tests
lithomas1 Mar 20, 2024
23b9827
Merge branch 'main' into remove-tests
lithomas1 Mar 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ global-exclude *.pxi
# 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
#prune pandas/tests/io/parser/data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this commented out on purpose? Remove?


# Remove tests
# Those will be distributed in a separate package
prune pandas/tests

# Selectively re-add *.cxx files that were excluded above
graft pandas/_libs/src
Expand Down
22 changes: 22 additions & 0 deletions pandas/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Note: This is the pyproject.toml for the pandas-tests package
# The pyproject.toml for the pandas package is in the parent directory
# of this one
[build-system]
requires = [
"setuptools>=61.0.0",
]
[project]
name="pandas-tests"
# Note: The version is hardcoded since the pandas version has to
# match the tests version. Remember to bump both!
version="2.1"
#dependencies=[
# "pandas==2.1.0"
#]
Comment on lines +13 to +15
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this still be commented out?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reminder.

I planned on doing this in a followup (since technically this only needs to be set at release time), but then realized I can do this programmtically.

I'll make the changes to the wheel builder workflow soon.

requires-python=">=3.9"

[tool.setuptools]
package-dir={"pandas_tests"= "tests"}

[tool.setuptools.package-data]
"pandas_tests"=["pytest.ini"]
2 changes: 1 addition & 1 deletion pandas/conftest.py → pandas/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,7 @@ def datapath(strict_data_files: str) -> Callable[..., str]:
ValueError
If the path doesn't exist and the --strict-data-files option is set.
"""
BASE_PATH = os.path.join(os.path.dirname(__file__), "tests")
BASE_PATH = os.path.join(os.path.dirname(__file__), "")

def deco(*args):
path = os.path.join(BASE_PATH, *args)
Expand Down
44 changes: 44 additions & 0 deletions pandas/tests/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[pytest]
# sync minversion with pyproject.toml & install.rst
minversion = 7.0
addopts = --strict-data-files --strict-markers --strict-config --capture=no --durations=30 --junitxml=test-data.xml
empty_parameter_set_mark = fail_at_collect
xfail_strict = true
testpaths = pandas
doctest_optionflags =
NORMALIZE_WHITESPACE
IGNORE_EXCEPTION_DETAIL
ELLIPSIS

filterwarnings =
error:::pandas
error::ResourceWarning
error::pytest.PytestUnraisableExceptionWarning
ignore:.*ssl.SSLSocket:pytest.PytestUnraisableExceptionWarning
ignore:.*ssl.SSLSocket:ResourceWarning
ignore::ResourceWarning:asyncio
# From plotting doctests
ignore:More than 20 figures have been opened:RuntimeWarning
# Will be fixed in numba 0.56: https://github.com/numba/numba/issues/7758
ignore:`np.MachAr` is deprecated:DeprecationWarning:numba
ignore:.*urllib3:DeprecationWarning:botocore
ignore:Setuptools is replacing distutils.:UserWarning:_distutils_hack
# https://github.com/PyTables/PyTables/issues/822
ignore:a closed node found in the registry:UserWarning:tables
ignore:`np.object` is a deprecated:DeprecationWarning:tables
ignore:tostring:DeprecationWarning:tables
ignore:distutils Version classes are deprecated:DeprecationWarning:numexpr
ignore:distutils Version classes are deprecated:DeprecationWarning:fastparquet
ignore:distutils Version classes are deprecated:DeprecationWarning:fsspec

junit_family = xunit2
markers =
single_cpu: tests that should run on a single cpu only
slow: mark a test as slow
network: mark a test as network
db: tests requiring a database (mysql or postgres)
clipboard: mark a pd.read_clipboard test
arm_slow: mark a test as slow for arm64 architecture
arraymanager: mark a test to run with ArrayManager enabled

asyncio_mode = strict
4 changes: 2 additions & 2 deletions pandas/util/_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

from pandas.compat._optional import import_optional_dependency

PKG = os.path.dirname(os.path.dirname(__file__))


def test(extra_args: list[str] | None = None) -> None:
"""
Expand All @@ -23,6 +21,8 @@ def test(extra_args: list[str] | None = None) -> None:
Extra marks to run the tests.
"""
pytest = import_optional_dependency("pytest")
pandas_tests = import_optional_dependency("pandas_tests")
PKG = os.path.dirname(pandas_tests.__file__)
import_optional_dependency("hypothesis")
cmd = ['-m "not slow and not network and not db"']
if extra_args:
Expand Down
47 changes: 2 additions & 45 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ include-package-data = true

[tool.setuptools.packages.find]
include = ["pandas", "pandas.*"]
# need to have a * after otherwise won't match anything
exclude = ["pandas.tests*"]
namespaces = false

[tool.setuptools.exclude-package-data]
Expand Down Expand Up @@ -415,51 +417,6 @@ disable = [
"using-constant-test"
]

[tool.pytest.ini_options]
# sync minversion with pyproject.toml & install.rst
minversion = "7.0"
addopts = "--strict-data-files --strict-markers --strict-config --capture=no --durations=30 --junitxml=test-data.xml"
empty_parameter_set_mark = "fail_at_collect"
xfail_strict = true
testpaths = "pandas"
doctest_optionflags = [
"NORMALIZE_WHITESPACE",
"IGNORE_EXCEPTION_DETAIL",
"ELLIPSIS",
]
filterwarnings = [
"error:::pandas",
"error::ResourceWarning",
"error::pytest.PytestUnraisableExceptionWarning",
"ignore:.*ssl.SSLSocket:pytest.PytestUnraisableExceptionWarning",
"ignore:.*ssl.SSLSocket:ResourceWarning",
"ignore::ResourceWarning:asyncio",
# From plotting doctests
"ignore:More than 20 figures have been opened:RuntimeWarning",
# Will be fixed in numba 0.56: https://github.com/numba/numba/issues/7758
"ignore:`np.MachAr` is deprecated:DeprecationWarning:numba",
"ignore:.*urllib3:DeprecationWarning:botocore",
"ignore:Setuptools is replacing distutils.:UserWarning:_distutils_hack",
# https://github.com/PyTables/PyTables/issues/822
"ignore:a closed node found in the registry:UserWarning:tables",
"ignore:`np.object` is a deprecated:DeprecationWarning:tables",
"ignore:tostring:DeprecationWarning:tables",
"ignore:distutils Version classes are deprecated:DeprecationWarning:numexpr",
"ignore:distutils Version classes are deprecated:DeprecationWarning:fastparquet",
"ignore:distutils Version classes are deprecated:DeprecationWarning:fsspec",
]
junit_family = "xunit2"
markers = [
"single_cpu: tests that should run on a single cpu only",
"slow: mark a test as slow",
"network: mark a test as network",
"db: tests requiring a database (mysql or postgres)",
"clipboard: mark a pd.read_clipboard test",
"arm_slow: mark a test as slow for arm64 architecture",
"arraymanager: mark a test to run with ArrayManager enabled",
]
asyncio_mode = "strict"

[tool.mypy]
# Import discovery
mypy_path = "typings"
Expand Down