commit f9289d49f43feed7618747cb8fae17e791c5b9c5 Author: Akshay Mankar Date: Thu May 18 15:57:22 2023 +0200 First commit diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..36b91d2 --- /dev/null +++ b/flake.lock @@ -0,0 +1,130 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1682109806, + "narHash": "sha256-d9g7RKNShMLboTWwukM+RObDWWpHKaqTYXB48clBWXI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2362848adf8def2866fabbffc50462e929d7fffb", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1635350005, + "narHash": "sha256-tAMJnUwfaDEB2aa31jGcu7R7bzGELM9noc91L2PbVjg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1c1f5649bb9c1b0d98637c8c365228f57126f361", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-20.09", + "repo": "nixpkgs", + "type": "github" + } + }, + "pip2nix": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1681921436, + "narHash": "sha256-jrUOMhpOFxrgCXNgMWz475nKZdMiSQb0+nbaIqQORSM=", + "owner": "nix-community", + "repo": "pip2nix", + "rev": "2ad8bd4c841116a1b9ab7853a53ed2d38e0ab93f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "pip2nix", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "pip2nix": "pip2nix" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..b5ca45c --- /dev/null +++ b/flake.nix @@ -0,0 +1,44 @@ +{ + description = "Dev Setup"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + inputs.flake-utils.url = "github:numtide/flake-utils"; + inputs.pip2nix = { + url = "github:nix-community/pip2nix"; + flake = false; + # inputs.nixpkgs.follows = "nixpkgs"; + # inputs.flake-utils.follows = "flake-utils"; + }; + + outputs = {nixpkgs, flake-utils, pip2nix, ...}: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { inherit system; + config.allowBroken = true; + }; + attrsets = pkgs.lib.attrsets; + overrideFiles = (attrsets.filterAttrs (f: type: type == "regular") (builtins.readDir ./python)); + overridePackageNames = attrsets.mapAttrsToList (f: _: builtins.replaceStrings [".nix"] [""] f) overrideFiles; + python3 = pkgs.python3.override ({ + packageOverrides = pself: psuper: + attrsets.genAttrs overridePackageNames (o: pself.callPackage ./python/${o}.nix {}); + }); + newversion = python3.pkgs.newversion.overrideAttrs(old: { + propagatedBuildInputs = old.propagatedBuildInputs ++ [python3.pkgs.setuptools]; + }); + in rec { + packages = { + devEnv = pkgs.buildEnv { + name = "erpnext-nix-dev-env"; + paths = [ + newversion + pkgs.dasel + ]; + }; + inherit pkgs; + pip2nix = import "${pip2nix}/default.nix" { inherit pkgs; pythonPackages = "python310Packages"; }; + erpnext = python3.pkgs.erpnext; + pythonPkgs = python3.pkgs; + }; + }); +} diff --git a/frappe-tilde-versions b/frappe-tilde-versions new file mode 100644 index 0000000..6bbe071 --- /dev/null +++ b/frappe-tilde-versions @@ -0,0 +1,61 @@ +Babel 2.12.1 +Click 8.1.3 +filelock 3.8.0 +filetype 1.2.0 +GitPython 3.1.30 +Jinja2 3.1.2 +Pillow 9.3.0 +PyJWT 2.4.0 +PyPDF2 2.1.0 +PyPika 0.48.9 +PyQRCode 1.2.1 +PyYAML 6.0 +RestrictedPython 6.0 +Werkzeug 2.2.2 +Whoosh 2.7.4 +beautifulsoup4 4.9.3 +bleach-allowlist 1.0.3 +bleach 3.3.0 +chardet 4.0.0 +croniter 1.3.5 +cryptography 39.0.1 +email-reply-parser 0.5.12 +git-url-parse 1.2.2 +gunicorn 20.1.0 +html5lib 1.1 +ipython 8.10.0 +ldap3 2.9 +markdown2 2.4.0 +num2words 0.5.10 +oauthlib 3.2.1 +openpyxl 3.0.7 +passlib 1.7.4 +pdfkit 1.0.0 +premailer 3.8.0 +psutil 5.9.1 +psycopg2-binary 2.9.1 +pyOpenSSL 23.0.0 +pycryptodome 3.10.1 +pydantic 1.10.2 +pyotp 2.6.0 +python-dateutil 2.8.1 +rauth 0.7.3 +redis 4.5.4 +hiredis 2.0.0 +requests-oauthlib 1.3.0 +requests 2.27.1 +rq 1.11.1 +semantic-version 2.10.0 +sqlparse 0.4.1 +tenacity 8.0.1 +terminaltables 3.1.0 +traceback-with-variables 2.0.4 +xlrd 2.0.1 +zxcvbn 4.4.28 +markdownify 0.11.2 +boto3 1.18.49 +dropbox 11.7.0 +google-api-python-client 2.2.0 +google-auth-oauthlib 0.4.4 +google-auth 1.29.0 +posthog 3.0.1 diff --git a/python/barcodenumber.nix b/python/barcodenumber.nix new file mode 100644 index 0000000..dfa8006 --- /dev/null +++ b/python/barcodenumber.nix @@ -0,0 +1,19 @@ +{ + buildPythonPackage, + fetchPypi, + python-stdnum +}: +buildPythonPackage rec { + pname = "barcodenumber"; + version = "0.5.0"; + format = "wheel"; + src = fetchPypi { + inherit pname version format; + sha256 = "sha256-VZfHLwSF9aDoy5L1x4O2mu8/f2ijYKgyjCrQ1KKY5Ho="; + python = "py3"; + dist = "py3"; + }; + buildInputs = [ + python-stdnum + ]; +} diff --git a/python/erpnext.nix b/python/erpnext.nix new file mode 100644 index 0000000..2ecf5c1 --- /dev/null +++ b/python/erpnext.nix @@ -0,0 +1,39 @@ +{ + buildPythonPackage, + fetchFromGitHub, + + taxjar, + gocardless-pro, + plaid-python, + unidecode, + pycountry, + python-youtube, + tweepy, + redisearch, + googlemaps, + python-stdnum, + frappe +}: +buildPythonPackage rec { + pname = "erpnext"; + version = "14.24.1"; + src = fetchFromGitHub { + owner = "frappe"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-djux5iwbwXQBMOg7R79hjy0szgFxd6L9nobsLVS7kEg="; + }; + buildInputs = [ + taxjar + gocardless-pro + plaid-python + unidecode + pycountry + python-youtube + tweepy + redisearch + googlemaps + python-stdnum + frappe + ]; +} diff --git a/python/frappe.nix b/python/frappe.nix new file mode 100644 index 0000000..a196c53 --- /dev/null +++ b/python/frappe.nix @@ -0,0 +1,17 @@ +{ + buildPythonPackage, + fetchPypi, + fetchFromGitHub +}: +buildPythonPackage rec { + pname = "frappe"; + version = "14.36.1"; + format = "flit"; + src = fetchFromGitHub { + owner = "akshaymankar"; + repo = "frappe"; + rev = "38708ba7c1e3eb0efd74d2876b79f6b17d8818dc"; + sha256 = "sha256-eee6IS/Ep/DSDCPdnyrqBea/ag0kNnN5Id3YQMNz5js="; + }; + propagatedBuildInputs = []; +} diff --git a/python/gocardless-pro.nix b/python/gocardless-pro.nix new file mode 100644 index 0000000..77907d0 --- /dev/null +++ b/python/gocardless-pro.nix @@ -0,0 +1,19 @@ +{ + buildPythonPackage, + fetchPypi, + requests, + six +}: +buildPythonPackage rec { + pname = "gocardless-pro"; + version = "1.22.0"; + src = fetchPypi { + pname = "gocardless_pro"; + inherit version; + sha256 = "sha256-i4gBeJvl/aCujeXGvJG+z1Wp2aczKg8clnfMyK8fz/w="; + }; + propagatedBuildInputs = [ + requests + six + ]; +} diff --git a/python/jsonobject.nix b/python/jsonobject.nix new file mode 100644 index 0000000..8751792 --- /dev/null +++ b/python/jsonobject.nix @@ -0,0 +1,17 @@ +{ + buildPythonPackage, + fetchPypi, + cython, + six +}: +buildPythonPackage rec { + pname = "jsonobject"; + version = "2.1.0"; + src = fetchPypi { + inherit pname version; + sha256 = "sha256-UpijeVA+Q+/Aq0AC10LA/LuhqWKO3azE6lR7cThRRGY="; + }; + propagatedBuildInputs = [ six ]; + nativeBuildInputs = [ cython ]; + doCheck = false; +} diff --git a/python/plaid-python.nix b/python/plaid-python.nix new file mode 100644 index 0000000..575b0a4 --- /dev/null +++ b/python/plaid-python.nix @@ -0,0 +1,18 @@ +{ + buildPythonPackage, + fetchPypi, + requests, +}: +buildPythonPackage rec { + pname = "plaid-python"; + version = "7.2.1"; + format = "setuptools"; + src = fetchPypi { + inherit pname version; + sha256 = "sha256-ryrTJug3fIyG2XGE9gwL5BzXH1B1IB39szMcyF1N5RM="; + }; + doCheck = false; + propagatedBuildInputs = [ + requests + ]; +} diff --git a/python/pycountry.nix b/python/pycountry.nix new file mode 100644 index 0000000..54b8473 --- /dev/null +++ b/python/pycountry.nix @@ -0,0 +1,13 @@ +{ + buildPythonPackage, + fetchPypi, +}: +buildPythonPackage rec { + pname = "pycountry"; + version = "20.7.3"; + src = fetchPypi { + inherit pname version; + sha256 = "sha256-gQhKU9NFQ0TAKS3uvCD80KFIjBNtSQAxLL1GXPVSy0I="; + }; + propagatedBuildInputs = []; +} diff --git a/python/python-youtube.nix b/python/python-youtube.nix new file mode 100644 index 0000000..08940f7 --- /dev/null +++ b/python/python-youtube.nix @@ -0,0 +1,27 @@ +{ + buildPythonPackage, + fetchPypi, + + requests, + dataclasses-json, + isodate, + requests-oauthlib +}: +buildPythonPackage rec { + pname = "python-youtube"; + version = "0.8.0"; + src = fetchPypi { + inherit pname version; + sha256 = "sha256-Ud0Y+lmsK88SNh0uIjhOHgCgCG+SBv/FQkt3yc63tlo="; + }; + + # PyPI doesn't have test data in the source dist + doCheck = false; + + propagatedBuildInputs = [ + requests + dataclasses-json + isodate + requests-oauthlib + ]; +} diff --git a/python/redis.nix b/python/redis.nix new file mode 100644 index 0000000..ad4f7e6 --- /dev/null +++ b/python/redis.nix @@ -0,0 +1,14 @@ +{ + buildPythonPackage, + fetchPypi, +}: +buildPythonPackage rec { + pname = "redis"; + version = "3.5.3"; + src = fetchPypi { + inherit pname version; + sha256 = "sha256-Dn4M/KhmDeqLfVzYxPbF4p4R8xFYwLCukaOX8A5aBaI="; + }; + doCheck = false; + propagatedBuildInputs = []; +} diff --git a/python/redisearch.nix b/python/redisearch.nix new file mode 100644 index 0000000..049cb17 --- /dev/null +++ b/python/redisearch.nix @@ -0,0 +1,20 @@ +{ + buildPythonPackage, + fetchPypi, + redis, + rejson, + hiredis +}: +buildPythonPackage rec { + pname = "redisearch"; + version = "2.1.1"; + src = fetchPypi { + inherit pname version; + sha256 = "sha256-V1rNWhOhB/8AXUVyoTa1A7Evpb8mr8N70R9qkj8exzw="; + }; + propagatedBuildInputs = [ + redis + rejson + hiredis + ]; +} diff --git a/python/rejson.nix b/python/rejson.nix new file mode 100644 index 0000000..25eff3e --- /dev/null +++ b/python/rejson.nix @@ -0,0 +1,18 @@ +{ + buildPythonPackage, + fetchPypi, + redis, + six +}: +buildPythonPackage rec { + pname = "rejson"; + version = "0.5.6"; + src = fetchPypi { + inherit pname version; + sha256 = "sha256-vs3hNSAAUAi3ls5WyxKOsiUC18addIJv81HNQ79zvJc="; + }; + propagatedBuildInputs = [ + redis + six + ]; +} diff --git a/python/taxjar.nix b/python/taxjar.nix new file mode 100644 index 0000000..611d28b --- /dev/null +++ b/python/taxjar.nix @@ -0,0 +1,22 @@ +{ + buildPythonPackage, + fetchPypi, + jsonobject, + requests, + mock +}: +buildPythonPackage rec { + pname = "taxjar"; + version = "1.9.2"; + src = fetchPypi { + inherit pname version; + sha256 = "sha256-c8lkCLzEmNTuBYLyVNRQq4SLSveDpNKKf6NHxHpg7Ec="; + }; + propagatedBuildInputs = [ + jsonobject + requests + ]; + checkInputs = [ + mock + ]; +} diff --git a/python/tweepy.nix b/python/tweepy.nix new file mode 100644 index 0000000..18d6922 --- /dev/null +++ b/python/tweepy.nix @@ -0,0 +1,23 @@ +{ + buildPythonPackage, + fetchPypi, + + requests-oauthlib, + six, +}: +buildPythonPackage rec { + pname = "tweepy"; + version = "3.10.0"; + src = fetchPypi { + inherit pname version; + sha256 = "sha256-duaVS4BspHDdqHf1fbh5L/8GoL66DtQ+/DgFdx458Go="; + }; + + # ModuleNotFoundError: No module named 'tests' + doCheck = false; + + propagatedBuildInputs = [ + requests-oauthlib + six + ]; +} diff --git a/python/unidecode.nix b/python/unidecode.nix new file mode 100644 index 0000000..b64c937 --- /dev/null +++ b/python/unidecode.nix @@ -0,0 +1,14 @@ +{ + buildPythonPackage, + fetchPypi, +}: +buildPythonPackage rec { + pname = "unidecode"; + version = "1.2.0"; + src = fetchPypi { + pname = "Unidecode"; + inherit version; + sha256 = "sha256-jXOpfTh6lWkiNE9rdCQ8LGdxWUZZd4dEstvarY9rcn0="; + }; + propagatedBuildInputs = []; +}