From a6aa2cfc68e808042332239eae00b8dcba07b884 Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Tue, 16 Apr 2024 21:36:39 +0200 Subject: [PATCH 1/2] sourcery: init at 1.16.0 https://github.com/sourcery-ai/sourcery/releases/tag/v1.16.0 --- pkgs/by-name/so/sourcery/package.nix | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 pkgs/by-name/so/sourcery/package.nix diff --git a/pkgs/by-name/so/sourcery/package.nix b/pkgs/by-name/so/sourcery/package.nix new file mode 100644 index 000000000000..342d0e918725 --- /dev/null +++ b/pkgs/by-name/so/sourcery/package.nix @@ -0,0 +1,50 @@ +{ + lib, + stdenv, + python3Packages, + fetchPypi, + autoPatchelfHook, + libxcrypt-legacy, +}: + +let + platformInfos = { + "x86_64-linux" = { + platform = "manylinux1_x86_64"; + hash = "sha256-gr5z8VYkuCqgmcnyA01/Ez6aX9NrKR4MgA0Bc6IHnfs="; + }; + "x86_64-darwin" = { + platform = "macosx_10_9_universal2"; + hash = "sha256-5LsxeozPgInUC1QAxDSlr8NIfmRSl5BN+g9/ZYAxiRE="; + }; + }; + platformInfo = platformInfos.${stdenv.system} or (throw "Unsupported platform ${stdenv.system}"); +in +python3Packages.buildPythonApplication rec { + pname = "sourcery"; + version = "1.16.0"; + format = "wheel"; + + src = fetchPypi { + inherit pname version format; + inherit (platformInfo) platform hash; + }; + + nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ]; + + buildInputs = [ libxcrypt-legacy ]; + + meta = { + changelog = "https://sourcery.ai/changelog/"; + description = "An AI-powered code review and pair programming tool for Python"; + downloadPage = "https://pypi.org/project/sourcery/"; + homepage = "https://sourcery.ai"; + license = lib.licenses.unfree; + mainProgram = "sourcery"; + maintainers = with lib.maintainers; [ tomasajt ]; + platforms = [ + "x86_64-linux" + "x86_64-darwin" + ]; + }; +} From 772fc787d154b01db16fc84073c44af930b12031 Mon Sep 17 00:00:00 2001 From: TomaSajt <62384384+TomaSajt@users.noreply.github.com> Date: Tue, 16 Apr 2024 21:36:58 +0200 Subject: [PATCH 2/2] vscode-extensions.sourcery.sourcery: init at 1.16.0 --- .../editors/vscode/extensions/default.nix | 2 + .../extensions/sourcery.sourcery/default.nix | 42 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 pkgs/applications/editors/vscode/extensions/sourcery.sourcery/default.nix diff --git a/pkgs/applications/editors/vscode/extensions/default.nix b/pkgs/applications/editors/vscode/extensions/default.nix index 92bb828f8df4..bbbd5b5dfd3b 100644 --- a/pkgs/applications/editors/vscode/extensions/default.nix +++ b/pkgs/applications/editors/vscode/extensions/default.nix @@ -3712,6 +3712,8 @@ let meta.license = lib.licenses.lgpl3Only; }; + sourcery.sourcery = callPackage ./sourcery.sourcery { }; + spywhere.guides = buildVscodeMarketplaceExtension { mktplcRef = { name = "guides"; diff --git a/pkgs/applications/editors/vscode/extensions/sourcery.sourcery/default.nix b/pkgs/applications/editors/vscode/extensions/sourcery.sourcery/default.nix new file mode 100644 index 000000000000..143ce4204561 --- /dev/null +++ b/pkgs/applications/editors/vscode/extensions/sourcery.sourcery/default.nix @@ -0,0 +1,42 @@ +{ + lib, + stdenv, + vscode-utils, + autoPatchelfHook, + libxcrypt-legacy, +}: + +vscode-utils.buildVscodeMarketplaceExtension { + mktplcRef = { + name = "sourcery"; + publisher = "sourcery"; + version = "1.16.0"; + hash = "sha256-SHgS2C+ElTJW4v90Wg0QcsSL2FoSz+SxZQpgq2J4JiU="; + }; + + postPatch = '' + pushd sourcery_binaries/install + rm -r win ${if stdenv.isLinux then "mac" else "linux"} + popd + ''; + + nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ]; + + buildInputs = [ + stdenv.cc.cc.lib + libxcrypt-legacy + ]; + + meta = { + changelog = "https://sourcery.ai/changelog/"; + description = "A VSCode extension for Sourcery, an AI-powered code review and pair programming tool for Python"; + downloadPage = "https://marketplace.visualstudio.com/items?itemName=sourcery.sourcery"; + homepage = "https://github.com/sourcery-ai/sourcery-vscode"; + license = lib.licenses.unfree; + maintainers = with lib.maintainers; [ tomasajt ]; + platforms = [ + "x86_64-linux" + "x86_64-darwin" + ]; + }; +}