Skip to content

feat: add Windows (win-64) platform support#354

Open
mkitti wants to merge 4 commits intomainfrom
mkitti-windows-compatibility
Open

feat: add Windows (win-64) platform support#354
mkitti wants to merge 4 commits intomainfrom
mkitti-windows-compatibility

Conversation

@mkitti
Copy link
Copy Markdown
Contributor

@mkitti mkitti commented Apr 14, 2026

Summary

  • Adds win-64 to pixi workspace platforms so fileglancer can be installed and run on Windows
  • Guards Unix-only imports (pwd, grp, fcntl) with try/except ImportError in server.py, filestore.py, sshkeys.py, user_context.py, and apps/core.py — existing exception handlers at call sites already degrade gracefully when these modules are unavailable
  • Pins x2s3 to mkitti/x2s3@mkitti-uvloop-optional which makes uvloop a platform-conditional dependency (sys_platform != 'win32') — fixes a build failure where pixi tried to compile uvloop from source on Windows
  • Adds packaging>=24.0 as an explicit dependency (was previously only available as an implicit transitive dep on Linux/macOS)

Notes

  • The cluster job monitor logs a warning on Windows (fcntl.flock unavailable) but the core server starts and serves requests normally
  • The x2s3 git override should be replaced with x2s3 >=1.1.2 once mkitti/x2s3#mkitti-uvloop-optional is merged and published to PyPI

Test plan

  • pixi install completes without errors on Windows
  • pixi run fileglancer start starts the server and opens the browser on Windows
  • Existing Linux/macOS environments still install and pass tests (pixi run -e test test-backend)

🤖 Generated with Claude Code

- Add win-64 to pixi workspace platforms
- Add x2s3 git dependency pointing to mkitti/x2s3@mkitti-uvloop-optional
  which makes uvloop a platform-conditional dependency (not required on Windows)
- Add packaging>=24.0 as an explicit dependency (was an implicit transitive dep)
- Guard Unix-only imports (pwd, grp, fcntl) with try/except ImportError so the
  server can start on Windows; existing exception handlers in call sites already
  gracefully degrade when these modules are unavailable

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

[tool.pixi.pypi-dependencies]
fileglancer = { path = ".", editable = true }
x2s3 = { git = "https://github.com/mkitti/x2s3", branch = "mkitti-uvloop-optional" }
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Once JaneliaSciComp/x2s3#17 is merged, we can remove this.

mkitti and others added 3 commits April 13, 2026 23:04
Run install, frontend/backend tests, and frontend build on Windows.
Lint and packaging steps remain Linux-only. shell: bash added to run
steps so set -eux works consistently across platforms.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- filestore.py: strip \?\ extended-length prefix from os.readlink()
  output on Windows so symlink target paths match FSP candidates
- filestore.py: add AttributeError to except clauses for pwd/grp calls
  (pwd=None on Windows raises AttributeError, not KeyError)
- filestore.py: add AttributeError to _get_user_groups except clauses
- database.py: normalize subpath separators to forward slashes in
  _find_best_fsp_match so subpaths are portable (used in URLs/API)
- apps/core.py: fall back to os.path.expanduser for tilde expansion
  when pwd is unavailable; normalize home dir to forward slashes
- apps/core.py: accept Windows drive-letter paths (C:/...) in
  validate_path_for_shell
- sshkeys.py: fall back to os.path.expanduser when pwd unavailable
- tests/test_poll.py: skip entire module on Windows via
  pytest.importorskip (fcntl.flock is Unix-only)
- tests/test_filestore.py: accept FileNotFoundError alongside
  NotADirectoryError for rename test (Windows raises the former);
  skip chmod permission bit test on Windows
- tests/test_apps.py: normalize expected home path to forward slashes
- tests/test_database.py: use forward-slash literal for subpath assertion

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant