From ef79685b160d89d08e34feaba3547d0397c0bfb5 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 16 Dec 2024 20:20:32 +0100 Subject: [PATCH] chore: use PEP 660 python install method pyproject.toml --- pyproject.toml | 63 ++++++++++++++++++++++++++++++++++++++++++++++++ requirements.txt | 2 -- setup.py | 19 --------------- 3 files changed, 63 insertions(+), 21 deletions(-) create mode 100644 pyproject.toml delete mode 100644 requirements.txt delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..0d6fbefb9 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,63 @@ +[project] +name = "helpdesk" +authors = [ + { name = "Frappe Technologies Pvt Ltd", email = "hello@frappe.io" }, +] +description = "Open Source Customer Service Software" +requires-python = ">=3.10" +readme = "README.md" +dynamic = ["version"] +dependencies = [ + # Core dependencies + "textblob==0.18.0.post0", +] + +[build-system] +requires = ["flit_core >=3.4,<4"] +build-backend = "flit_core.buildapi" + +[tool.bench.frappe-dependencies] +frappe = ">=15.0.0,<16.0.0" + +[tool.ruff] +line-length = 110 +target-version = "py310" + +[tool.ruff.lint] +select = [ + "F", + "E", + "W", + "I", + "UP", + "B", + "RUF", +] +ignore = [ + "B017", # assertRaises(Exception) - should be more specific + "B018", # useless expression, not assigned to anything + "B023", # function doesn't bind loop variable - will have last iteration's value + "B904", # raise inside except without from + "E101", # indentation contains mixed spaces and tabs + "E402", # module level import not at top of file + "E501", # line too long + "E741", # ambiguous variable name + "F401", # "unused" imports + "F403", # can't detect undefined names from * import + "F405", # can't detect undefined names from * import + "F722", # syntax error in forward type annotation + "W191", # indentation contains tabs + "RUF001", # string contains ambiguous unicode character +] +typing-modules = ["frappe.types.DF"] + +[tool.ruff.format] +quote-style = "double" +indent-style = "tab" +docstring-code-format = true + + +[project.urls] +Homepage = "https://frappe.io/helpdesk" +Repository = "https://github.com/frappe/helpdesk.git" +"Bug Reports" = "https://github.com/frappe/helpdesk/issues" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 25ae9e2cc..000000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -# frappe -- https://github.com/frappe/frappe is installed via 'bench init' -textblob==0.18.0.post0 diff --git a/setup.py b/setup.py deleted file mode 100644 index a4fe7e41b..000000000 --- a/setup.py +++ /dev/null @@ -1,19 +0,0 @@ -from setuptools import find_packages, setup - -with open("requirements.txt") as f: - install_requires = f.read().strip().split("\n") - -# get version from __version__ variable in frappedesk/__init__.py -from helpdesk import __version__ as version - -setup( - name="helpdesk", - version=version, - description="Customer Service Software", - author="Frappe Technologies", - author_email="hello@frappe.io", - packages=find_packages(), - zip_safe=False, - include_package_data=True, - install_requires=install_requires, -)