From 9ef1f3788e8fbe40b55c6f7e67f3c359599c202b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Grobol?= Date: Sat, 26 Mar 2022 17:45:07 +0100 Subject: [PATCH] move metadata to pyproject.toml We still need a stup setup.cfg [until](https://github.com/pypa/setuptools/issues/2816) setuptools gets proper editable installs and either flake8 [**finally**](https://github.com/python/mypy/issues/5205) gets the hint and support pyproject or [flakeheaven](https://github.com/flakeheaven/flakeheaven) is usable with vscode. --- pyproject.toml | 76 +++++++++++++++++++++++++++++++++++++++++++++++--- setup.cfg | 54 ----------------------------------- 2 files changed, 72 insertions(+), 58 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a8d9a52..587c8f8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,78 @@ +[build-system] +requires = ["setuptools>=61", "wheel"] +build-backend = "setuptools.build_meta" + [project] name = "zeldarose" +version = "0.4.0" +description = "Train transformer-based models" +license = {text = "MIT"} +authors = [{name = "Loïc Grobol", email = "loic.grobol@gmail.com"}] +classifiers = [ + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Environment :: Console", +] +keywords = [ + "nlp", + "transformers", + "language-model", +] requires-python = ">=3.8" +dependencies = [ + "click", + "click_pathlib", + "datasets", + "filelock", + "loguru", + "pydantic", + "pytorch-lightning >= 1.5.6, < 1.6.0", + "rich", + "torch > 1.8, < 1.12", + "torchmetrics", + "tokenizers ~= 0.10", + "toml", + "tqdm", + "transformers >= 4.0.0, < 5.0.0", +] -[build-system] -requires = ["setuptools>=54", "wheel"] -build-backend = "setuptools.build_meta" +[project.readme] +file = "README.md" +content-type = "text/markdown" + +[project.optional-dependencies] +lint = [ + "flakeheaven", + "flake8-bugbear", + "flake8-pytest-style", +] +tests = [ + "pytest", + "pytest-console-scripts", + "pytest-lazy-fixture", +] + + +[project.scripts] +zeldarose-tokenizer = "zeldarose.train_tokenizer:main" +zeldarose-transformer = "zeldarose.train_transformer:main" + + +[tool.flakeheaven] +max_line_length = 100 + +[tool.flakeheaven.plugins] +bugbear = ["+*"] +pycodestyle = ["+*"] +pyflakes = ["+*", "-E203","-E266","-E501","-W503"] +pytest-style = ["+*"] + +[tool.mypy] +allow_redefinition = true +warn_unreachable = true +plugins = ["pydantic.mypy"] [tool.black] -line-length = 88 +line-length = 100 diff --git a/setup.cfg b/setup.cfg index f22a149..d116db4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,61 +1,7 @@ -[metadata] -name = zeldarose -version = 0.4.0 -description = Train transformer-based models -license = MIT -author = Loïc Grobol -author_email = loic.grobol@gmail.com -long_description = file: README.md -long_description_content_type = text/markdown -classifiers = - License :: OSI Approved :: MIT License - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Environment :: Console -keywords = - nlp - transformers - language-model - - [options] packages = find: -include_package_data = True -python_requires = >=3.8 -install_requires = - click - click_pathlib - datasets - filelock - loguru - pydantic - pytorch-lightning >= 1.5.6, < 1.6.0 - rich - torch > 1.8, < 1.12 - torchmetrics - tokenizers ~= 0.10 - toml - tqdm - transformers >= 4.0.0, < 5.0.0 - -[options.extras_require] -tests = - pytest - pytest-console-scripts - pytest-lazy-fixture - -[options.entry_points] -console_scripts = - zeldarose-tokenizer = zeldarose.train_tokenizer:main - zeldarose-transformer = zeldarose.train_transformer:main [flake8] max-line-length = 100 ignore = E203,E266,E501,W503 max-complexity = 18 - -[mypy] -allow_redefinition = True -warn_unreachable = True -plugins = pydantic.mypy