-
Notifications
You must be signed in to change notification settings - Fork 76
try windows support #134
base: master
Are you sure you want to change the base?
try windows support #134
Conversation
hustlijian
commented
Nov 16, 2018
- set windows cache directory
- splint lines
- use which
@hustlijian thanks for the pr. I left some comments. Something that's missing though is to configure CI to run on windows. |
.travis.yml
Outdated
@@ -13,6 +13,7 @@ cache: pip | |||
install: | |||
- pip install .[dev,test] coveralls | |||
- bash scripts/install-linters.sh | |||
- pip install -r requirements-dev.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be necessary as the pip command above is also installing dev and test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, I see colorama
will installed: travis-jobs
gitlint/__init__.py
Outdated
@@ -50,6 +50,8 @@ | |||
|
|||
import docopt | |||
import termcolor | |||
import colorama |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer colorama to be a dependency only for windows systems.
gitlint/utils.py
Outdated
@@ -19,6 +19,7 @@ | |||
|
|||
# This can be just pathlib when 2.7 and 3.4 support is dropped. | |||
import pathlib2 as pathlib | |||
from shutil import which |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which does not.exist in python 2.7
gitlint/utils.py
Outdated
@@ -75,6 +60,7 @@ def _open_for_write(filename): | |||
def _get_cache_filename(name, filename): | |||
"""Returns the cache location for filename and linter name.""" | |||
filename = os.path.abspath(filename)[1:] | |||
filename = filename.lstrip(":\\") # for windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't a drive letter appears before :\?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed by filename = os.path.abspath(filename)[1:]
requirements-dev.txt
Outdated
@@ -0,0 +1,7 @@ | |||
termcolor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Termcolor and colorama are not dev dependencies. But as said above, colorama should only be required for windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should be removed an instead add the dependencies to the setup file. But colorama
should only be required for windows.
See https://hynek.me/articles/conditional-python-dependencies/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i will change them to use setup.py, declaring-platform-specific-dependencies
.travis.yml
Outdated
@@ -2,7 +2,7 @@ sudo: required | |||
dist: trusty | |||
language: python | |||
python: | |||
- 2.7 | |||
# - 2.7 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hustlijian It's not acceptable to get rid of the Python 2.7 support.
@sk- I changed some code, and got python2.7/3.4 ci passed: travis build#9 , but two pyfakefs test can not passed, Can you help with it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea about how to fix the tests, but that seems related to your changes as I just tested master and the tests still pass.
Also in the PR you need to enable testing in windows in the Travis config. See https://blog.travis-ci.com/2018-10-11-windows-early-release
requirements-dev.txt
Outdated
@@ -0,0 +1,7 @@ | |||
termcolor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should be removed an instead add the dependencies to the setup file. But colorama
should only be required for windows.
See https://hynek.me/articles/conditional-python-dependencies/
gitlint/utils.py
Outdated
@@ -21,6 +21,72 @@ | |||
import pathlib2 as pathlib | |||
|
|||
|
|||
# copy from python3, shutil.which |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which version of python was used? Which commit?
Probably is better to depend on a backported version of which like. https://pypi.org/project/backports.shutil_which/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your patience, I will improve this PR later。
The language 'python' is currently unsupported on the Windows Build Environment. Let us know if you'd like to see it: https://travis-ci.community/c/environments/windows. Thanks for understanding!