Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
3503e43
PKG-11149 - Bumping pywinpty-feedstock to version 3.0.2
anaconda-recipe-editor Dec 9, 2025
5131af6
update URLs
TS-ANC Dec 22, 2025
a8666aa
add version check
TS-ANC Dec 22, 2025
1edaaeb
remove pip check
TS-ANC Dec 23, 2025
e600a35
try simplified build script
TS-ANC Dec 23, 2025
0565003
test build correctness
TS-ANC Dec 23, 2025
4f03fd3
restore build script
TS-ANC Dec 23, 2025
8f5729a
add build script prefix
TS-ANC Dec 23, 2025
2ea5a12
debugging
TS-ANC Dec 23, 2025
ae58b80
more debugging
TS-ANC Dec 23, 2025
47becf1
try using maturin
TS-ANC Dec 23, 2025
53c56ea
verbose output
TS-ANC Dec 23, 2025
5d52bc4
Initiate build
TS-ANC Dec 23, 2025
3f36028
try using pip wheel
TS-ANC Dec 23, 2025
1f8ff8c
try to use existing winpty in build
TS-ANC Dec 23, 2025
6e78ffb
restore previous state and try to use existing winpty
TS-ANC Dec 23, 2025
0f14461
avoid silent build failure
TS-ANC Dec 23, 2025
fc5a396
try another approach
TS-ANC Dec 23, 2025
4f23e25
another attempt
TS-ANC Dec 23, 2025
a014cd5
diagnose winpty for winpty-agent
TS-ANC Dec 31, 2025
d0211bc
try using custom cargo config
TS-ANC Dec 31, 2025
3d5056e
bypass escape character issue
TS-ANC Dec 31, 2025
434de2d
try alternative approach
TS-ANC Dec 31, 2025
cc18a53
try with Cargo override instead
TS-ANC Dec 31, 2025
fdc5034
try another approach
TS-ANC Dec 31, 2025
8e0a638
another approach
TS-ANC Dec 31, 2025
b436700
patch out pywinpty's nuget requirement
TS-ANC Dec 31, 2025
70ef88b
update winpty patch
TS-ANC Dec 31, 2025
f16144f
use native Win SDK for ConPTY functionality
TS-ANC Jan 2, 2026
fe0bf78
skip ConPTY backend altogether
TS-ANC Jan 2, 2026
85fa7b2
disable ConPTY in winpty-rs
TS-ANC Jan 2, 2026
988e806
skip conpty nuget
TS-ANC Jan 2, 2026
9469855
enable conpty_local
TS-ANC Jan 2, 2026
639a19e
comment out conpty feature
TS-ANC Jan 2, 2026
c0456cd
fix patcher
TS-ANC Jan 2, 2026
ec65b0b
add patcher debug prints
TS-ANC Jan 2, 2026
9cd16cb
more debug printing
TS-ANC Jan 2, 2026
9b19f62
verbose debug prints
TS-ANC Jan 2, 2026
1f29783
try with a prebuilt binary
TS-ANC Jan 2, 2026
a968783
use prebuilt conpty binaries (vendored)
TS-ANC Jan 5, 2026
1502f95
debugging prints
TS-ANC Jan 5, 2026
5a7ec5c
change url
TS-ANC Jan 5, 2026
9680360
more verbose printing
TS-ANC Jan 5, 2026
a5ee5bc
add powershell to build
TS-ANC Jan 5, 2026
3bcecc8
use tar instead
TS-ANC Jan 5, 2026
f47ac46
more logging
TS-ANC Jan 5, 2026
5e1e403
copy binaries to where build scripts looks for them
TS-ANC Jan 5, 2026
005632c
use patching for winpty build
TS-ANC Jan 7, 2026
e3cf462
update patcher
TS-ANC Jan 7, 2026
5723b3f
patch continuously
TS-ANC Jan 7, 2026
381b2a5
vendor winpty-rs
TS-ANC Jan 8, 2026
ea855c9
add sha256 to winpty-rs
TS-ANC Jan 8, 2026
4a59ea1
fix local winpty-rs path
TS-ANC Jan 8, 2026
2bf6f09
update license path
TS-ANC Jan 8, 2026
27d3da6
minor cleanup
TS-ANC Jan 8, 2026
49b855c
enable winpty import
TS-ANC Jan 8, 2026
27b82a7
enable upstream tests
TS-ANC Jan 8, 2026
5e01a9d
add flaky test dependency
TS-ANC Jan 8, 2026
958050e
disable conpty tests
TS-ANC Jan 8, 2026
56cff2b
deselect test_read
TS-ANC Jan 8, 2026
3517023
disable tests
TS-ANC Jan 8, 2026
688e36a
cleanup
TS-ANC Jan 8, 2026
4c338c8
skip patch
TS-ANC Jan 8, 2026
a66830d
clarify usage
TS-ANC Jan 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@echo on

