Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit 343be0b

Browse files
committed
Merge branch 'development' into stable
2 parents b72d374 + 9516e23 commit 343be0b

12 files changed

+74
-24
lines changed

.activate.sh

-4
This file was deleted.

.activate.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
venv/bin/activate

.deactivate.sh

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
deactivate
2-
unset TOP

.pre-commit-config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- id: double-quote-string-fixer
1414
- id: end-of-file-fixer
1515
- id: flake8
16+
exclude: ^docs/
1617
- repo: git://github.com/asottile/reorder_python_imports
1718
sha: 8b583ac1beb0dd0f14c4bceb0a53bb1023cb3dd7
1819
hooks:

CI/circle/main

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ lsb_release -a
1515
test $CIRCLE_NODE_TOTAL -eq 4
1616

1717
timestamp
18-
sudo apt-get install python2.7-dev python3.4-dev
18+
sudo apt-get update
19+
sudo apt-get install -y python2.7-dev python3.4-dev
1920

2021
### per-node actions
2122
timestamp

pip_faster.py

+22-1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,25 @@ def is_local_directory(url):
7171
return isdir(url[5:])
7272

7373

74+
def is_vcs_url(url):
75+
"""Test if a URL is a VCS repo.
76+
77+
>>> is_vcs_url('git+git://git.myproject.org/MyProject#egg=MyProject')
78+
True
79+
>>> is_vcs_url('svn+http://svn.myproject.org/svn/MyProject/trunk@2019#egg=MyProject')
80+
True
81+
>>> is_vcs_url('file:///tmp/')
82+
False
83+
"""
84+
if url is None:
85+
return False
86+
else:
87+
return url.startswith(tuple(
88+
scheme + '+'
89+
for scheme in pipmodule.vcs.vcs
90+
))
91+
92+
7493
def optimistic_wheel_search(req, find_links):
7594
assert req_is_pinned(req), req
7695

@@ -145,7 +164,9 @@ def wheelable(req):
145164
# we don't want to permanently cache something we'll edit
146165
not req.editable and
147166
# people expect `pip install .` to work without bumping the version
148-
not is_local_directory(req.url)
167+
not is_local_directory(req.url) and
168+
# don't cache vcs packages, since the version is often bogus (#156)
169+
not is_vcs_url(req.url)
149170
)
150171

151172

pylintrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ class-rgx=%(const-rgx)s
3737
[FORMAT]
3838
max-line-length=131
3939

40-
# TODO: we'd like to hit 250 here
41-
max-module-lines=532
40+
# TODO: we'd like to hit this
41+
# max-module-lines=250
4242

4343
[TYPECHECK]
4444
ignored-classes=pytest,LocalPath,RootLogger

tests/functional/get_installed_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_pip_get_installed(tmpdir):
5252
run('myvenv/bin/pip', 'uninstall', '--yes', 'cov-core', 'coverage', 'py', 'pytest', 'pytest-cov')
5353
assert get_installed() == []
5454

55-
run('myvenv/bin/pip', 'install', 'flake8')
55+
run('myvenv/bin/pip', 'install', 'flake8==2.5.0')
5656
assert get_installed() == ['flake8', 'mccabe', 'pep8', 'pyflakes']
5757

5858
run('myvenv/bin/pip', 'uninstall', '--yes', 'flake8')

tests/functional/pip_faster.py

+31-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def it_installs_stuff(tmpdir):
3232
install_coverage(venv)
3333

3434
assert pip_freeze(str(venv)) == '''\
35-
coverage==4.0.3
35+
coverage==4.2
3636
coverage-enable-subprocess==1.0
3737
'''
3838

