Skip to content

Commit

Permalink
Merge branch 'requires-io-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Compiler committed Jan 4, 2020
2 parents 239f064 + 985ac5f commit 4cc498f
Show file tree
Hide file tree
Showing 16 changed files with 88 additions and 58 deletions.
2 changes: 1 addition & 1 deletion misc/requirements/requirements-codecov.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
certifi==2019.11.28
chardet==3.0.4
codecov==2.0.15
coverage==4.5.4
coverage==5.0.1
idna==2.8
requests==2.22.0
urllib3==1.25.7
6 changes: 3 additions & 3 deletions misc/requirements/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ bump2version==0.5.11
certifi==2019.11.28
cffi==1.13.2
chardet==3.0.4
colorama==0.4.1
colorama==0.4.3
cryptography==2.8
cssutils==1.0.2
github3.py==1.3.0
hunter==3.0.4
hunter==3.0.5 # rq.filter: != 3.1.0
idna==2.8
jwcrypto==0.6.0
lxml==4.4.2
Expand All @@ -18,5 +18,5 @@ Pympler==0.8
python-dateutil==2.8.1
requests==2.22.0
six==1.13.0
uritemplate==3.0.0
uritemplate==3.0.1
urllib3==1.25.7
2 changes: 2 additions & 0 deletions misc/requirements/requirements-dev.txt-raw
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ github3.py
bump2version
requests
lxml

#@ filter: hunter != 3.1.0
13 changes: 5 additions & 8 deletions misc/requirements/requirements-flake8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
attrs==19.3.0
entrypoints==0.3
flake8==3.7.9
flake8-bugbear==19.8.0
flake8-builtins==1.4.1
flake8-bugbear==20.1.0
flake8-builtins==1.4.2
flake8-comprehensions==3.1.4
flake8-copyright==0.2.2
flake8-debugger==3.2.1
Expand All @@ -14,15 +14,12 @@ flake8-future-import==0.4.6
flake8-mock==0.3
flake8-polyfill==1.0.2
flake8-string-format==0.2.3
flake8-tidy-imports==3.0.0
flake8-tuple==0.4.0
importlib-metadata==1.1.0
flake8-tidy-imports==4.0.0
flake8-tuple==0.4.1
mccabe==0.6.1
more-itertools==8.0.0
pep8-naming==0.9.1
pycodestyle==2.5.0
pydocstyle==4.0.1
pydocstyle==5.0.1
pyflakes==2.1.1
six==1.13.0
snowballstemmer==2.0.0
zipp==0.6.0
2 changes: 1 addition & 1 deletion misc/requirements/requirements-mypy.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py

mypy==0.750
mypy==0.761
mypy-extensions==0.4.3
# PyQt5==5.11.3
# PyQt5-sip==4.19.19
Expand Down
4 changes: 2 additions & 2 deletions misc/requirements/requirements-pip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

appdirs==1.4.3
packaging==19.2
pyparsing==2.4.5
setuptools==42.0.2
pyparsing==2.4.6
setuptools==44.0.0
six==1.13.0
wheel==0.33.6
4 changes: 2 additions & 2 deletions misc/requirements/requirements-pylint.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ python-dateutil==2.8.1
./scripts/dev/pylint_checkers
requests==2.22.0
six==1.13.0
typed-ast==1.4.0
uritemplate==3.0.0
typed-ast==1.4.0 ; python_version<"3.8"
uritemplate==3.0.1
urllib3==1.25.7
wrapt==1.11.2
1 change: 1 addition & 0 deletions misc/requirements/requirements-pylint.txt-raw
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ github3.py

# fix qute-pylint location
#@ replace: qute-pylint==.* ./scripts/dev/pylint_checkers
#@ markers: typed-ast python_version<"3.8"
3 changes: 1 addition & 2 deletions misc/requirements/requirements-pyqt-5.11.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py

PyQt5==5.11.3 # rq.filter: < 5.12
PyQt5-sip==4.19.19
sip==4.19.8 # rq.filter: < 5
PyQt5-sip==4.19.19 # rq.filter: < 4.20
4 changes: 2 additions & 2 deletions misc/requirements/requirements-pyqt-5.11.txt-raw
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#@ filter: PyQt5 < 5.12
PyQt5 >= 5.11, < 5.12
#@ filter: sip < 5
sip < 5

#@ filter: PyQt5-sip < 4.20
8 changes: 4 additions & 4 deletions misc/requirements/requirements-sphinx.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py

alabaster==0.7.12
Babel==2.7.0
Babel==2.8.0
certifi==2019.11.28
chardet==3.0.4
docutils==0.15.2
idna==2.8
imagesize==1.1.0
imagesize==1.2.0
Jinja2==2.10.3
MarkupSafe==1.1.1
packaging==19.2
Pygments==2.5.2
pyparsing==2.4.5
pyparsing==2.4.6
pytz==2019.3
requests==2.22.0
six==1.13.0
snowballstemmer==2.0.0
Sphinx==2.2.2
Sphinx==2.3.1
sphinxcontrib-applehelp==1.0.1
sphinxcontrib-devhelp==1.0.1
sphinxcontrib-htmlhelp==1.0.2
Expand Down
37 changes: 18 additions & 19 deletions misc/requirements/requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -1,47 +1,46 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py

