DEV: don't install tables on MacOS ARM in dev requirements.txt (add env markers)
State: closed

When installing dependencies via pip on Mac M1 or M2 installing tables is not trivial and throws an error (see below) because wheels of tables for this hardware is not available and building depends on hdf5.

The solution is to exclude the install of tables via environment markers in the `requirements-dev.txt`. This file is generated by `scripts/generate_pip_deps_from_conda.py`.

This commit adds the following functionality to `scripts/generate_pip_deps_from_conda.py`:
- Adding environment markers to dependencies specified in `ADD_ENV_MARKERS`.
- Allow multiple operations on the same package (add env markers, rename package and remap version).


- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [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).
- [x] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


# error installing tables
```pip install tables
Collecting tables
  Using cached tables-3.8.0.tar.gz (8.0 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [11 lines of output]
      <string>:19: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
      ld: library not found for -lhdf5
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      cpuinfo failed, assuming no CPU features: 'flags'
      * Using Python 3.10.10 (main, Apr 20 2023, 14:37:50) [Clang 14.0.0 (clang-1400.0.29.202)]
      * Found cython 3.0.2
      * USE_PKGCONFIG: True
      .. ERROR:: Could not find a local HDF5 installation.
         You may need to explicitly state where your local HDF5 headers and
         library can be found by setting the ``HDF5_DIR`` environment
         variable or by using the ``--hdf5`` command-line option.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.```

Labels:
name: Stale
name: OS X
description: Related to Mac OS & hardware issues (M1)
name: Sprints
description: Sprint Pull Requests

Comments:
@JSchuurmans do you have time to update for my small comment?
@jorisvandenbossche Your comment looks good, updated the branch accordingly.
I will have a look at the formatting later this week.
@jorisvandenbossche , I made it complient with ruff :)
This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.