REM Build
cd pywinpty-src
%PYTHON% -m pip install . -vv --no-deps --no-build-isolation
if errorlevel 1 exit 1

REM Generate license
cargo-bundle-licenses --format yaml --output "%SRC_DIR%\THIRDPARTY.yml"
if errorlevel 1 exit 1

echo Build completed successfully
23 changes: 23 additions & 0 deletions recipe/disable_conpty_backend.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/build.rs b/build.rs
index 41105ea..ef43987 100644
--- a/build.rs
+++ b/build.rs
@@ -177,15 +177,9 @@ fn main() {
// let kernel32 = kernel32_res.unwrap();

// let conpty = unsafe { GetProcAddress(kernel32, "CreatePseudoConsole".into_pcstr()) };
- match major_version >= 10 && build_version >= 2004 {
- true => {
- conpty_enabled = "1";
- println!("cargo:rustc-cfg=feature=\"conpty\"")
- }
- false => {
- conpty_enabled = "0";
- }
- }
+
+ // Skip ConPTY - use WinPTY backend only
+ conpty_enabled = "0";

println!("ConPTY enabled: {}", conpty_enabled);
println!("Output path: {}", get_output_path().to_str().unwrap());
26 changes: 26 additions & 0 deletions recipe/disable_conpty_tests.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/winpty/tests/test_pty.py b/winpty/tests/test_pty.py
index 52fb4c1..25ca478 100644
--- a/winpty/tests/test_pty.py
+++ b/winpty/tests/test_pty.py
@@ -38,7 +38,7 @@ conpty_provider = pty_factory(Backend.ConPTY)
winpty_provider = pty_factory(Backend.WinPTY)


-@pytest.fixture(scope='module', params=['WinPTY', 'ConPTY'])
+@pytest.fixture(scope='module', params=['WinPTY'])
def pty_fixture(request):
backend = request.param
if os.environ.get('CI_RUNNING', None) == '1':
diff --git a/winpty/tests/test_ptyprocess.py b/winpty/tests/test_ptyprocess.py
index 1d7662d..aad70ed 100644
--- a/winpty/tests/test_ptyprocess.py
+++ b/winpty/tests/test_ptyprocess.py
@@ -19,7 +19,7 @@ from winpty.ptyprocess import PtyProcess, which



-@pytest.fixture(scope='module', params=['WinPTY', 'ConPTY'])
+@pytest.fixture(scope='module', params=['WinPTY'])
def pty_fixture(request):
backend = request.param
if os.environ.get('CI_RUNNING', None) == '1':
35 changes: 21 additions & 14 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
{% set version = "2.0.15" %}
{% set version = "3.0.2" %}
{% set name = "pywinpty" %}

package:
name: {{ name }}
version: {{ version }}

source:
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
sha256: 312cf39153a8736c617d45ce8b6ad6cd2107de121df91c455b10ce6bba7a39b2
- url: https://pypi.org/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
sha256: 1505cc4cb248af42cb6285a65c9c2086ee9e7e574078ee60933d5d7fa86fb004
folder: pywinpty-src
patches:
- skip-pywinpty-nuget.patch
- use_local_winpty-rs.patch

# winpty-rs: vendored in dependency
- url: https://github.com/andfoy/winpty-rs/archive/refs/tags/v1.0.4.tar.gz
Copy link

Choose a reason for hiding this comment

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

Is there a reason as to not extract it as a seperate package?

Copy link

Choose a reason for hiding this comment

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

The winpty-rs code is statically linked into pywinpty (.pyd), no dynamic library. Only dynamically linked are the winpty/conpty backends (although conpty backend not supported for this release).

Choose a reason for hiding this comment

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

Does pywinpty 3.0.2 fail without adding winpty-rs as a local (vendored) dependency? Or is it because you need to patch winpty-rs not to use conpty? Is it possible to patch only https://github.com/andfoy/pywinpty/blob/v3.0.2/build.rs#L20-L47?

Copy link

Choose a reason for hiding this comment

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

winpty-rs needs to be patched.
Patching needs to be done on both levels (pywindpty, and winpty-rs), as each will attempts to use NuGet to fetch ConPTY backend. In previous version this was not an issue, as only WinPTY backend was supported (ConPTY is the one with NuGet).

For this release, ConPTY backend has disabled.

sha256: d67f96abc22d4b13efb9a88969caf9929a2e8b1b928843b5ab122455e9640e7f
folder: winpty-rs-src
patches:
- disable_conpty_backend.patch

build:
number: 0
skip: true # [(not win) or py<39]
script:
- {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation
- cargo-bundle-licenses --format yaml --output "{{ SRC_DIR }}\THIRDPARTY.yml"

requirements:
build:
Expand All @@ -37,23 +45,22 @@ test:
- pip
commands:
- pip check

- python -c "from importlib.metadata import version; assert(version('{{ name }}')=='{{ version }}')"

about:
home: https://github.com/spyder-ide/pywinpty
home: https://github.com/andfoy/pywinpty
license: MIT
license_file:
- LICENSE.txt
license_file:
- pywinpty-src/LICENSE.txt
- THIRDPARTY.yml
license_family: MIT
summary: Pseudoterminals for Windows in Python
description: |
PyWinpty allows creating and communicating with Windows processes that
receive input and print outputs via console input and output pipes.
PyWinpty supports both the native ConPTY interface and the previous,
fallback winpty library.
doc_url: https://github.com/spyder-ide/pywinpty
dev_url: https://github.com/spyder-ide/pywinpty
WinPTY backend is supported.
doc_url: https://github.com/andfoy/pywinpty
dev_url: https://github.com/andfoy/pywinpty

extra:
recipe-maintainers:
Expand Down
17 changes: 17 additions & 0 deletions recipe/skip-pywinpty-nuget.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/build.rs b/build.rs
index 0e509b5..daf1541 100644
--- a/build.rs
+++ b/build.rs
@@ -27,7 +27,11 @@ fn main() {
let nuget_found = command_ok(nuget.arg("help"));

if !nuget_found {
- panic!("NuGet is required to build pywinpty");
+ // Skip NuGet - use conda-provided winpty
+ println!("cargo:warning=Skipping NuGet check, using system-provided winpty");
+ println!("cargo:rustc-link-search=native={}", env::var("LIBRARY_LIB").unwrap_or_default());
+ println!("cargo:rustc-link-lib=winpty");
+ return;
}

if command_ok(
14 changes: 14 additions & 0 deletions recipe/use_local_winpty-rs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/Cargo.toml b/Cargo.toml
index 53c075f..3022765 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -17,7 +17,8 @@ crate-type = ["cdylib"]
glob = "0.3.2"

[dependencies]
-winpty-rs = "1.0.4"
+# We'll use a local version of winpty-rs (vendored)
+winpty-rs = { path = "../winpty-rs-src" }

[dependencies.pyo3]
version = "0.26.0"