Unverified Commit 424f7b5b authored by Yifan Xiong's avatar Yifan Xiong Committed by GitHub
Browse files

Setup - Fix installation and lint issues (#684)

Fix installation and lint issues:

* Fix transformer installation in Python3.7 due to upgrade of safetensors.
* Fix lint issues in mypy 1.14.1.
parent 060f4f82
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
import os import os
import sys import sys
import pathlib import pathlib
from typing import List, Tuple from typing import List, Tuple, ClassVar
import pkg_resources import pkg_resources
from setuptools import setup, find_packages, Command from setuptools import setup, find_packages, Command
...@@ -39,7 +39,7 @@ class Formatter(Command): ...@@ -39,7 +39,7 @@ class Formatter(Command):
""" """
description = 'format the code using yapf' description = 'format the code using yapf'
user_options: List[Tuple[str, str, str]] = [] user_options: ClassVar[List[Tuple[str, str, str]]] = []
def initialize_options(self): def initialize_options(self):
"""Set default values for options that this command supports.""" """Set default values for options that this command supports."""
...@@ -64,7 +64,7 @@ class Linter(Command): ...@@ -64,7 +64,7 @@ class Linter(Command):
""" """
description = 'lint the code using flake8' description = 'lint the code using flake8'
user_options: List[Tuple[str, str, str]] = [] user_options: ClassVar[List[Tuple[str, str, str]]] = []
def initialize_options(self): def initialize_options(self):
"""Set default values for options that this command supports.""" """Set default values for options that this command supports."""
...@@ -97,7 +97,7 @@ class Tester(Command): ...@@ -97,7 +97,7 @@ class Tester(Command):
""" """
description = 'test the code using pytest' description = 'test the code using pytest'
user_options: List[Tuple[str, str, str]] = [] user_options: ClassVar[List[Tuple[str, str, str]]] = []
def initialize_options(self): def initialize_options(self):
"""Set default values for options that this command supports.""" """Set default values for options that this command supports."""
...@@ -209,6 +209,7 @@ def run(self): ...@@ -209,6 +209,7 @@ def run(self):
'yapf==0.31.0', 'yapf==0.31.0',
], ],
'torch': [ 'torch': [
'safetensors==0.4.5',
'tokenizers<=0.20.3', 'tokenizers<=0.20.3',
'torch>=1.7.0a0', 'torch>=1.7.0a0',
'torchvision>=0.8.0a0', 'torchvision>=0.8.0a0',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment