Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Add support for ConPTY and Python 3.9 #137

Merged
merged 40 commits into from
Apr 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
2533a7f
Add basic Rust package
andfoy Apr 15, 2021
6d409d6
Add include
andfoy Apr 15, 2021
3fd609b
Allow header files
andfoy Apr 16, 2021
a4e4470
Remove Cargo.lock
andfoy Apr 16, 2021
00c899d
Add first winpty-compilable library
andfoy Apr 16, 2021
25a87fa
Detect Windows major version and build number
andfoy Apr 16, 2021
e1b372e
C++ bindings for ConPTY and WinPTY are now complete
andfoy Apr 20, 2021
0aac30e
Fix issues with environment when spawning a process
andfoy Apr 21, 2021
1c2d1cf
Remove temporary files
andfoy Apr 21, 2021
7f880ba
Add null-terminating byte
andfoy Apr 22, 2021
49ae953
Test inheriting the env
andfoy Apr 22, 2021
8fc2f33
Use raw bytes for reading/writing
andfoy Apr 23, 2021
efb1395
Ensure winpty is working
andfoy Apr 23, 2021
0b1016c
Fix test_pty
andfoy Apr 23, 2021
c5902be
Fix tests
andfoy Apr 23, 2021
6dcd520
Remove test_pty.py
andfoy Apr 23, 2021
1efa2aa
Apply style fixes
andfoy Apr 23, 2021
67b2473
Add license to findlib
andfoy Apr 23, 2021
90cb1be
Test-run CI
andfoy Apr 23, 2021
02463dd
Use toolchain@v1
andfoy Apr 23, 2021
77efeaf
Force a timeout
andfoy Apr 23, 2021
901004f
Set timeout to 5s
andfoy Apr 23, 2021
72bcebc
Use capsys?
andfoy Apr 23, 2021
41f25a3
Use CMD
andfoy Apr 23, 2021
2e2a761
Use cmd without args
andfoy Apr 23, 2021
d6f1d02
Use SSh
andfoy Apr 23, 2021
ad40042
Use Ngrok?
andfoy Apr 23, 2021
7b4aad6
Add failure everywhere
andfoy Apr 23, 2021
27b05e2
Remove env
andfoy Apr 23, 2021
81ab21a
Try with powershell
andfoy Apr 23, 2021
8fadb87
Try with capture sys
andfoy Apr 23, 2021
2764db5
Try with --capture=no
andfoy Apr 23, 2021
03e447b
Try with pytest programatically
andfoy Apr 24, 2021
ca3eb28
Remove -s
andfoy Apr 24, 2021
714e184
Obtain original stdin and stdout
andfoy Apr 24, 2021
e69d9f7
Wait for process to end
andfoy Apr 24, 2021
efc5b63
Remove -s
andfoy Apr 24, 2021
cf857f0
Update src/lib.rs
andfoy Apr 26, 2021
e79c698
Address review comments
andfoy Apr 26, 2021
bee348a
Merge branch 'rust_migration' of github.com:spyder-ide/pywinpty into …
andfoy Apr 26, 2021
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
113 changes: 0 additions & 113 deletions .ciocheck

This file was deleted.

74 changes: 74 additions & 0 deletions .github/workflows/windows_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Windows tests

on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
windows:
name: Windows Py${{ matrix.PYTHON_VERSION }}
runs-on: windows-latest
env:
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
RUNNER_OS: "windows"
strategy:
fail-fast: false
matrix:
PYTHON_VERSION: ["3.6", "3.7", "3.8", "3.9"]
steps:
- name: Checkout branch
uses: actions/checkout@v2
- name: Install latest Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: x86_64-pc-windows-msvc
override: true
components: rustfmt, clippy
- name: Install miniconda
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
activate-environment: test
channels: conda-forge,defaults
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Conda env info
shell: bash -l {0}
run: conda env list
- name: Install winpty
shell: bash -l {0}
run: conda install -y winpty
- name: Install build/test dependencies
shell: bash -l {0}
run: pip install maturin toml pytest pytest-lazy-fixture flaky
andfoy marked this conversation as resolved.
Show resolved Hide resolved
- name: Build pywinpty
shell: bash -l {0}
run: maturin develop
- name: Run tests
shell: pwsh
run: python runtests.py
# Enable this to get RDP access to the worker.
# - name: Download
# if: ${{ failure() }}
# run: Invoke-WebRequest https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-windows-amd64.zip -OutFile ngrok.zip
# - name: Extract
# if: ${{ failure() }}
# run: Expand-Archive ngrok.zip
# - name: Auth
# if: ${{ failure() }}
# run: .\ngrok\ngrok.exe authtoken <ngrok token>
# - name: Enable TS
# if: ${{ failure() }}
# run: Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0
# - run: Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
# if: ${{ failure() }}
# - run: Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" -Value 1
# if: ${{ failure() }}
# - run: Set-LocalUser -Name "runneradmin" -Password (ConvertTo-SecureString -AsPlainText "P@ssw0rd!" -Force)
# if: ${{ failure() }}
# - name: Create Tunnel
# if: ${{ failure() }}
# run: .\ngrok\ngrok.exe tcp 3389
10 changes: 9 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,15 @@ cywinpty.c
# Winpty binaries
*.exe
*.dll
*.h

# Git giles
*.orig

# Added by cargo

/target
Cargo.lock

# Visual Studio files
.vs/
CppProperties.json
32 changes: 32 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
name = "pywinpty"
version = "0.7.0-dev0"
authors = ["Edgar Andrés Margffoy Tuay <[email protected]>"]
description = "Pseudo terminal support for Windows from Python."
repository = "https://github.com/spyder-ide/pywinpty"
license = "MIT"
keywords = ["pty", "pseudo-terminal", "conpty", "windows", "winpty"]
readme = "README.md"
edition = "2018"
links = "winpty"

[lib]
name = "winpty"
crate-type = ["cdylib"]

[dependencies]
libc = "0.2.81"
cxx = "1.0.45"

[dependencies.pyo3]
version = "0.13.2"
features = ["extension-module"]

[build-dependencies]
cxx-build = {version = "1.0.45", features = ["parallel"]}
pywinpty_findlib = { version = "=0.1.0", path = "findlib" }
which = "4.1.0"

[package.metadata.docs.rs]
default-target = "x86_64-pc-windows-msvc"
targets = ["x86_64-pc-windows-msvc"]
86 changes: 0 additions & 86 deletions appveyor.yml

This file was deleted.

12 changes: 0 additions & 12 deletions appveyor/build.ps1

This file was deleted.

11 changes: 0 additions & 11 deletions appveyor/install.ps1

This file was deleted.

41 changes: 0 additions & 41 deletions appveyor/publish.ps1

This file was deleted.

Loading