Might be possible to adapt

https://github.com/pandas-dev/pandas/blob/3cb70a5f0d1dc386f7806fca75abff6f098b1539/scripts/sync_flake8_versions.py

for this

Task is to have a check which makes sure that the black version here

https://github.com/pandas-dev/pandas/blob/3cb70a5f0d1dc386f7806fca75abff6f098b1539/.pre-commit-config.yaml#L19

and here

https://github.com/pandas-dev/pandas/blob/3cb70a5f0d1dc386f7806fca75abff6f098b1539/environment.yml#L21

are in sync

Comment From: mroeschke

Larger question: Is there a reason to have black in environment.yml at all since pre-commit runs black as part of the dev workflow?

Comment From: MarcoGorelli

Personally, I'd remove all linters and formatter from environment.yml and just leave them to be run via pre-commit

I remember that some had objections, though arguably if they want a linter/ formatter in their environment they can always install it on top of the current dependencies?

cc @simonjayhawkins IIRC you'd weighed in on this in the past?

Perhaps this is one for the next dev meeting

Comment From: simonjayhawkins

Personally, I'd remove all linters and formatter from environment.yml and just leave them to be run via pre-commit

makes sense if users are comfortable with pre-commit. I had some issues with pre-commit integration with VSCode in the past that I never got to the bottom of. So, personally I have it switched off and do the sort imports and black format manually and try to remember to run pre-commit run -a && mypy pandas --no-incremental before submitting a PR.

but nbd for me if need to install black and the rest manually. Not sure about the Docker container though. IIUC we would need to change our DockerFile to work properly with GH Codespaces (and I don't know the state of the discussion on that one - I requested the preview but was not accepted so never tested). So it maybe that there is an advantage to having the linting tools pre-installed in the dev environment for GH Codespaces with VSCode integration.

Comment From: MarcoGorelli

this is solved by having required_version in pyproject.toml