Pandas version checks

  • [X] I have checked that this issue has not already been reported.

  • [X] I have confirmed this bug exists on the latest version of pandas.

  • [X] I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

pip install --upgrade --pre --extra-index https://pypi.anaconda.org/scipy-wheels-nightly/simple pandas

Issue Description

I noticed the root of my site-packages folder had a rogue pyproject.toml in it from pandas. Not sure if this is a issue with the wheel build or something but it's definitely not designed behavior. I'm not sure if this just an issue with the nightly or not.

Removing it and re-running the install resulted in the same behavior.

pip 23.0.1

Expected Behavior

No pyproject.toml should be placed in the root of site-packages

Installed Versions

INSTALLED VERSIONS ------------------ commit : 3083ae932e0b122e963608fb25cf3df06d588b03 python : 3.9.16.final.0 python-bits : 64 OS : Darwin OS-release : 22.3.0 Version : Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000 machine : arm64 processor : arm byteorder : little LC_ALL : None LANG : en_US.UTF-8 LOCALE : en_US.UTF-8 pandas : 2.1.0.dev0+289.g3083ae932e numpy : 1.25.0.dev0+941.gb35aac2c3 pytz : 2022.7.1 dateutil : 2.8.2 setuptools : 67.6.0 pip : 23.0.1 Cython : None pytest : None hypothesis : None sphinx : None blosc : None feather : None xlsxwriter : None lxml.etree : None html5lib : 1.1 pymysql : None psycopg2 : None jinja2 : 3.1.2 IPython : 8.11.0 pandas_datareader: None bs4 : 4.11.2 bottleneck : None brotli : fastparquet : None fsspec : 2023.3.0 gcsfs : None matplotlib : None numba : None numexpr : None odfpy : None openpyxl : None pandas_gbq : None pyarrow : None pyreadstat : None pyxlsb : None s3fs : None scipy : None snappy : None sqlalchemy : None tables : None tabulate : None xarray : None xlrd : None zstandard : None tzdata : 2022.7 qtpy : None pyqt5 : None

Comment From: mroeschke

This was added in https://github.com/pandas-dev/pandas/pull/50330 because pd.test needs the pytest markers defined in pyproject.toml to work fully.

Comment From: shughes-uk

Putting it in site-packages is not the place to put it as there's a risk of it colliding with other packages or causing weird issues , site-packages/pandas would be ok I think?

If this was the behavior only for the nightly package that might also be ok

Comment From: mroeschke

cc @lithomas1