BLD: move metadata to setup.cfg
move metadata to setup.cfg to separate them from build logic. 

great. can you build like this https://github.com/pandas-dev/pandas-release to make sure things look good (mainly testing that the sdist looks good). cc @simonjayhawkins if you give this a quick test as well. shall we backport to 1.2.1? > great. can you build like this https://github.com/pandas-dev/pandas-release to make sure things look good (mainly testing that the sdist looks good).

Is uploading the sdist to testpypi the only way to test this? I couldn't get the version right. It won't allow me to upload the sdist. Nice! I'd suggesting adding https://github.com/asottile/setup-cfg-fmt as a pre-commit hook
```
  - repo: https://github.com/asottile/setup-cfg-fmt
    rev: v1.16.0
    hooks:
      - id: setup-cfg-fmt
``` @fangchenli you don't need to tag or upload 

just build the sdist in master and then on your PR and compare that they have the same metadata > cc @simonjayhawkins if you give this a quick test as well. shall we backport to 1.2.1?

pip-test and conda-test failures, 74 failed.

eg. `FileNotFoundError: [Errno 2] No such file or directory: '/opt/conda/envs/pip-test/lib/python3.7/site-packages/pandas/tests/io/parser/data/unicode_series.csv'` install from sdist and running `pandas.test(extra_args=['-m not clipboard', '--skip-slow', '--skip-network', '--skip-db', '-n=2'])` gives 87 failed which includes 13 failures seen at https://dev.azure.com/pandas-dev/pandas-wheels/_build/results?buildId=51595&view=logs&j=bb1c2637-64c6-57bd-9ea6-93823b2df951&t=9c62e7ff-391e-517d-ede1-af63bc6a25da&s=d654deb9-056d-50a2-1717-90c08683d50a @simonjayhawkins these failures are in a 32 bit build? are these not failing the ci now?

this PR is not related so this is concerning > this PR is not related so this is concerning

yeah, basically mentioning that if you get those 13 errors they are not from the changes here. > shall we backport to 1.2.1?

@jreback if we are changing the minimum version for setuptools then maybe should leave this change till 1.3

@fangchenli the last time we changed the minimum supported version of setuptools (in pandas-0.23.0) we included the change in the release notes. > > shall we backport to 1.2.1?
> 
> @jreback if we are changing the minimum version for setuptools then maybe should leave this change till 1.3
> 
> @fangchenli the last time we changed the minimum supported version of setuptools (in pandas-0.23.0) we included the change in the release notes.

its fine to do this for 1.3

though our min on setuptools itself is pretty old. > @simonjayhawkins these failures are in a 32 bit build? are these not failing the ci now?
> 
> this PR is not related so this is concerning

re-starting the job on MacPython (which pulls in master) and it passed on the 2nd attempt.

Merging master on this branch and those 13 tests now pass. (on linux with Python 3.8.5)
 > pip-test and conda-test failures, 74 failed.
> 
> eg. `FileNotFoundError: [Errno 2] No such file or directory: '/opt/conda/envs/pip-test/lib/python3.7/site-packages/pandas/tests/io/parser/data/unicode_series.csv'`

the tests that fail use the csv_dir_path fixture. AFAICT those tests should be failing since the directory exists (not all files are removed) but not the data file. so not sure why we have not seen these errors before now. @simonjayhawkins merge when ready > @simonjayhawkins merge when ready

If my method of testing this was correct, I assume merging this now will break the nightly builds.

@fangchenli have you built from the sdist and got the same test failures? @fangchenli I've added an extra ci workflow that can be removed once the tests pass.

The tests failing are those using the `csv_dir_path` fixture. There are also a couple of extra failures to those I've seen locally due to version number issues that can be ignored for now.  @fangchenli you have removed the install and test from the source dist? > @fangchenli you have removed the install and test from the source dist?

I accidentally removed it while merging master... Sorry about that. I've added it back. > > @fangchenli you have removed the install and test from the source dist?
> 
> I accidentally removed it while merging master... Sorry about that. I've added it back.

no problem. can remove before merge but need to sort out why the tests are failing with these changes and not before when pip installing sdist directly > > > @fangchenli you have removed the install and test from the source dist?
> > 
> > 
> > I accidentally removed it while merging master... Sorry about that. I've added it back.
> 
> no problem. can remove before merge but need to sort out why the tests are failing with these changes and not before when pip installing sdist directly

Most of those errors are FileNotFound. Does it mean the sdist doesn't include those data files? > Most of those errors are FileNotFound. Does it mean the sdist doesn't include those data files?

no they don't, but AFAIK never have.

the difference maybe in other files being included and so the directory exists any maybe it didn't before.

the issue is actually with the csv_dir_path fixture which incorrectly checks for the presence of the directory and not the file > the issue is actually with the csv_dir_path fixture which incorrectly checks for the presence of the directory and not the file

I excluded that dir in MANIFEST.in. It's working now. > > the issue is actually with the csv_dir_path fixture which incorrectly checks for the presence of the directory and not the file
> 
> I excluded that dir in MANIFEST.in. It's working now.

Thanks. You can remove that extra ci job now. lgtm. @simonjayhawkins  @simonjayhawkins @jorisvandenbossche this lgtm. looks like final comments have been addressed. merging tomorrow. > @simonjayhawkins should we consider keeping it? (I don't know how useful it is, or eg only on master)

we should maybe have this or something similar on ci. At the moment we will catch build errors on the nightly build.

but lets keep that discussion out of this PR. OK, sounds good @fangchenli maybe we should open issues for conditional numpy import https://github.com/pandas-dev/pandas/pull/38852#discussion_r552479485 and ci check https://github.com/pandas-dev/pandas/pull/38852#discussion_r552490251 @fangchenli one more rebase and then will merge. ping on green. Thanks @fangchenli 