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

stdin works on Windows, too, without regressing issue #5 #13

Merged
merged 6 commits into from
Feb 16, 2024

Conversation

jshipley
Copy link
Contributor

This fixes #12

This makes rexi work on Windows again, and is also a good fix for issue #5 where rexi was waiting for input forever when no input was given.

I have run the unit tests and other checks on both Windows and Linux, and everything seems to be working as expected.

I'm not going to guarantee that it will work on any version of Windows older than Windows 10, but given that Windows 10 is EOL in about a year and a half that shouldn't matter.

@codecov-commenter
Copy link

codecov-commenter commented Feb 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (aefcbac) 100.00% compared to head (441b086) 100.00%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #13   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          242       254   +12     
=========================================
+ Hits           242       254   +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@royreznik
Copy link
Owner

Im currently on a vacation for the next few days, so i will do a CR later in the week :)

@royreznik
Copy link
Owner

Seems good to me, Can you fix the coverage to 100%?
Also Can you add a Windows to the Actions Metrix? if you aren't familiar with it I will add it in another PR

@jshipley
Copy link
Contributor Author

I added windows-latest to the github actions matrix. I'm not really familiar with github actions, so please let me know if more is needed.

@royreznik
Copy link
Owner

It seems to work, but there is a problem in the make file with windows, can you fix it too?
Also please add test that will make it still 100% coverage.
You can tedt the coverage using the 'make test' command and change the coverage parameter to html

@jshipley
Copy link
Contributor Author

jshipley commented Feb 14, 2024 via email

Also removed '-rf' from rm command to fix windows matrix tests
@jshipley
Copy link
Contributor Author

I pushed in another change.

For the matrix test, I think that removing "-rf" from the "rm -rf" command should be enough to get it to work. The output from the build makes it look like powershell is running the Windows commands. In powershell, "rm" works, but it runs the "Remove-Item" cmdlet that has different flags than the Linux rm command.

It looks like poetry.lock is a file, not a directory, so the "-rf" was unnecessary. If for some reason this doesn't work, it'll probably need a condition to make it run a different rm command on Windows and Linux.

I ended up writing a simple test case for the new isatty wrapper function, because no matter what I try I can't get a mock for sys.stdin.isatty to work inside the rexi_cli typer function. It might be because of the interaction with typer, or it might be the reassignment of sys.stdin that's happening.

Long story short, test coverage should be 100% now, and the matrix tests should work.

@jshipley
Copy link
Contributor Author

Hmm. It looks like it's failing now because make isn't available on the Windows runner.

I'll add a step to install make, but I don't know of any way to test running a GitHub action without actually checking in the changes and letting GitHub run it.

@royreznik
Copy link
Owner

royreznik commented Feb 16, 2024

Im going to push a ccommit that might fix it here

@royreznik
Copy link
Owner

For now lets remove the github action for windows.
It takes a lot of resources and i don't want to use all my action time for windows checking :D

Copy link
Owner

@royreznik royreznik left a comment

Choose a reason for hiding this comment

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

Looks good

@royreznik royreznik merged commit 171d470 into royreznik:master Feb 16, 2024
6 checks passed
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.

Rexi stdin handling does not work on Windows
3 participants