Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions pkgs/development/python-modules/bad_pr/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
lib,
stdenv,
python3Packages,
fetchFromGitHub,
# tests
uv,
versionCheckHook,
writableTmpDirAsHomeHook,
}:
python3Packages.buildPythonApplication rec {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace 'rec' with 'finalAttrs' to use a more modern and efficient way to inherit attributes from stdenv in Nix.

Suggested change
python3Packages.buildPythonApplication rec {
python3Packages.buildPythonApplication (finalAttrs {

pname = "mistral-vibe";
version = "2.4.2";
pyproject = true;

src = fetchFromGitHub {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is generally better to use tag than rev in fetchFromGitHub function if the repo has an up to date tag.

Suggested change
src = fetchFromGitHub {
src = fetchFromGitHub {
owner = "mistralai";
repo = "mistral-vibe";
tag = "v${finalAttrs.version}";
hash = "sha256-r/9kMhkoLfj9oEifFun/bpIQYEouqm9YEiWZVk07+S8=";
};

owner = "mistralai";
repo = "mistral-vibe";
rev = "095a67b0c73b512c1f4ff23ec8c7135276c8f3cc";
hash = "sha256-r/9kMhkoLfj9oEifFun/bpIQYEouqm9YEiWZVk07+S8=";
};

nativeBuildInputs = with python3Packages; [

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to modern conventions, use 'build-system' instead of 'nativeBuildInputs'.

Suggested change
nativeBuildInputs = with python3Packages; [
build-system = with python3Packages; [

editables
hatch-vcs
hatchling
];

pythonRelaxDeps = [
"agent-client-protocol"
"cryptography"
"gitpython"
"mistralai"
"pydantic-settings"
"zstandard"
];
propagatedBuildInputs = with python3Packages; [

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to modern conventions, use 'dependencies' instead of 'propagatedBuildInputs'.

Suggested change
propagatedBuildInputs = with python3Packages; [
dependencies = with python3Packages; [

agent-client-protocol
anyio
cachetools
cryptography
gitpython
giturlparse
google-auth
httpx
keyring
mcp
markdownify
mistralai
packaging
pexpect
pydantic
pydantic-settings
pyperclip
python-dotenv
pyyaml
requests
rich
textual
textual-speedups
tomli-w
tree-sitter
tree-sitter-bash
watchfiles
zstandard
];

pythonImportsCheck = ["vibe"];

nativeCheckInputs = [
python3Packages.pytest-asyncio
python3Packages.pytest-textual-snapshot
python3Packages.pytest-xdist
python3Packages.pytestCheckHook
python3Packages.respx
uv
versionCheckHook
writableTmpDirAsHomeHook
];
versionCheckKeepEnvironment = ["HOME"];

disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment explaining why the tests are disabled.

Suggested change
disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
# Tests disabled on Darwin due to platform-specific issues

"test_rebuilds_index_when_mass_change_threshold_is_exceeded"
"test_updates_index_incrementally_by_default"
"test_updates_index_on_file_creation"
"test_updates_index_on_file_deletion"
"test_updates_index_on_file_rename"
"test_updates_index_on_folder_rename"
"test_watcher_toggle_flow_off_on_off"
];

disabledTestPaths = [

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment explaining why the test paths are disabled.

Suggested change
disabledTestPaths = [
disabledTestPaths = [
# Tests disabled due to specific issues

"tests/snapshots/"
"tests/e2e/"
"tests/acp/test_acp.py"
];

meta = {
description = "YOLO is an amazing and powerful tool that lets you easily train models for all your computer vision tasks.";

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meta descriptions must be a single capitalized sentence that avoids starting with articles or the package name, omits punctuation, provides factual information, and excludes subjective language.

Suggested change
description = "YOLO is an amazing and powerful tool that lets you easily train models for all your computer vision tasks.";
description = "Tool for training models for computer vision tasks";

homepage = "https://github.com/mistralai/mistral-vibe";
changelog = "https://github.com/mistralai/mistral-vibe/blob/${version}/CHANGELOG.md";

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the reference to 'version' to use 'finalAttrs.version' to maintain recursiveness while using finalAttrs.

Suggested change
changelog = "https://github.com/mistralai/mistral-vibe/blob/${version}/CHANGELOG.md";
changelog = "https://github.com/mistralai/mistral-vibe/blob/${finalAttrs.version}/CHANGELOG.md";

license = lib.licenses.asl20;
maintainers = with lib.maintainers; [
GaetanLepage
shikanime
mana-byte
];
mainProgram = "vibe";
};
}
Loading