kubernetes-client / kubernetes-client/python
Windows contributors face multiple issues: symlink folders not portable, permission errors, and missing imports in tests
- Dominant language
- Python
- Stars
- 7.7k
- Forks
- 3.5k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 18
Description
**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.**
Contributor guide
Research direction
Start by reproducing the reported failures on Windows with `pip install -e .` and `python -m pytest`. Inspect the symlinked `kubernetes/config` and `kubernetes/watch` paths, `kubernetes/base/watch/watch_test.py`, its duplicate, and `kube_config_test.py`, focusing on the missing `json` import and `test_oidc_with_refresh`. Done means installation and the affected tests work on Windows and ZIP-based checkouts.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, operating-systems, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100