Skip to content

Commit a56a25f

Browse files
Wauplinhanouticelina
authored andcommitted
Bump minimal version to Python3.9 (#3343)
* Bump minimal version to Python3.9 * use built-in generics * code quality * new batch * yet another btach * fix dataclass_with_extra * fix * keep Type for strict dataclasses * fix test
1 parent f8cc841 commit a56a25f

File tree

141 files changed

+1457
-1490
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+1457
-1490
lines changed

.github/workflows/contrib-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626

2727
steps:
2828
- uses: actions/checkout@v2
29-
- name: Set up Python 3.8
29+
- name: Set up Python 3.9
3030
uses: actions/setup-python@v2
3131
with:
32-
python-version: 3.8
32+
python-version: 3.9
3333

3434
# Install pip
3535
- name: Install pip

.github/workflows/python-tests.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
python-version: ["3.8", "3.13"]
24+
python-version: ["3.9", "3.13"]
2525
test_name:
2626
[
2727
"Repository only",
@@ -30,18 +30,18 @@ jobs:
3030
"Xet only"
3131
]
3232
include:
33-
- python-version: "3.13" # LFS not ran on 3.8
33+
- python-version: "3.13" # LFS not ran on 3.9
3434
test_name: "lfs"
35-
- python-version: "3.8"
35+
- python-version: "3.9"
3636
test_name: "fastai"
3737
- python-version: "3.10" # fastai not supported on 3.12 and 3.11 -> test it on 3.10
3838
test_name: "fastai"
39-
- python-version: "3.8"
39+
- python-version: "3.9"
4040
test_name: "tensorflow"
4141
- python-version: "3.10" # tensorflow not supported on 3.12 -> test it on 3.10
4242
test_name: "tensorflow"
43-
- python-version: "3.8" # test torch~=1.11 on python 3.8 only.
44-
test_name: "Python 3.8, torch_1.11"
43+
- python-version: "3.9" # test torch~=1.11 on python 3.9 only.
44+
test_name: "Python 3.9, torch_1.11"
4545
- python-version: "3.12" # test torch latest on python 3.12 only.
4646
test_name: "torch_latest"
4747
steps:
@@ -84,7 +84,7 @@ jobs:
8484
uv pip install --upgrade torch
8585
;;
8686
87-
"Python 3.8, torch_1.11")
87+
"Python 3.9, torch_1.11")
8888
uv pip install "huggingface_hub[torch] @ ."
8989
uv pip install torch~=1.11
9090
;;
@@ -147,7 +147,7 @@ jobs:
147147
eval "$PYTEST ../tests/test_serialization.py"
148148
;;
149149
150-
"Python 3.8, torch_1.11" | torch_latest)
150+
"Python 3.9, torch_1.11" | torch_latest)
151151
eval "$PYTEST ../tests/test_hub_mixin*"
152152
eval "$PYTEST ../tests/test_serialization.py"
153153
;;
@@ -178,7 +178,7 @@ jobs:
178178
strategy:
179179
fail-fast: false
180180
matrix:
181-
python-version: ["3.8", "3.11"]
181+
python-version: ["3.9", "3.11"]
182182
test_name: ["Everything else", "Xet only"]
183183

184184
steps:

.github/workflows/release-conda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
with:
2727
auto-update-conda: true
2828
auto-activate-base: false
29-
python-version: 3.8
29+
python-version: 3.9
3030
activate-environment: "build-hub"
3131

3232
- name: Setup conda env

docs/source/cn/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ rendered properly in your Markdown viewer.
66

77
在开始之前,您需要通过安装适当的软件包来设置您的环境
88

9-
huggingface_hub 在 Python 3.8 或更高版本上进行了测试,可以保证在这些版本上正常运行。如果您使用的是 Python 3.7 或更低版本,可能会出现兼容性问题
9+
huggingface_hub 在 Python 3.9 或更高版本上进行了测试,可以保证在这些版本上正常运行。如果您使用的是 Python 3.7 或更低版本,可能会出现兼容性问题
1010

1111
## 使用 pip 安装
1212

docs/source/de/guides/integrations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ class PyTorchModelHubMixin(ModelHubMixin):
202202
revision: str,
203203
cache_dir: str,
204204
force_download: bool,
205-
proxies: Optional[Dict],
205+
proxies: Optional[dict],
206206
resume_download: bool,
207207
local_files_only: bool,
208208
token: Union[str, bool, None],

docs/source/de/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ rendered properly in your Markdown viewer.
66

77
Bevor Sie beginnen, müssen Sie Ihre Umgebung vorbereiten, indem Sie die entsprechenden Pakete installieren.
88

9-
`huggingface_hub` wurde für **Python 3.8+** getestet.
9+
`huggingface_hub` wurde für **Python 3.9+** getestet.
1010

1111
## Installation mit pip
1212

docs/source/en/guides/integrations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ class PyTorchModelHubMixin(ModelHubMixin):
244244
revision: str,
245245
cache_dir: str,
246246
force_download: bool,
247-
proxies: Optional[Dict],
247+
proxies: Optional[dict],
248248
resume_download: bool,
249249
local_files_only: bool,
250250
token: Union[str, bool, None],

docs/source/en/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ rendered properly in your Markdown viewer.
66

77
Before you start, you will need to setup your environment by installing the appropriate packages.
88

9-
`huggingface_hub` is tested on **Python 3.8+**.
9+
`huggingface_hub` is tested on **Python 3.9+**.
1010

1111
## Install with pip
1212

docs/source/fr/guides/integrations.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ class PyTorchModelHubMixin(ModelHubMixin):
223223
revision: str,
224224
cache_dir: str,
225225
force_download: bool,
226-
proxies: Optional[Dict],
226+
proxies: Optional[dict],
227227
resume_download: bool,
228228
local_files_only: bool,
229229
token: Union[str, bool, None],
@@ -266,9 +266,9 @@ est ici pour vous donner des indications et des idées sur comment gérer l'int
266266
n'hésitez pas à nous contacter si vous avez une question !
267267

268268
<!-- Généré en utilisant https://www.tablesgenerator.com/markdown_tables -->
269-
| Intégration | Utilisant des helpers | Utilisant [`ModelHubMixin`] |
270-
|:---:|:---:|:---:|
271-
| Expérience utilisateur | `model = load_from_hub(...)`<br>`push_to_hub(model, ...)` | `model = MyModel.from_pretrained(...)`<br>`model.push_to_hub(...)` |
272-
| Flexible | Très flexible.<br>Vous controllez complètement l'implémentation. | Moins flexible.<br>Votre framework doit avoir une classe de modèle. |
273-
| Maintenance | Plus de maintenance pour ajouter du support pour la configuration, et de nouvelles fonctionnalités. Peut aussi nécessiter de fixx des problèmes signalés par les utilisateurs.| Moins de maintenance vu que la plupart des intégrations avec le Hub sont implémentés dans `huggingface_hub` |
274-
| Documentation / Anotation de type| A écrire à la main | Géré partiellement par `huggingface_hub`. |
269+
| Intégration | Utilisant des helpers | Utilisant [`ModelHubMixin`] |
270+
| :-------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------: |
271+
| Expérience utilisateur | `model = load_from_hub(...)`<br>`push_to_hub(model, ...)` | `model = MyModel.from_pretrained(...)`<br>`model.push_to_hub(...)` |
272+
| Flexible | Très flexible.<br>Vous controllez complètement l'implémentation. | Moins flexible.<br>Votre framework doit avoir une classe de modèle. |
273+
| Maintenance | Plus de maintenance pour ajouter du support pour la configuration, et de nouvelles fonctionnalités. Peut aussi nécessiter de fixx des problèmes signalés par les utilisateurs. | Moins de maintenance vu que la plupart des intégrations avec le Hub sont implémentés dans `huggingface_hub` |
274+
| Documentation / Anotation de type | A écrire à la main | Géré partiellement par `huggingface_hub`. |

docs/source/fr/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ rendered properly in your Markdown viewer.
77
Avant de commencer, vous allez avoir besoin de préparer votre environnement
88
en installant les packages appropriés.
99

10-
`huggingface_hub` est testée sur **Python 3.8+**.
10+
`huggingface_hub` est testée sur **Python 3.9+**.
1111

1212
## Installation avec pip
1313

0 commit comments

Comments
 (0)