diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 1aba38f..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include LICENSE diff --git a/Makefile b/Makefile index 8d8148e..ff8ed42 100644 --- a/Makefile +++ b/Makefile @@ -7,13 +7,12 @@ check_dirs := src tests examples # this target runs checks on all files quality: black --check $(check_dirs) - isort --check-only $(check_dirs) - flake8 $(check_dirs) + ruff $(check_dirs) doc-builder style src tests --max_len 119 --check_only # Format source code automatically and check is there are any problems left that need manual fixing style: black $(check_dirs) - isort $(check_dirs) + ruff $(check_dirs) --fix doc-builder style src tests --max_len 119 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b7465bb..a135358 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,32 @@ [tool.black] line-length = 119 target-version = ['py36'] + +[tool.ruff] +ignore = ["C901", "E501", "E741", "W605"] +select = ["C", "E", "F", "I", "W"] +line-length = 119 + +[tool.ruff.isort] +default_section = "FIRSTPARTY" +known_first_party = "peft" +known_third_party = [ + "numpy", + "torch", + "accelerate", + "transformers", +] +line_length = 119 +lines_after_imports = 2 +multi_line_output = 3 +include_trailing_comma = true +force_grid_wrap = 0 +use_parentheses = true +ensure_newline_before_comments = true + +[tool.pytest] +doctest_optionflags = [ + "NORMALIZE_WHITESPACE", + "ELLIPSIS", + "NUMBER", +] \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 6b26312..0000000 --- a/setup.cfg +++ /dev/null @@ -1,23 +0,0 @@ -[isort] -default_section = FIRSTPARTY -ensure_newline_before_comments = True -force_grid_wrap = 0 -include_trailing_comma = True -known_first_party = pet -known_third_party = - numpy - torch - accelerate - transformers - -line_length = 119 -lines_after_imports = 2 -multi_line_output = 3 -use_parentheses = True - -[flake8] -ignore = E203, E722, E501, E741, W503, W605 -max-line-length = 119 - -[tool:pytest] -doctest_optionflags=NUMBER NORMALIZE_WHITESPACE ELLIPSIS \ No newline at end of file diff --git a/setup.py b/setup.py index b51aa93..6b26477 100644 --- a/setup.py +++ b/setup.py @@ -12,11 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -from setuptools import setup -from setuptools import find_packages +from setuptools import find_packages, setup extras = {} -extras["quality"] = ["black ~= 22.0", "isort >= 5.5.4", "flake8 >= 3.8.3"] +extras["quality"] = ["black ~= 22.0", "ruff>=0.0.241"] extras["docs_specific"] = ["hf-doc-builder"] extras["dev"] = extras["quality"] + extras["docs_specific"] @@ -24,6 +23,7 @@ setup( name="peft", version="0.2.0.dev0", description="Parameter-Efficient Fine-Tuning (PEFT)", + license_files=["LICENSE"], long_description=open("README.md", "r", encoding="utf-8").read(), long_description_content_type="text/markdown", keywords="deep learning",