From 55a0bf7a853f3ffd474f05aa2e02d494cb8cd21c Mon Sep 17 00:00:00 2001 From: eljamm Date: Fri, 5 Jun 2026 12:05:43 +0200 Subject: [PATCH 1/2] {python3Packages.,}:lookup-license: init at 0.1.30 Assisted-by: nix-init --- pkgs/by-name/lo/lookup-license/package.nix | 3 + .../python-modules/lookup-license/default.nix | 89 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 94 insertions(+) create mode 100644 pkgs/by-name/lo/lookup-license/package.nix create mode 100644 pkgs/development/python-modules/lookup-license/default.nix diff --git a/pkgs/by-name/lo/lookup-license/package.nix b/pkgs/by-name/lo/lookup-license/package.nix new file mode 100644 index 000000000000..0504ccaa5769 --- /dev/null +++ b/pkgs/by-name/lo/lookup-license/package.nix @@ -0,0 +1,3 @@ +{ python3Packages }: + +python3Packages.toPythonApplication python3Packages.lookup-license diff --git a/pkgs/development/python-modules/lookup-license/default.nix b/pkgs/development/python-modules/lookup-license/default.nix new file mode 100644 index 000000000000..611425b902de --- /dev/null +++ b/pkgs/development/python-modules/lookup-license/default.nix @@ -0,0 +1,89 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + + # dependencies + appdirs, + cachetools, + diskcache, + foss-flame, + license-expression, + packageurl-python, + python-magic, + requests, + scancode-toolkit, + xmltodict, + + # tests + pytestCheckHook, + writableTmpDirAsHomeHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "lookup-license"; + version = "0.1.30"; + pyproject = true; + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "hesa"; + repo = "lookup-license"; + tag = finalAttrs.version; + hash = "sha256-zFDqh62bjYkO3Duze3suS8LlrlzuqQes7ZaH+9G+yQ4="; + }; + + build-system = [ + setuptools + ]; + + dependencies = [ + appdirs + cachetools + diskcache + foss-flame + license-expression + packageurl-python + python-magic + requests + scancode-toolkit + xmltodict + ]; + + pythonRelaxDeps = [ + "requests" + ]; + + nativeCheckInputs = [ + pytestCheckHook + writableTmpDirAsHomeHook + ]; + + disabledTests = [ + # UnboundLocalError: cannot access local variable 'ret' where it is not associated with a value + "test_lookup_license_url_bad" + "test_lookup_license_url_good" + ]; + + pythonImportsCheck = [ + "lookup_license" + ]; + + meta = { + description = "Python tool to identify license from license text"; + homepage = "https://github.com/hesa/lookup-license"; + changelog = "https://github.com/hesa/lookup-license/releases/tag/${finalAttrs.src.tag}"; + mainProgram = "lookup-license"; + license = with lib.licenses; [ + gpl3Only + asl20 + cc-by-40 + gpl3Plus + ]; + maintainers = with lib.maintainers; [ eljamm ]; + teams = with lib.teams; [ ngi ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6c08a84cbf5c..0469c8e63a26 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9514,6 +9514,8 @@ self: super: with self; { london-tube-status = callPackage ../development/python-modules/london-tube-status { }; + lookup-license = callPackage ../development/python-modules/lookup-license { }; + lookyloo-models = callPackage ../development/python-modules/lookyloo-models { }; loompy = callPackage ../development/python-modules/loompy { }; From cee4a8b6755d508bbf11eadb2e8ce803dc6e007e Mon Sep 17 00:00:00 2001 From: eljamm Date: Fri, 5 Jun 2026 12:06:14 +0200 Subject: [PATCH 2/2] sbom-compliance-tool: init at 0.0.11 Assisted-by: nix-init --- .../sb/sbom-compliance-tool/package.nix | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 pkgs/by-name/sb/sbom-compliance-tool/package.nix diff --git a/pkgs/by-name/sb/sbom-compliance-tool/package.nix b/pkgs/by-name/sb/sbom-compliance-tool/package.nix new file mode 100644 index 000000000000..fc70c2c62614 --- /dev/null +++ b/pkgs/by-name/sb/sbom-compliance-tool/package.nix @@ -0,0 +1,61 @@ +{ + lib, + python3Packages, + fetchFromGitea, + cyclonedx-python, +}: + +python3Packages.buildPythonApplication (finalAttrs: { + pname = "sbom-compliance-tool"; + version = "0.0.11"; + pyproject = true; + __structuredAttrs = true; + + src = fetchFromGitea { + domain = "codeberg.org"; + owner = "software-compliance-org"; + repo = "sbom-compliance-tool"; + tag = finalAttrs.version; + hash = "sha256-6ZaHY1EKjJ78PrCov0wenj5doc93Ot9/yN4hEaagSmE="; + }; + + postPatch = '' + # https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#finding-namespace-packages + substituteInPlace setup.py \ + --replace-fail \ + "packages=['sbom_compliance_tool']" \ + "packages=setuptools.find_namespace_packages(include=['sbom_compliance_tool*'])" + ''; + + build-system = with python3Packages; [ + setuptools + ]; + + dependencies = with python3Packages; [ + cyclonedx-python + foss-flame + licomp + licomp-toolkit + lookup-license + ]; + + # upstream has no tests + doCheck = false; + + pythonImportsCheck = [ + "sbom_compliance_tool" + "sbom_compliance_tool.reader" + ]; + + meta = { + description = "Tool to assist your compliance work with SBoM"; + homepage = "https://codeberg.org/software-compliance-org/sbom-compliance-tool"; + mainProgram = "sbom_compliance_tool"; + license = with lib.licenses; [ + gpl3Only + gpl3Plus + ]; + maintainers = with lib.maintainers; [ eljamm ]; + teams = with lib.teams; [ ngi ]; + }; +})