python icon indicating copy to clipboard operation
python copied to clipboard

Windows contributors face multiple issues: symlink folders not portable, permission errors, and missing imports in tests

Open PraveenMudalgeri opened this issue 5 months ago • 6 comments

Summary

Trying to contribute as a Windows developer to this repo turned up several significant issues:

  1. Several folders (e.g., kubernetes/config, kubernetes/watch) are symlinks to base/ subdirectories in the repo. On Windows and when using ZIP downloads from GitHub, these appear as plain text files and break both pip install -e . and running tests, since setuptools expects actual directories.

  2. At least one test file (watch_test.py under kubernetes/base/watch and duplicated under kubernetes/watch) is missing import json. This causes test failures with NameError: name 'json' is not defined.

  3. Several tests (for example, test_oidc_with_refresh inside kube_config_test.py) fail on Windows with PermissionError when trying to create/write temp files.

Steps to Reproduce

  • Clone or download the repo on Windows.
  • Try pip install -e . or run python -m pytest.
  • Observe errors related to config/watch packages not being directories, import errors in test files, and permission errors for temp files.

Proposed Fixes

  • Replace symlinks (kubernetes/config, kubernetes/watch, etc.) with real directories or use another structure to support Windows and ZIP-based contributors.
  • Ensure all test modules have necessary imports (e.g., import json).
  • Refactor or skip the failing temp file tests on Windows, or improve documentation about required permissions.

Environment

  • OS: Windows 10/11, Python 3.13
  • (Include pip list or pip freeze if desired)

Thank you! I’m happy to give more details or to help test solutions.

PraveenMudalgeri avatar Jul 28 '25 04:07 PraveenMudalgeri

/help

roycaihw avatar Jul 30 '25 20:07 roycaihw

@roycaihw: This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-help command.

In response to this:

/help

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

k8s-ci-robot avatar Jul 30 '25 20:07 k8s-ci-robot

The symlink comes from places like https://github.com/kubernetes-client/python/blob/master/kubernetes/config. I'm not familiar with Windows development. Need some Windows expert to input here.

roycaihw avatar Jul 30 '25 20:07 roycaihw

Replace symlinks (kubernetes/config, kubernetes/watch, etc.) with real directories or use another structure to support Windows and ZIP-based contributors.

The way we are doing it at the moment is legacy, and I'm concerned that there can be users depending on the current structure. I'd like to see if we can find a less impactful fix for Windows specifically.

roycaihw avatar Jul 30 '25 20:07 roycaihw

Ensure all test modules have necessary imports (e.g., import json).

SGTM. Would you like to send a fix?

Refactor or skip the failing temp file tests on Windows, or improve documentation about required permissions.

It would also be great if we can find the correct alternative for Windows on temp file testing.

roycaihw avatar Jul 30 '25 20:07 roycaihw

I would give a try for this issue.

PraveenMudalgeri avatar Jul 31 '25 04:07 PraveenMudalgeri