Skip to content

Commit

Permalink
move metadata to pyproject.toml
Browse files Browse the repository at this point in the history
We still need a stup setup.cfg
[until](pypa/setuptools#2816)
setuptools gets proper editable installs
and either
flake8 [**finally**](python/mypy#5205)
gets the hint and support pyproject or
[flakeheaven](https://github.com/flakeheaven/flakeheaven) is usable with
vscode.
  • Loading branch information
LoicGrobol committed Mar 26, 2022
1 parent 1080979 commit 9ef1f37
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 58 deletions.
76 changes: 72 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]"}]
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
54 changes: 0 additions & 54 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,61 +1,7 @@
[metadata]
name = zeldarose
version = 0.4.0
description = Train transformer-based models
license = MIT
author = Loïc Grobol
author_email = [email protected]
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

0 comments on commit 9ef1f37

Please sign in to comment.