atomicwrites==1.3.0
attrs==19.3.0
beautifulsoup4==4.8.1
beautifulsoup4==4.8.2
cheroot==8.2.1
Click==7.0
# colorama==0.4.1
coverage==4.5.4
EasyProcess==0.2.7
# colorama==0.4.3
coverage==5.0.1
EasyProcess==0.2.8
Flask==1.1.1
glob2==0.7
hunter==3.0.4
hypothesis==4.50.6
importlib-metadata==1.1.0
hunter==3.0.5 # rq.filter: != 3.1.0
hypothesis==5.1.0
itsdangerous==1.1.0
jaraco.functools==2.0
jaraco.functools==3.0.0 ; python_version>="3.6"
# Jinja2==2.10.3
Mako==1.1.0
manhole==1.6.0
# MarkupSafe==1.1.1
more-itertools==8.0.0
more-itertools==8.0.2
packaging==19.2
parse==1.12.1
parse==1.14.0
parse-type==0.5.2
pluggy==0.13.1
py==1.8.0
py==1.8.1
py-cpuinfo==5.0.0
pyparsing==2.4.5
pytest==5.3.1
pyparsing==2.4.6
pytest==5.3.2
pytest-bdd==3.2.1
pytest-benchmark==3.2.2
pytest-cov==2.8.1
pytest-instafail==0.4.1.post0
pytest-mock==1.12.1
pytest-qt==3.2.2
pytest-mock==2.0.0
pytest-qt==3.3.0
pytest-repeat==0.8.0
pytest-rerunfailures==8.0
pytest-travis-fold==1.3.0
pytest-xvfb==1.2.0
PyVirtualDisplay==0.2.4
PyVirtualDisplay==0.2.5
six==1.13.0
sortedcontainers==2.1.0
soupsieve==1.9.5
vulture==1.2
wcwidth==0.1.7
wcwidth==0.1.8
Werkzeug==0.16.0
zipp==0.6.0
jaraco.functools==2.0; python_version<"3.6" # rq.filter: <= 2.0
3 changes: 3 additions & 0 deletions misc/requirements/requirements-tests.txt-raw
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ pytest-travis-fold
pytest-xvfb
vulture

#@ filter: hunter != 3.1.0
#@ markers: jaraco.functools python_version>="3.6"
#@ add: jaraco.functools==2.0; python_version<"3.6" # rq.filter: <= 2.0
#@ ignore: Jinja2, MarkupSafe, colorama
11 changes: 4 additions & 7 deletions misc/requirements/requirements-tox.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py

filelock==3.0.12
importlib-metadata==1.1.0
more-itertools==8.0.0
packaging==19.2
pluggy==0.13.1
py==1.8.0
pyparsing==2.4.5
py==1.8.1
pyparsing==2.4.6
six==1.13.0
toml==0.10.0
tox==3.14.1
tox==3.14.3
tox-venv==0.4.0
virtualenv==16.7.8
zipp==0.6.0
virtualenv==16.7.9
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# This file is automatically generated by scripts/dev/recompile_requirements.py

attrs==19.3.0
colorama==0.4.1
colorama==0.4.3
cssutils==1.0.2
Jinja2==2.10.3
MarkupSafe==1.1.1
Pygments==2.5.2
pyPEG2==2.15.2
PyYAML==5.1.2
PyYAML==5.2
42 changes: 37 additions & 5 deletions scripts/dev/recompile_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ def convert_line(line, comments):
except KeyError:
pass

try:
line += ' ; {}'.format(comments['markers'][pkgname])
except KeyError:
pass

return line


Expand All @@ -71,8 +76,10 @@ def read_comments(fobj):
"""
comments = {
'filter': {},
'markers': {},
'comment': {},
'ignore': [],
'add': [],
'replace': {},
}
for line in fobj:
Expand All @@ -91,6 +98,11 @@ def read_comments(fobj):
elif command == 'replace':
pattern, replacement = args.split(' ', maxsplit=1)
comments['replace'][pattern] = replacement
elif command == 'markers':
pkg, markers = args.split(' ', maxsplit=1)
comments['markers'][pkg] = markers
elif command == 'add':
comments['add'].append(args)
return comments


Expand All @@ -114,12 +126,27 @@ def main():
else:
outfile = os.path.join(REQ_DIR, 'requirements-{}.txt'.format(name))

if name in [
# Need sip v4 which doesn't work on Python 3.8
'pyqt-5.7', 'pyqt-5.9', 'pyqt-5.10', 'pyqt-5.11', 'pyqt-5.12',
# Installs typed_ast on < 3.8 only
'pylint',
]:
host_python = 'python3.7'
else:
host_python = sys.executable

with tempfile.TemporaryDirectory() as tmpdir:
pip_bin = os.path.join(tmpdir, 'bin', 'pip')
subprocess.run(['virtualenv', tmpdir], check=True)
subprocess.run([pip_bin, 'install', '-r', filename], check=True)
proc = subprocess.run([pip_bin, 'freeze'], check=True,
stdout=subprocess.PIPE)
subprocess.run([host_python, '-m', 'venv', tmpdir], check=True)

venv_python = os.path.join(tmpdir, 'bin', 'python')
subprocess.run([venv_python, '-m', 'pip',
'install', '-U', 'pip'], check=True)

subprocess.run([venv_python, '-m', 'pip',
'install', '-r', filename], check=True)
proc = subprocess.run([venv_python, '-m', 'pip', 'freeze'],
check=True, stdout=subprocess.PIPE)
reqs = proc.stdout.decode('utf-8')

with open(filename, 'r', encoding='utf-8') as f:
Expand All @@ -129,8 +156,13 @@ def main():
f.write("# This file is automatically generated by "
"scripts/dev/recompile_requirements.py\n\n")
for line in reqs.splitlines():
if line.startswith('qutebrowser=='):
continue
f.write(convert_line(line, comments) + '\n')

for line in comments['add']:
f.write(line + '\n')


if __name__ == '__main__':
main()

0 comments on commit 4cc498f

Please sign in to comment.