Skip to content

Conversation

@ldkv
Copy link
Contributor

@ldkv ldkv commented Nov 28, 2025

Adapt all tests for Windows, no skipping needed.

Set default_path using builtin Path.home() instead of ~.

Address #22


Note

Adapts tests for Windows (hashing, tilde resolution, symlink/junction behavior), adds path_utils tests, and updates get_uvlink_dir to default to Path.home()/.local/share.

  • Tests:
    • Project: Make hash_path("/") expectation OS-aware via is_windows(); add tilde path resolution test without monkeypatch; refine assertions (as_posix()); add symlink resolution; add metadata roundtrip and sanitize_venv_type checks; add get_uvlink_dir tests using XDG_DATA_HOME.
    • CLI: In ls, assert exact cache location string: "Cache Location: {cache_dir}".
    • Path Utils: Add tests for create_symlink, Windows create_windows_junction (with skip on non-Windows), and invalid target error.
  • Project code:
    • Update get_uvlink_dir to default base to Path.home() / ".local" / "share" instead of a "~" string.

Written by Cursor Bugbot for commit c86769a. This will update automatically on new commits. Configure here.

@c0rychu c0rychu marked this pull request as draft November 28, 2025 17:11
@c0rychu
Copy link
Owner

c0rychu commented Nov 28, 2025

So, please address #23 (comment) first. After merging #23, I'll take a look at this more carefully.

Also, please change the target branch to support-windows as well.

A quick thought is that I think it's still better to mock the $HOME (and perhaps %USERPROFILE% on Windows) so that the tests only act on directories under the path managed by pytest for a reliable cleanup. It's fine on CI, but if developers want to run the tests on their local machine, I think it's better not to screw up their real home.

@ldkv ldkv force-pushed the adapt-tests-windows branch from 7261521 to 0448c72 Compare November 28, 2025 20:01
@ldkv ldkv changed the base branch from main to support-windows November 28, 2025 20:01
@ldkv ldkv force-pushed the adapt-tests-windows branch 3 times, most recently from 9b84f5a to a068a7a Compare November 28, 2025 20:31
@ldkv
Copy link
Contributor Author

ldkv commented Nov 28, 2025

So, please address #23 (comment) first. After merging #23, I'll take a look at this more carefully.

Also, please change the target branch to support-windows as well.

A quick thought is that I think it's still better to mock the $HOME (and perhaps %USERPROFILE% on Windows) so that the tests only act on directories under the path managed by pytest for a reliable cleanup. It's fine on CI, but if developers want to run the tests on their local machine, I think it's better not to screw up their real home.

If you look closely, I just extracted the test test_project_init_path_resolution_with_tilde from your existing code, and it purely verifies the resolution of ~, no user's home is harmed in the process ;)

The Github runner in windows-latest is actually running as Administrator, so the normal symlink_to works, and I can't force the OSError.

Instead, I added a direct test test_create_windows_junction to prove that the junction works.

@ldkv ldkv force-pushed the adapt-tests-windows branch from a068a7a to d5f00b8 Compare November 28, 2025 20:42
@ldkv ldkv force-pushed the adapt-tests-windows branch from d5f00b8 to 2f7aff1 Compare November 28, 2025 20:59
Copy link
Owner

@c0rychu c0rychu left a comment

Choose a reason for hiding this comment

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

some comments

@ldkv ldkv marked this pull request as ready for review November 28, 2025 21:32
@c0rychu
Copy link
Owner

c0rychu commented Nov 28, 2025

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on December 12

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@ldkv ldkv force-pushed the adapt-tests-windows branch from 7ba13f4 to c86769a Compare November 28, 2025 21:44
@c0rychu
Copy link
Owner

c0rychu commented Nov 28, 2025

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no bugs!


@c0rychu c0rychu merged commit d8694f1 into c0rychu:support-windows Nov 28, 2025
11 checks passed
@ldkv ldkv deleted the adapt-tests-windows branch November 28, 2025 21:56
@c0rychu c0rychu mentioned this pull request Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants