Skip to content

Commit 9c6edab

Browse files
committed
azure pipelines [skip travis] [skip appveyor]
1 parent 09e64e8 commit 9c6edab

File tree

9 files changed

+72
-85
lines changed

9 files changed

+72
-85
lines changed

.travis.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
[![Build Status](https://travis-ci.org/pre-commit/pre-commit.svg?branch=master)](https://travis-ci.org/pre-commit/pre-commit)
2-
[![Coverage Status](https://coveralls.io/repos/github/pre-commit/pre-commit/badge.svg?branch=master)](https://coveralls.io/github/pre-commit/pre-commit?branch=master)
3-
[![Build status](https://ci.appveyor.com/api/projects/status/mmcwdlfgba4esaii/branch/master?svg=true)](https://ci.appveyor.com/project/asottile/pre-commit/branch/master)
1+
[![Build Status](https://dev.azure.com/asottile/asottile/_apis/build/status/asottile.pyupgrade?branchName=master)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=21&branchName=master)
2+
[![Azure DevOps coverage](https://img.shields.io/azure-devops/coverage/asottile/asottile/21/master.svg)](https://dev.azure.com/asottile/asottile/_build/latest?definitionId=21&branchName=master)
43

54
## pre-commit
65

appveyor.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

azure-pipelines.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
trigger:
2+
branches:
3+
include: [master, test-me-*]
4+
tags:
5+
include: ['*']
6+
7+
resources:
8+
repositories:
9+
- repository: asottile
10+
type: github
11+
endpoint: github
12+
name: asottile/azure-pipeline-templates
13+
ref: refs/tags/v0.0.13
14+
15+
jobs:
16+
- template: job--pre-commit.yml@asottile
17+
- template: job--python-tox.yml@asottile
18+
parameters:
19+
toxenvs: [py27, py37]
20+
os: windows
21+
additional_variables:
22+
COVERAGE_IGNORE_WINDOWS: '# pragma: windows no cover'
23+
TOX_TESTENV_PASSENV: COVERAGE_IGNORE_WINDOWS
24+
TEMP: C:\Temp # remove when dropping python2
25+
pre_test:
26+
- template: step--rust-install.yml
27+
- template: job--python-tox.yml@asottile
28+
parameters:
29+
toxenvs: [py37]
30+
os: linux
31+
name_postfix: _latest_git
32+
pre_test:
33+
- task: UseRubyVersion@0
34+
- template: step--git-install.yml
35+
- template: step--rust-install.yml
36+
- bash: |
37+
testing/get-swift.sh
38+
echo '##vso[task.prependpath]/tmp/swift/usr/bin'
39+
displayName: install swift
40+
- template: job--python-tox.yml@asottile
41+
parameters:
42+
toxenvs: [pypy, pypy3, py27, py36, py37]
43+
os: linux
44+
pre_test:
45+
- task: UseRubyVersion@0
46+
- template: step--rust-install.yml
47+
- bash: |
48+
testing/get-swift.sh
49+
echo '##vso[task.prependpath]/tmp/swift/usr/bin'
50+
displayName: install swift

pre_commit/languages/node.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def _envdir(prefix, version):
2323
return prefix.path(directory)
2424

2525

26-
def get_env_patch(venv):
26+
def get_env_patch(venv): # pragma: windows no cover
2727
if sys.platform == 'cygwin': # pragma: no cover
2828
_, win_venv, _ = cmd_output('cygpath', '-w', venv)
2929
install_prefix = r'{}\bin'.format(win_venv.strip())
@@ -41,12 +41,14 @@ def get_env_patch(venv):
4141

4242

4343
@contextlib.contextmanager
44-
def in_env(prefix, language_version):
44+
def in_env(prefix, language_version): # pragma: windows no cover
4545
with envcontext(get_env_patch(_envdir(prefix, language_version))):
4646
yield
4747

4848

49-
def install_environment(prefix, version, additional_dependencies):
49+
def install_environment(
50+
prefix, version, additional_dependencies,
51+
): # pragma: windows no cover
5052
additional_dependencies = tuple(additional_dependencies)
5153
assert prefix.exists('package.json')
5254
envdir = _envdir(prefix, version)
@@ -72,6 +74,6 @@ def install_environment(prefix, version, additional_dependencies):
7274
)
7375

7476

75-
def run_hook(hook, file_args):
77+
def run_hook(hook, file_args): # pragma: windows no cover
7678
with in_env(hook.prefix, hook.language_version):
7779
return helpers.run_xargs(hook, helpers.to_cmd(hook), file_args)

pre_commit/languages/python.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ def norm_version(version):
109109
if _sys_executable_matches(version):
110110
return sys.executable
111111

112+
version_exec = _find_by_py_launcher(version)
113+
if version_exec:
114+
return version_exec
115+
112116
# Try looking up by name
113117
version_exec = find_executable(version)
114118
if version_exec and version_exec != version:
115119
return version_exec
116120

117-
version_exec = _find_by_py_launcher(version)
118-
if version_exec:
119-
return version_exec
120-
121121
# If it is in the form pythonx.x search in the default
122122
# place on windows
123123
if version.startswith('python'):

testing/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ def cmd_output_mocked_pre_commit_home(*args, **kwargs):
3030

3131

3232
skipif_cant_run_docker = pytest.mark.skipif(
33-
docker_is_running() is False,
34-
reason='Docker isn\'t running or can\'t be accessed',
33+
os.name == 'nt' or not docker_is_running(),
34+
reason="Docker isn't running or can't be accessed",
3535
)
3636

3737
skipif_cant_run_swift = pytest.mark.skipif(

tests/xargs_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def test_argument_too_long():
145145
def test_xargs_smoke():
146146
ret, out, err = xargs.xargs(('echo',), ('hello', 'world'))
147147
assert ret == 0
148-
assert out == b'hello world\n'
148+
assert out.replace(b'\r\n', b'\n') == b'hello world\n'
149149
assert err == b''
150150

151151

tox.ini

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
[tox]
2-
project = pre_commit
3-
# These should match the travis env list
4-
envlist = py27,py36,py37,pypy
2+
envlist = py27,py36,py37,pypy,pypy3,pre-commit
53

64
[testenv]
75
deps = -rrequirements-dev.txt
8-
passenv = LOCALAPPDATA
6+
passenv = HOME LOCALAPPDATA
97
commands =
108
coverage erase
119
coverage run -m pytest {posargs:tests}
1210
coverage report --fail-under 100
13-
pre-commit run --all-files
11+
pre-commit install
1412

15-
[testenv:venv]
16-
envdir = venv-{[tox]project}
17-
commands =
13+
[testenv:pre-commit]
14+
skip_install = true
15+
deps = pre-commit
16+
commands = pre-commit run --all-files --show-diff-on-failure
1817

1918
[pep8]
2019
ignore = E265,E501,W504

0 commit comments

Comments
 (0)