Repository: PowerGridModel/power-grid-model (language: cpp)

Issue:
[FEATURE] Fallback when downloading fails in CI/CD
## Description

Fallback when the rate limit is exceeded to prevent GitHub actions from failing

## Background

common libraries like `msgpack-cxx` are downloaded so often that the rate limit is exceeded for that repo (see also the [GitHub documentation](https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limiting), denying the download request with a `403` response

This is a problem especially when CI/CD automation depends on a third-party package

## Proposed solution

There are 4 possible workarounds:

* [x] Independently repackaging and pushing to [PyPI](https://pypi.org/project/msgpack-cxx/6.1.0/)
* [ ] In the PGM organisation: Create a mirroring fork for often-failing packages (`msgpack-cxx`)
* In https://github.com/TonyXiang8787/pybuild-header-dependency :
  * [ ] Follow the steps in https://stackoverflow.com/questions/13394077/is-there-a-way-to-increase-the-api-rate-limit-or-to-bypass-it-altogether-for-git to authorize .
  * [ ] Do not use the GitHub API but instead `git clone` using `https` when downloading.

## Location
This concerns the line https://github.com/TonyXiang8787/pybuild-header-dependency/blob/81a186456512beb6b9cafde08df13b4bfebe49e9/src/pybuild_header_dependency/github_downloader.py#L16

```py
class GitHubDownloader(GitDownloader):
    # ... (truncated)

    def release_url(self) -> str:
        return f"https://api.github.com/repos/{self.repository_name}/releases"

    # ... (truncated)
```




Discussion / hints:

Fix patch:
diff --git a/pyproject.toml b/pyproject.toml
index b09bf0f86..a0ed59bda 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -7,6 +7,7 @@ requires = [
     "setuptools",
     "wheel",
     "pybuild-header-dependency",
+    "msgpack-cxx",
 ]
 build-backend = "setuptools.build_meta"
 
diff --git a/setup.py b/setup.py
index 01c933813..8cb4b25ef 100644
--- a/setup.py
+++ b/setup.py
@@ -23,7 +23,22 @@
     raise SystemError("Only Windows, Linux, or MacOS is supported!")
 
 
-def get_header_include() -> List[str]:
+def get_required_dependency_include() -> List[str]:
+    """
+    Get build requirements includes.
+
+    Returns:
+        either empty list or a list of header path
+    """
+    try:
+        import msgpack_cxx
+
+        return [str(msgpack_cxx.get_include())]
+    except ImportError:
+        return []
+
+
+def get_pre_installed_header_include() -> List[str]:
     """
     Get header files from pybuild_header_dependency, if it is installed
 
@@ -33,7 +48,7 @@ def get_header_include() -> List[str]:
     try:
         from pybuild_header_dependency import HeaderResolver
 
-        resolver = HeaderResolver({"eigen": None, "boost": None, "msgpack-cxx": None, "nlohmann_json": None})
+        resolver = HeaderResolver({"eigen": None, "boost": None, "nlohmann_json": None})
         return [str(resolver.get_include())]
     except ImportError:
         return []
@@ -131,7 +146,8 @@ def generate_build_ext(pkg_dir: Path, pkg_name: str):
         str(pkg_dir / pgm_c / pgm / "include"),  # The include-folder of the library
         str(pkg_dir / pgm_c / pgm_c / "include"),  # The include-folder of the C API self
     ]
-    include_dirs += get_header_include()
+    include_dirs += get_required_dependency_include()
+    include_dirs += get_pre_installed_header_include()
     include_dirs += get_conda_include()
     # compiler and link flag
     cflags: List[str] = []


Test patch: