Repository: huggingface/huggingface_hub

Issue:
Support python=3.10
Python 3.10 has been out for a while but we seem to not test for it. What are the roadblocks for us to support 3.10 and maybe deprecate 3.6? (Many packages now support 3.8-3.10 and older versions are not supported anymore).

Ping @LysandreJik @osanseviero maybe?


Discussion:
It should just be as simple as changing python-tests.yml matrix to be 3.7 and 3.10 for the python versions, rather than 3.6 and 3.9. 

Not sure if anything would break, but that'd be the spot for the CI
If we deprecate python 3.6, things can probably simplify in some places as well cc @omarespejel and @merveenoyan 
Python 3.10: Definitely, let's update the CI to use 3.10 instead.

---

Python 3.6: As this package is a dependency for a lot of libraries, we ought to check with the downstream libraries to see if they don't still support 3.6:

- `transformers`: 3.6+, will likely drop 3.6 support over the coming weeks
- `datasets`: 3.6+, @lhoestq could you comment on the upcoming support?
- `adapter-transformers`: 3.6+
- `allennlp`: 3.7+ :heavy_check_mark: 
- `asteroid`: 3.6+
- `espnet`: 3.7+ :heavy_check_mark: 
- `fairseq`: 3.6+
- `flair`: 3.6+
- `keras`: 3.7+ :heavy_check_mark: 
- `pyannote`: 3.7+
- `sentence-transformers`: 3.6+
- `spacy`: 3.6+
- `speechbrain`: 3.7+ :heavy_check_mark: 
- `tensorflowtts`: 3.7+ :heavy_check_mark: 
- `timm`: 3.6+
- `fastai`: 3.6+
- `stanza`: 3.6+
- `fasttext`: 2.7/3.4+
- `stable-baselines3`: 3.7+ :heavy_check_mark: 
- `doctr`: 3.6+

@osanseviero let me know if I have missed some!

Given that a lot of these still support 3.6, I would advocate to wait for at least 1-2 months before dropping support so as to not be the vector of change. 

We also have a significant number of users (~10%) still using `huggingface_hub` on version 3.6:

<img width="584" alt="https://pypistats.org/packages/huggingface-hub" src="https://user-images.githubusercontent.com/30755778/159657213-d2135079-d528-460e-aec7-d71f565a7736.png">

(from https://pypistats.org/packages/huggingface-hub)

Of course, for security concerns and for simplicity we'll switch to 3.7 sooner rather than later.
The list seems complete! Just to add, most (hopefully all) of those have a pinned `huggingface_hub` version, so removing 3.6 support would not be a breaking issue unless they want to upgrade.
I think a more relevant question would be if there is any package having dependencies on `huggingface_hub` which does not support 3.7, and there doesn't seem to be any?

But also as @osanseviero mentions, this doesn't change older versions and users can still install the older ones if the need py=3.6 support. They usually don't even notice the issue since `pip` would do that for them.
For `datasets` we can consider dropping support for 3.6 soon as well, since its main dependency PyArrow already stopped supporting 3.6. ~10% of `datasets` users have 3.6, pretty much like `transformers`.

(though last week we got 100k+ pip installs from 3.6 but it looks like an outlier)

<img width="1058" alt="image" src="https://user-images.githubusercontent.com/42851186/159674998-f00ee860-2ad2-457d-a2a4-5bb4e5c8c950.png">


Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -69,7 +69,7 @@ def get_version() -> str:
             "huggingface-cli=huggingface_hub.commands.huggingface_cli:main"
         ]
     },
-    python_requires=">=3.6.0",
+    python_requires=">=3.7.0",
     install_requires=install_requires,
     classifiers=[
         "Intended Audience :: Developers",


Test patch: