From 70d67383bfc67576089a34e305e986b48de4cb97 Mon Sep 17 00:00:00 2001 From: oleksandrivaniuk Date: Tue, 29 Oct 2024 16:24:25 +0200 Subject: [PATCH] move to pyproject.toml --- pyproject.toml | 100 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 80 insertions(+), 20 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 50e9b0f..75aa1bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,24 +1,71 @@ +[build-system] +requires = [ "setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "ckanext-relationship" +version = "0.2.10" +description = "" +classifiers = [ "Development Status :: 4 - Beta", "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10",] +keywords = [ "CKAN",] +dependencies = [ "ckanext-scheming",] +authors = [ + {name = "DataShades", email = "datashades@linkdigital.com.au"}, + {name = "Oleksandr Ivaniuk", email = "oleksandr.ivaniuk@linkdigital.com.au"}, +] +maintainers = [ + {name = "DataShades", email = "datashades@linkdigital.com.au"}, +] + +[project.readme] +file = "README.md" +content-type = "text/markdown" + +[project.license] +text = "AGPL" + +[project.urls] +Homepage = "https://github.com/DataShades/ckanext-relationship" + +[project.optional-dependencies] + +[project.entry-points."ckan.plugins"] +relationship = "ckanext.relationship.plugin:RelationshipPlugin" + +[project.entry-points."babel.extractors"] +ckan = "ckan.lib.extract:extract_ckan" + +[tool.setuptools.packages] +find = {} + [tool.black] # line-length = 88 # preview = true [tool.ruff] target-version = "py38" -select = [ +lint.select = [ + # "ANN0", # type annotations for function arguments "B", # likely bugs and design problems - # "BLE", # do not catch blind exception - "C40", # better list/set/dict comprehensions + "BLE", # do not catch blind exception + "C4", # better list/set/dict comprehensions "C90", # check McCabe complexity - "COM", # trailing commas + "DTZ", # enforce timezone in date objects "E", # pycodestyle error "W", # pycodestyle warning "F", # pyflakes + "FA", # verify annotations from future "G", # format strings for logging statements "N", # naming conventions + "I", # isort + "ICN", # import conventions + # "D1", # require doc + # "D2", # doc formatting + "D4", # doc convention "PL", # pylint + # "PERF", # performance anti-patterns "PT", # pytest style "PIE", # misc lints - "Q", # preferred quoting style "RET", # improvements for return statements "RSE", # improvements for rise statements # "S", # security testing @@ -29,26 +76,43 @@ select = [ "TRY", # better exceptions "UP", # upgrade syntax for newer versions of the language ] -ignore = [ + +lint.ignore = [ + "RET503", # don't enforce return-None "E712", # comparison to bool: violated by SQLAlchemy filters "PT004", # fixture does not return anything, add leading underscore: violated by clean_db "PLC1901", # simplify comparison to empty string: violated by SQLAlchemy filters ] -[tool.ruff.per-file-ignores] -"ckanext/relationship/tests*" = ["S", "PL"] +[tool.ruff.lint.per-file-ignores] +"ckanext/collection/tests*" = ["S", "PL", "ANN", "D"] +"ckanext/collection/tests/test_dive.py" = ["F403", "F405"] + +[tool.ruff.lint.pydocstyle] +convention = "google" + +[tool.ruff.lint.isort] +section-order = [ + "future", + "standard-library", + "first-party", + "third-party", + "ckan", + "ckanext", + "self", + "local-folder", +] + +[tool.ruff.lint.isort.sections] +# Group all Django imports into a separate section. +ckan = ["ckan"] +ckanext = ["ckanext"] +self = ["ckanext.collection"] -[tool.isort] -known_ckan = "ckan" -known_ckanext = "ckanext" -known_self = "ckanext.relationship" -sections = "FUTURE,STDLIB,FIRSTPARTY,THIRDPARTY,CKAN,CKANEXT,SELF,LOCALFOLDER" -profile = "black" [tool.pytest.ini_options] addopts = "--ckan-ini test.ini" filterwarnings = [ - "ignore::sqlalchemy.exc.SADeprecationWarning", "ignore::sqlalchemy.exc.SAWarning", "ignore::DeprecationWarning", ] @@ -129,8 +193,4 @@ reportIncompleteStub = true reportUnsupportedDunderAll = true reportUnusedCoroutine = true reportUnnecessaryTypeIgnoreComment = true -reportMatchNotExhaustive = true - -[tool.coverage.run] -branch = true -omit = ["ckanext/relationship/tests/*"] +reportMatchNotExhaustive = true \ No newline at end of file