Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate Py37 #1611

Merged
merged 2 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.

# Developing SparseML

SparseML is developed and tested using Python 3.7-3.10.
SparseML is developed and tested using Python 3.8-3.10.
To develop SparseML, you will also need the development dependencies and to follow the styling guidelines.

Here are some details to get started.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ SparseML enables you to create a sparse model trained on your dataset in two way

## Installation

This repository is tested on Python 3.7-3.10, and Linux/Debian systems.
This repository is tested on Python 3.8-3.10, and Linux/Debian systems.

It is recommended to install in a [virtual environment](https://docs.python.org/3/library/venv.html) to keep your system in order.
Currently supported ML Frameworks are the following: `torch>=1.1.0,<1.14`, `tensorflow>=1.8.0,<2.0.0`, `tensorflow.keras >= 2.2.0`.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.

# Installation

This repository is tested on Python 3.7-3.10, and Linux/Debian systems.
This repository is tested on Python 3.8-3.10, and Linux/Debian systems.
It is recommended to install in a [virtual environment](https://docs.python.org/3/library/venv.html) to keep your system in order.
Currently supported ML Frameworks are the following: `torch>=1.1.0,<1.14`, `tensorflow>=1.8.0,<=2.0.0`, `tensorflow.keras >= 2.2.0`.

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def _setup_long_description() -> Tuple[str, str]:
install_requires=_setup_install_requires(),
extras_require=_setup_extras(),
entry_points=_setup_entry_points(),
python_requires=">=3.7.0,<3.11",
python_requires=">=3.8.0,<3.11",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python :: 3",
Expand Down
13 changes: 2 additions & 11 deletions src/sparseml/pytorch/image_classification/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import logging
import os
import warnings
from contextlib import contextmanager
from contextlib import nullcontext
from enum import Enum, auto, unique
from typing import Any, Dict, List, Optional, Tuple, Union

Expand Down Expand Up @@ -262,7 +262,7 @@ def get_dataset_and_dataloader(
download_context = (
torch_distributed_zero_first(local_rank) # only download once locally
if training
else _nullcontext()
else nullcontext()
)
dataset_kwargs = dataset_kwargs or {}

Expand Down Expand Up @@ -620,12 +620,3 @@ def _download_model_from_zoo_using_recipe(
Model(recipe_stub),
recipe_name=recipe_type,
)


@contextmanager
def _nullcontext(enter_result=None):
"""
A context manager that does nothing. For compatibility with Python 3.6
Update usages to use contextlib.nullcontext on Python 3.7+
"""
yield enter_result
Loading