DEPS: Sync environment.yml with CI dep files
State: closed

- [x] closes #45178 (Replace xxxx with the Github issue number)
- [x] closes #43804 (Replace xxxx with the Github issue number)
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

Also add a GHA job to check that the generated `requirements-dev.txt` file, synced from `environment.yml`, can be installed.

Labels:
name: CI
description: Continuous Integration
name: Dependencies
description: Required and optional dependencies

Comments:
@twoertwein any idea why adding some dependencies to `environment.yml` would uncover these typing errors?
https://github.com/pandas-dev/pandas/runs/6803850160?check_suite_focus=true
The reportMissingImports from pyright indicate that the PyQt package is no longer installed. But many of the mypy errors look not related to PyQt: is it using a newer version of numpy (locally I'm using numpy 1.22.4)?
If pyqt has no type annotations (not sure whether that is the case), there is not much value in raising errors: could add `# pyright: reportMissingImports = false` at the top of `pandas/io/clipboard/__init__.py`
> If pyqt has no type annotations (not sure whether that is the case), there is not much value in raising errors: could add `# pyright: reportMissingImports = false` at the top of `pandas/io/clipboard/__init__.py`

I think `pandas/io/clipboard/__init__.py` is copied from Pyperclip: and already excluded from the "main" pyright run but not from the pyright reportGeneralTypeIssues run.

Would be good to add the excludes from https://github.com/pandas-dev/pandas/blob/297c59abbe218f3ccb89fb25bee48f619c1e0d2d/pyproject.toml#L160 here https://github.com/pandas-dev/pandas/blob/297c59abbe218f3ccb89fb25bee48f619c1e0d2d/pyright_reportGeneralTypeIssues.json#L13 something like

```
        # exclude tests
        "pandas/tests",
        # exclude vendored files
        "pandas/io/clipboard",
        "pandas/util/version",
        # and all files that currently don't pass
        ...
```

Happy to open a PR or you can include these changes in your PR.
> @twoertwein would appreciate another look at the tying changes

The ignore comments look good to me (just a bit annoying that we need to undo those changes when numba supports numpy 1.22.4).

It sounds reasonable to me to use the latest numba-compatible numpy and numpy-dev for testing but technically, there could be some weird behavior with the newest numpy that is already fixed in numpy-dev.
lgtm. (prob need to manually backport).
@meeseeksdev backport 1.4.x
Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

1. Checkout backport branch and update it.

```
git checkout 1.4.x
git pull
```

2. Cherry pick the first parent branch of the this PR on top of the older branch:
```
git cherry-pick -x -m1 fa5a6044b7982c26e0f5a775d5f2e34d388589f4
```

3. You will likely have some merge/cherry-pick conflict here, fix them and commit:

```
git commit -am 'Backport PR #47287: DEPS: Sync environment.yml with CI dep files'
```

4. Push to a named branch:

```
git push YOURFORK 1.4.x:auto-backport-of-pr-47287-on-1.4.x
```

5. Create a PR against branch 1.4.x, I would have named this PR:

> "Backport PR #47287 on branch 1.4.x (DEPS: Sync environment.yml with CI dep files)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the `Still Needs Manual Backport` label once the PR gets merged.

If these instructions are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
                
Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

1. Checkout backport branch and update it.

```
git checkout 1.4.x
git pull
```

2. Cherry pick the first parent branch of the this PR on top of the older branch:
```
git cherry-pick -x -m1 fa5a6044b7982c26e0f5a775d5f2e34d388589f4
```

3. You will likely have some merge/cherry-pick conflict here, fix them and commit:

```
git commit -am 'Backport PR #47287: DEPS: Sync environment.yml with CI dep files'
```

4. Push to a named branch:

```
git push YOURFORK 1.4.x:auto-backport-of-pr-47287-on-1.4.x
```

5. Create a PR against branch 1.4.x, I would have named this PR:

> "Backport PR #47287 on branch 1.4.x (DEPS: Sync environment.yml with CI dep files)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the `Still Needs Manual Backport` label once the PR gets merged.

If these instructions are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
                
There are typing failures on main from this commit.
> There are typing failures on main from this commit.

It seems that the CI installed numpy 1.22.4 and numba 0.55.2. For some reason, they did not happily co-exist before (even though neither of them had a new release recently).