Skip to content

Unnecesary dependency on pywin32 #4

@samepaul

Description

@samepaul

Trying to install on PyPy does not work because of dependency on pywin32.

C:\Work❯python -m pip install namedpipe
Collecting namedpipe
  Using cached namedpipe-0.2.5-py3-none-any.whl (14 kB)
  Using cached namedpipe-0.2.4-py3-none-any.whl (14 kB)
  Using cached namedpipe-0.2.3-py3-none-any.whl (14 kB)
  Using cached namedpipe-0.2.2-py3-none-any.whl (14 kB)
  Using cached namedpipe-0.2.1-py3-none-any.whl (14 kB)
  Using cached namedpipe-0.2.0-py3-none-any.whl (14 kB)
  Using cached namedpipe-0.1.1-py3-none-any.whl (14 kB)
  Using cached namedpipe-0.1.0-py3-none-any.whl (15 kB)
ERROR: Cannot install namedpipe==0.1.0, namedpipe==0.1.1, namedpipe==0.2.0, namedpipe==0.2.1, namedpipe==0.2.2, namedpipe==0.2.3, namedpipe==0.2.4 and namedpipe==0.2.5 because these package versions have conflicting dependencies.

While the dependency perhaps could be resolved with some shaman dancing, but the question - why should I?
Named pipe on Windows is literally a wrapper around 5 functions in kernel32 - CreateNamedPipeW, ConnectNamedPipe, ReadFile, CancelIoEx and CloseHandle. Those can be done using ctype which is standard part of Python distribution. I wrote a wrapper myself in 5 minutes (with help of Copilot ).
You can see in the attached snippet. namedpipe.py.txt
It perhaps not ideal, but covers the pipe server stuff that Python was really missing. Client side is fine with Python's native open, but can be complemented.

The thing is that dragging pywin32 into future is bad thing. It is very platform specific, is not portable and having it installed provokes pythoners to write bad code. That's why any standard Python distribution does not have it despite the module being very old and users were begging to have it in standard distribution for long time.

namedpipe on the other hand is very useful module and could do a favor to itself by getting rid of pywin32 dependency. And I sincerely hope you will accept my proposal to switch 😊

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions