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

Unit tests fail on Windows #15

Closed
kurtmckee opened this issue Dec 12, 2020 · 4 comments
Closed

Unit tests fail on Windows #15

kurtmckee opened this issue Dec 12, 2020 · 4 comments

Comments

@kurtmckee
Copy link
Contributor

I've checked out scriv from master on Windows and ran the following commands:

python -m virtualenv venv
.\venv\Scripts\Activate.ps1
python -m pip install pip --upgrade
python -m pip install -r .\requirements\dev.txt
tox

Almost every tox environment failed. There appear to be multiple issues:

  1. os.sep is not respected. Tests for output relied on hard-coded paths like call(['git', 'add', 'changelog.d/20130225_151617_joedev.rst']), but failed because Windows used backslashes in the command.

  2. Black attempted to reformat every file in the virtual environment, which took a very long time to fail. Errors like error: cannot format venv\Lib\site-packages\docutils\languages\fa.py: I/O operation on closed file appeared for what appears to be every file in the virtual environment. Until I fix this it may be difficult to zero in on the other issues due to sheer volume of output.

  3. make is not available in my environment. This may be insurmountable in a Windows environment but I'll see if I can at least trace this.

I'll work to resolve both of these issue and submit a patch.

@kurtmckee
Copy link
Contributor Author

MyPy is really upset when I reference os.sep or os.path.sep. It says the attribute doesn't exist. I'm going to wrap everything in a getattr(os.path, "sep", ""), but to prevent additional line length errors I'm putting everything into a "".join() call.

When I submit the patch please let me know if my complaint-avoidance solutions are acceptable.

@kurtmckee
Copy link
Contributor Author

I'm also getting pylint errors saying "Optional is unsubscriptable". It appears that pylint has a fix coming but it isn't live yet. I'll recreate my environment using Python 3.8 for now.

kurtmckee added a commit to kurtmckee/pr-scriv that referenced this issue Dec 13, 2020
kurtmckee added a commit to kurtmckee/pr-scriv that referenced this issue Dec 13, 2020
@nedbat
Copy link
Owner

nedbat commented Dec 13, 2020

Thanks for getting Windows going! I'm trying to switch over to GitHub Actions in #17, and while some things are failing, some Windows tests are passing. Can you help me understand why yours fail but mine succeed, and how to make my GitHub Actions Windows tests more accurate for your environment?

The pylint failures happen on 3.9, but not 3.8 I think. Don't worry about those, I will track them down :)

@kurtmckee
Copy link
Contributor Author

Sure thing! I'll look at the results in #17 now.

kurtmckee added a commit to kurtmckee/pr-scriv that referenced this issue Dec 13, 2020
kurtmckee added a commit to kurtmckee/pr-scriv that referenced this issue Dec 13, 2020
kurtmckee added a commit to kurtmckee/pr-scriv that referenced this issue Dec 13, 2020
@nedbat nedbat closed this as completed in 5bb5926 Dec 14, 2020
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

No branches or pull requests

2 participants