@@ -89,7 +89,7 @@ def it_installs_stuff_with_dash_e_without_wheeling(tmpdir):
8989
assert set(frozen_requirements) == set([
9090
'-e git://github.com/Yelp/dumb-init.git@87545be699a13d0fd31f67199b7782ebd446437e#egg=dumb_init-dev', # noqa
9191
'coverage-enable-subprocess==1.0',
92-
'coverage==4.0.3',
92+
'coverage==4.2',
9393
'venv-update==' + __version__,
9494
'wheel==0.29.0',
9595
'',
@@ -117,7 +117,7 @@ def it_doesnt_wheel_local_dirs(tmpdir):
117117

118118
frozen_requirements = pip_freeze(str(venv)).split('\n')
119119
assert set(frozen_requirements) == set([
120-
'coverage==4.0.3',
120+
'coverage==4.2',
121121
'coverage-enable-subprocess==1.0',
122122
'dependant-package==1',
123123
'implicit-dependency==1',
@@ -136,6 +136,34 @@ def it_doesnt_wheel_local_dirs(tmpdir):
136136
])
137137

138138

139+
@pytest.mark.usefixtures('pypi_server')
140+
def it_doesnt_wheel_git_repos(tmpdir):
141+
venv = tmpdir.join('venv')
142+
install_coverage(venv)
143+
144+
pip = venv.join('bin/pip').strpath
145+
run(pip, 'install', 'venv-update==' + __version__)
146+
147+
run(
148+
venv.join('bin/pip-faster').strpath,
149+
'install',
150+
'git+git://github.com/Yelp/dumb-init.git@87545be699a13d0fd31f67199b7782ebd446437e#egg=dumb-init', # noqa
151+
)
152+
153+
frozen_requirements = pip_freeze(str(venv)).split('\n')
154+
assert set(frozen_requirements) == set([
155+
'coverage-enable-subprocess==1.0',
156+
'coverage==4.2',
157+
'dumb-init==0.5.0',
158+
'venv-update==' + __version__,
159+
'wheel==0.29.0',
160+
'',
161+
])
162+
163+
wheelhouse = tmpdir.join('home', '.cache', 'pip-faster', 'wheelhouse')
164+
assert set(Wheel(f.basename).name for f in wheelhouse.listdir()) == set()
165+
166+
139167
@pytest.mark.usefixtures('pypi_server')
140168
def it_can_handle_requirements_already_met(tmpdir):
141169
venv = tmpdir.join('venv')

tests/functional/simple_test.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ def flake8_older():
280280
''' % TOP)
281281
venv_update()
282282
assert pip_freeze() == '\n'.join((
283-
'coverage==4.0.3',
283+
'coverage==4.2',
284284
'coverage-enable-subprocess==1.0',
285285
'flake8==2.0',
286286
'mccabe==0.3',
@@ -306,7 +306,7 @@ def flake8_newer():
306306
''' % TOP)
307307
venv_update()
308308
assert pip_freeze() == '\n'.join((
309-
'coverage==4.0.3',
309+
'coverage==4.2',
310310
'coverage-enable-subprocess==1.0',
311311
'flake8==2.2.5',
312312
'mccabe==0.3',

tests/unit/fix_coverage_test.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ def test_fix_coverage(tmpdir):
2222
str(unrelated_file): {(5, 6): None},
2323
})
2424

25-
assert coverage_data.lines(base_file) == [1]
26-
assert coverage_data.lines(sub_file) == [3]
27-
assert coverage_data.lines(unrelated_file) == [5]
25+
assert coverage_data.lines(base_file) == [1, 2]
26+
assert coverage_data.lines(sub_file) == [3, 4]
27+
assert coverage_data.lines(unrelated_file) == [5, 6]
2828

2929
merge_coverage(coverage_data, '/site-packages/', str(tmpdir))
3030

3131
# The base file should contain all the lines and arcs
32-
assert coverage_data.lines(base_file) == [1, 3]
32+
assert coverage_data.lines(base_file) == [1, 2, 3, 4]
3333
assert coverage_data.arcs(base_file) == [(1, 2), (3, 4)]
34-
assert coverage_data.lines(unrelated_file) == [5]
34+
assert coverage_data.lines(unrelated_file) == [5, 6]
3535
assert coverage_data.arcs(unrelated_file) == [(5, 6)]
3636

3737
# And the sub file should no longer exist

tox.ini

+5-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ skipsdist=True
88
passenv =
99
PYTEST_OPTIONS
1010
PYTHON
11-
changedir =
11+
changedir =
1212
{envtmpdir}
13-
setenv =
13+
setenv =
1414
TOP={toxinidir}
1515
SITEPACKAGES={envsitepackagesdir}
1616
venv_update =
@@ -33,3 +33,6 @@ commands =
3333
deps = -rrequirements.d/docs.txt
3434
changedir = docs
3535
commands = sphinx-build -b html -d build/doctrees source build/html
36+
37+
[flake8]
38+
max-line-length = 131

venv_update.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
from os.path import exists
5959
from os.path import join
6060

61-
__version__ = '1.1.0'
61+
__version__ = '1.1.1'
6262
DEFAULT_VIRTUALENV_PATH = 'venv'
6363
DEFAULT_OPTION_VALUES = {
6464
'venv=': (DEFAULT_VIRTUALENV_PATH,),
@@ -163,7 +163,7 @@ def exec_(argv): # never returns
163163
"""Wrapper to os.execv which shows the command and runs any atexit handlers (for coverage's sake).
164164
Like os.execv, this function never returns.
165165
"""
166-
## info('EXEC' + colorize(argv)) # TODO: debug logging by environment variable
166+
# info('EXEC' + colorize(argv)) # TODO: debug logging by environment variable
167167

168168
# in python3, sys.exitfunc has gone away, and atexit._run_exitfuncs seems to be the only pubic-ish interface
169169
# https://hg.python.org/cpython/file/3.4/Modules/atexitmodule.c#l289

0 commit comments

Comments
 (0)