diff --git a/apps/sources.nix b/apps/sources.nix index 20b1556..6856929 100644 --- a/apps/sources.nix +++ b/apps/sources.nix @@ -12,6 +12,17 @@ let applyInputPatches = name: attrs: { + webshop = + attrs + // { + src = applyPatches { + name = "webshop-source"; + inherit (attrs) src; + patches = [ + ./sources/webshop-pr-99-flit-core.patch + ]; + }; + }; frappe = attrs // { diff --git a/apps/sources/config.toml b/apps/sources/config.toml index 2b39273..c9f5ed3 100644 --- a/apps/sources/config.toml +++ b/apps/sources/config.toml @@ -55,6 +55,11 @@ source = "github" branch = "version-15" # no proper releases github = "frappe/payments" +[webshop] +source = "github" +branch = "version-15" # no proper releases +github = "frappe/webshop" + [wiki] source = "github" branch = "master" # Latest release (Wiki v2.0.1) is for frappe 14 diff --git a/apps/sources/newver.json b/apps/sources/newver.json index 46b958e..ae9d130 100644 --- a/apps/sources/newver.json +++ b/apps/sources/newver.json @@ -6,5 +6,6 @@ "gameplan": "20240206.065338", "insights": "20240301.064651", "payments": "20240123.122024", + "webshop": "20240125.060731", "wiki": "20240121.050421" } diff --git a/apps/sources/oldver.json b/apps/sources/oldver.json index 46b958e..ae9d130 100644 --- a/apps/sources/oldver.json +++ b/apps/sources/oldver.json @@ -6,5 +6,6 @@ "gameplan": "20240206.065338", "insights": "20240301.064651", "payments": "20240123.122024", + "webshop": "20240125.060731", "wiki": "20240121.050421" } diff --git a/apps/sources/webshop-pr-99-flit-core.patch b/apps/sources/webshop-pr-99-flit-core.patch new file mode 100644 index 0000000..6695ea2 --- /dev/null +++ b/apps/sources/webshop-pr-99-flit-core.patch @@ -0,0 +1,106 @@ +From 5f5ef2133bdc8faf866b81c408bba22eba908857 Mon Sep 17 00:00:00 2001 +From: David +Date: Sun, 10 Mar 2024 23:13:30 +0100 +Subject: [PATCH] chore: use flit-core build as other frappe apps + +--- + MANIFEST.in | 18 ------------------ + pyproject.toml | 26 ++++++++++++++++++++++++++ + requirements.txt | 1 - + setup.py | 19 ------------------- + 4 files changed, 26 insertions(+), 38 deletions(-) + delete mode 100644 MANIFEST.in + create mode 100644 pyproject.toml + delete mode 100644 requirements.txt + delete mode 100644 setup.py + +diff --git a/MANIFEST.in b/MANIFEST.in +deleted file mode 100644 +index 47fefeae2c..0000000000 +--- a/MANIFEST.in ++++ /dev/null +@@ -1,18 +0,0 @@ +-include MANIFEST.in +-include requirements.txt +-include *.json +-include *.md +-include *.py +-include *.txt +-recursive-include webshop *.css +-recursive-include webshop *.csv +-recursive-include webshop *.html +-recursive-include webshop *.ico +-recursive-include webshop *.js +-recursive-include webshop *.json +-recursive-include webshop *.md +-recursive-include webshop *.png +-recursive-include webshop *.py +-recursive-include webshop *.svg +-recursive-include webshop *.txt +-recursive-exclude webshop *.pyc +\ No newline at end of file +diff --git a/pyproject.toml b/pyproject.toml +new file mode 100644 +index 0000000000..acc3fbe02d +--- /dev/null ++++ b/pyproject.toml +@@ -0,0 +1,26 @@ ++[project] ++name = "webshop" ++authors = [ ++ { name = "Frappe Technologies Pvt. Ltd.", email = "contact@frappe.io"} ++] ++description = "Open Source eCommerce Platform" ++requires-python = ">=3.10" ++readme = "README.md" ++dynamic = ["version"] ++dependencies = [] ++ ++[build-system] ++requires = ["flit_core >=3.4,<4"] ++build-backend = "flit_core.buildapi" ++ ++[tool.black] ++line-length = 99 ++ ++[tool.isort] ++line_length = 99 ++multi_line_output = 3 ++include_trailing_comma = true ++force_grid_wrap = 0 ++use_parentheses = true ++ensure_newline_before_comments = true ++indent = "\t" +diff --git a/requirements.txt b/requirements.txt +deleted file mode 100644 +index 7668191f9c..0000000000 +--- a/requirements.txt ++++ /dev/null +@@ -1 +0,0 @@ +-# frappe -- https://github.com/frappe/frappe is installed via 'bench init' +\ No newline at end of file +diff --git a/setup.py b/setup.py +deleted file mode 100644 +index 9f7bc1b13b..0000000000 +--- a/setup.py ++++ /dev/null +@@ -1,19 +0,0 @@ +-from setuptools import setup, find_packages +- +-with open("requirements.txt") as f: +- install_requires = f.read().strip().split("\n") +- +-# get version from __version__ variable in webshop/__init__.py +-from webshop import __version__ as version +- +-setup( +- name="webshop", +- version=version, +- description="Open Source eCommerce Platform", +- author="Frappe Technologies Pvt. Ltd.", +- author_email="contact@frappe.io", +- packages=find_packages(), +- zip_safe=False, +- include_package_data=True, +- install_requires=install_requires +-) diff --git a/apps/sources/webshop.nix b/apps/sources/webshop.nix new file mode 100644 index 0000000..98ec363 --- /dev/null +++ b/apps/sources/webshop.nix @@ -0,0 +1,16 @@ +{ + pname = "webshop"; + version = "20240125.060731"; + meta = { + url = "https://github.com/frappe/webshop/commit/bebfee123fb0a9dd2ce5f7c41d63fc01e1375990"; + description = "Sources for webshop (20240125.060731)"; + }; + src = builtins.fetchTree { + type = "github"; + owner = "frappe"; + repo = "webshop"; + narHash = "sha256-y/zWxsR6as3nEI3jgCrz1BjWcVcqzxBm11kC596yg0E="; + rev = "bebfee123fb0a9dd2ce5f7c41d63fc01e1375990"; + }; + passthru = builtins.fromJSON ''{}''; +} diff --git a/src/overlays/frappe/default.nix b/src/overlays/frappe/default.nix index bc6163e..d68d371 100644 --- a/src/overlays/frappe/default.nix +++ b/src/overlays/frappe/default.nix @@ -15,5 +15,6 @@ in { ecommerce-integrations = callPackage ./ecommerce-integrations.nix {}; payments = callPackage ./payments.nix {}; wiki = callPackage ./wiki.nix {}; + webshop = callPackage ./webshop.nix {}; }); } diff --git a/src/overlays/frappe/webshop.nix b/src/overlays/frappe/webshop.nix new file mode 100644 index 0000000..da9bf05 --- /dev/null +++ b/src/overlays/frappe/webshop.nix @@ -0,0 +1,33 @@ +{ + appSources, + lib, + buildPythonPackage, + flit-core, + pythonRelaxDepsHook, + extractFrappeMeta, +}: +buildPythonPackage rec { + inherit + (extractFrappeMeta src) + pname + version + format + ; + + inherit (appSources.webshop) src passthru; + + nativeBuildInputs = [ + pythonRelaxDepsHook + flit-core + ]; + + # would require frappe, but since frappe is almost certainly customized, + # we don't include it here / TODO: decide if we may actually add it? + # pythonImportsCheck = ["webshop"]; + + meta = with lib; { + description = "Frappe webshop is an Open Source eCommerce Platform"; + homepage = "https://github.com/frappe/webshop.git"; + license = licenses.gpl3; + }; +}