• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Ouranosinc / figanos / 14839462019

05 May 2025 02:56PM UTC coverage: 8.19% (+0.08%) from 8.111%
14839462019

push

github

web-flow
Drop Python3.9, update several dependency pins (#322)

### What kind of change does this PR introduce?

* Drops Python3.9, enables Python3.13
* Updates several dependency pins
* Adjusts the CI to the new configurations

### Does this PR introduce a breaking change?

Yes. Python 3.9 is no longer supported (reaching EoL date in a few
months). Some base dependency pins are higher.

### Other information:

`figanos` is the only package in PAVICS that requires `numpy<2.0.0`.
This change should move us up for the next user images.

4 of 5 new or added lines in 2 files covered. (80.0%)

4 existing lines in 2 files now uncovered.

157 of 1917 relevant lines covered (8.19%)

0.41 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

22.73
/src/figanos/_testing.py
1
from collections.abc import Callable
5✔
2
from functools import wraps
5✔
3
from typing import IO
5✔
4

5
__all__ = ["pitou"]
5✔
6

7

8
def pitou():
5✔
9
    """Return a Pooch instance for the figanos testing data."""
10
    from figanos import __version__ as __figanos_version__
×
11

12
    try:
×
13
        import pooch
×
14
    except ImportError:
×
15
        raise ImportError(
×
16
            "The 'pooch' package is required to fetch the figanos testing data. "
17
            "You can install it using 'pip install pooch' or 'pip install \"figanos[docs]\"'."
18
        )
19

20
    _pitou = pooch.Pooch(
×
21
        path=pooch.os_cache("figanos"),
22
        base_url="https://raw.githubusercontent.com/Ouranosinc/figanos/main/src/figanos/data/test_data/",
23
        registry={
24
            "hatchmap-ens_stats.nc": "fc52d0551747fa0a7153f1ecfebf3e697993590c6c7c4c6a6f9f32700df9d32d",
25
            "hatchmap-inf_5.nc": "8f22522dc153d8d347bdf97bf85e49d08a5ecbc61c64372e713a0d25638e48ac",
26
            "hatchmap-sup_8.nc": "a409ebbd6ce3c0ca319f676cc21677ba500983b80ff65a64ef3d467008db824a",
27
        },
28
    )
29

30
    # Add a custom fetch method to the Pooch instance
31
    # Needed to address: https://github.com/readthedocs/readthedocs.org/issues/11763
32
    _pitou.fetch_diversion = _pitou.fetch
×
33

34
    # Overload the fetch method to add user-agent headers
35
    @wraps(_pitou.fetch_diversion)
×
NEW
36
    def _fetch(*args: str, **kwargs: bool | Callable) -> str:
×
37
        def _downloader(
×
38
            url: str,
39
            output_file: str | IO,
40
            poocher: pooch.Pooch,
41
            check_only: bool | None = False,
42
        ) -> None:
43
            """Download the file from the URL and save it to the save_path."""
44
            headers = {"User-Agent": f"figanos ({__figanos_version__})"}
×
45
            downloader = pooch.HTTPDownloader(headers=headers)
×
46
            return downloader(url, output_file, poocher, check_only=check_only)
×
47

48
        # default to our http/s downloader with user-agent headers
49
        kwargs.setdefault("downloader", _downloader)
×
50
        return _pitou.fetch_diversion(*args, **kwargs)
×
51

52
    # Replace the fetch method with the custom fetch method
53
    _pitou.fetch = _fetch
×
54

55
    return _pitou
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc