diff --git a/.appveyor.yml b/.appveyor.yml index 3ab4cda97..a1f3e247f 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -7,7 +7,7 @@ environment: PYTHONUNBUFFERED: 1 install: - - C:\Python27\python -u scripts\ci_install.py + - C:\Python27\python -u scripts\dev\ci_install.py test_script: - C:\Python34\Scripts\tox -e smoke diff --git a/.travis.yml b/.travis.yml index 686dbbdaa..59556f0bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ os: language: c install: - - python scripts/ci_install.py + - python scripts/dev/ci_install.py script: - xvfb-run -s "-screen 0 640x480x16" tox -e unittests,smoke diff --git a/MANIFEST.in b/MANIFEST.in index 3a3e21d60..fd50d2dbb 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -16,15 +16,8 @@ include requirements.txt include tox.ini include qutebrowser.py -include scripts/__init__.py -include scripts/hostblock_blame.py -include scripts/importer.py -include scripts/keytester.py -include scripts/link_pyqt.py -include scripts/minimal_webkit_testbrowser.py -include scripts/setupcommon.py -include scripts/utils.py - +prune scripts/dev +exclude scripts/asciidoc2html.py exclude doc/notes recursive-exclude doc *.asciidoc include doc/qutebrowser.1.asciidoc diff --git a/scripts/__init__.py b/scripts/__init__.py index ea73ef5bd..90be1e04d 100644 --- a/scripts/__init__.py +++ b/scripts/__init__.py @@ -1,3 +1,3 @@ # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: -"""Various scripts used to develop/install qutebrowser.""" +"""Various utility scripts.""" diff --git a/scripts/dev/__init__.py b/scripts/dev/__init__.py new file mode 100644 index 000000000..7dc043361 --- /dev/null +++ b/scripts/dev/__init__.py @@ -0,0 +1,3 @@ +# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: + +"""Various scripts used for developing qutebrowser.""" diff --git a/scripts/build_release.py b/scripts/dev/build_release.py similarity index 99% rename from scripts/build_release.py rename to scripts/dev/build_release.py index a37ecf426..a54251d85 100755 --- a/scripts/build_release.py +++ b/scripts/dev/build_release.py @@ -28,7 +28,8 @@ import shutil import subprocess import argparse -sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir)) +sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, + os.pardir)) import qutebrowser from scripts import utils diff --git a/scripts/ci_install.py b/scripts/dev/ci_install.py similarity index 100% rename from scripts/ci_install.py rename to scripts/dev/ci_install.py diff --git a/scripts/cleanup.py b/scripts/dev/cleanup.py similarity index 98% rename from scripts/cleanup.py rename to scripts/dev/cleanup.py index 2a708cf7f..62e6a3537 100755 --- a/scripts/cleanup.py +++ b/scripts/dev/cleanup.py @@ -27,7 +27,8 @@ import glob import shutil import fnmatch -sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir)) +sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, + os.pardir)) from scripts import utils diff --git a/scripts/freeze.py b/scripts/dev/freeze.py similarity index 97% rename from scripts/freeze.py rename to scripts/dev/freeze.py index 6185634ec..db6ab1a93 100755 --- a/scripts/freeze.py +++ b/scripts/dev/freeze.py @@ -32,12 +32,13 @@ import distutils import cx_Freeze as cx # pylint: disable=import-error # cx_Freeze is hard to install (needs C extensions) so we don't check for it. -sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir)) +sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, + os.pardir)) from scripts import setupcommon BASEDIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), - os.path.pardir) + os.path.pardir, os.path.pardir) def get_egl_path(): diff --git a/scripts/freeze_tests.py b/scripts/dev/freeze_tests.py similarity index 90% rename from scripts/freeze_tests.py rename to scripts/dev/freeze_tests.py index 7cd7022a9..fb687e016 100755 --- a/scripts/freeze_tests.py +++ b/scripts/dev/freeze_tests.py @@ -30,15 +30,17 @@ import cx_Freeze as cx # pylint: disable=import-error # cx_Freeze is hard to install (needs C extensions) so we don't check for it. import pytest -sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir)) -from scripts import setupcommon, freeze +sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, + os.pardir)) +from scripts import setupcommon +from scripts.dev import freeze @contextlib.contextmanager def temp_git_commit_file(): """Context manager to temporarily create a fake git-commit-id file.""" basedir = os.path.join(os.path.dirname(os.path.realpath(__file__)), - os.path.pardir) + os.path.pardir, os.pardir) path = os.path.join(basedir, 'qutebrowser', 'git-commit-id') with open(path, 'wb') as f: f.write(b'fake-frozen-git-commit') @@ -59,7 +61,7 @@ def main(): """Main entry point.""" with temp_git_commit_file(): cx.setup( - executables=[cx.Executable('scripts/run_frozen_tests.py', + executables=[cx.Executable('scripts/dev/run_frozen_tests.py', targetName='run-frozen-tests')], options={'build_exe': get_build_exe_options()}, **setupcommon.setupdata diff --git a/scripts/gen_resources.py b/scripts/dev/gen_resources.py similarity index 100% rename from scripts/gen_resources.py rename to scripts/dev/gen_resources.py diff --git a/scripts/misc_checks.py b/scripts/dev/misc_checks.py similarity index 97% rename from scripts/misc_checks.py rename to scripts/dev/misc_checks.py index dac0fe017..91b17db7b 100644 --- a/scripts/misc_checks.py +++ b/scripts/dev/misc_checks.py @@ -30,7 +30,8 @@ import tokenize import traceback import collections -sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir)) +sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, + os.pardir)) from scripts import utils @@ -88,7 +89,7 @@ def check_spelling(): ok = True for fn in _py_files(): with tokenize.open(fn) as f: - if fn == os.path.join('.', 'scripts', 'misc_checks.py'): + if fn == os.path.join('.', 'scripts', 'dev', 'misc_checks.py'): continue for line in f: for w in words: diff --git a/scripts/pylint_checkers/__init__.py b/scripts/dev/pylint_checkers/__init__.py similarity index 100% rename from scripts/pylint_checkers/__init__.py rename to scripts/dev/pylint_checkers/__init__.py diff --git a/scripts/pylint_checkers/config.py b/scripts/dev/pylint_checkers/config.py similarity index 98% rename from scripts/pylint_checkers/config.py rename to scripts/dev/pylint_checkers/config.py index a4ce51c8e..d703093ed 100644 --- a/scripts/pylint_checkers/config.py +++ b/scripts/dev/pylint_checkers/config.py @@ -28,7 +28,8 @@ from pylint import interfaces, checkers from pylint.checkers import utils sys.path.insert( - 0, os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) + 0, os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, + os.pardir)) from qutebrowser.config import configdata diff --git a/scripts/pylint_checkers/modeline.py b/scripts/dev/pylint_checkers/modeline.py similarity index 100% rename from scripts/pylint_checkers/modeline.py rename to scripts/dev/pylint_checkers/modeline.py diff --git a/scripts/pylint_checkers/openencoding.py b/scripts/dev/pylint_checkers/openencoding.py similarity index 100% rename from scripts/pylint_checkers/openencoding.py rename to scripts/dev/pylint_checkers/openencoding.py diff --git a/scripts/pylint_checkers/settrace.py b/scripts/dev/pylint_checkers/settrace.py similarity index 100% rename from scripts/pylint_checkers/settrace.py rename to scripts/dev/pylint_checkers/settrace.py diff --git a/scripts/quit_segfault_test.sh b/scripts/dev/quit_segfault_test.sh similarity index 100% rename from scripts/quit_segfault_test.sh rename to scripts/dev/quit_segfault_test.sh diff --git a/scripts/run_frozen_tests.py b/scripts/dev/run_frozen_tests.py similarity index 100% rename from scripts/run_frozen_tests.py rename to scripts/dev/run_frozen_tests.py diff --git a/scripts/run_profile.py b/scripts/dev/run_profile.py similarity index 98% rename from scripts/run_profile.py rename to scripts/dev/run_profile.py index 8b0c85aae..9248c4c62 100755 --- a/scripts/run_profile.py +++ b/scripts/dev/run_profile.py @@ -28,7 +28,8 @@ import tempfile import subprocess import shutil -sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir)) +sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, + os.pardir)) import qutebrowser.qutebrowser # pylint: disable=unused-import diff --git a/scripts/run_pylint_on_tests.py b/scripts/dev/run_pylint_on_tests.py similarity index 97% rename from scripts/run_pylint_on_tests.py rename to scripts/dev/run_pylint_on_tests.py index 792eaf7a6..91f5227b2 100644 --- a/scripts/run_pylint_on_tests.py +++ b/scripts/dev/run_pylint_on_tests.py @@ -29,7 +29,8 @@ import sys import os.path import subprocess -sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir)) +sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, + os.pardir)) from scripts import utils diff --git a/scripts/segfault_test.py b/scripts/dev/segfault_test.py similarity index 99% rename from scripts/segfault_test.py rename to scripts/dev/segfault_test.py index 091b1b7e4..56709c6c4 100755 --- a/scripts/segfault_test.py +++ b/scripts/dev/segfault_test.py @@ -26,7 +26,8 @@ import sys import subprocess import os.path -sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir)) +sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, + os.pardir)) from scripts import utils diff --git a/scripts/src2asciidoc.py b/scripts/dev/src2asciidoc.py similarity index 99% rename from scripts/src2asciidoc.py rename to scripts/dev/src2asciidoc.py index dddbc3a4f..d24c12d7d 100755 --- a/scripts/src2asciidoc.py +++ b/scripts/dev/src2asciidoc.py @@ -31,7 +31,8 @@ import collections import tempfile import argparse -sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir)) +sys.path.insert(0, os.path.join(os.path.dirname(__file__), os.pardir, + os.pardir)) # We import qutebrowser.app so all @cmdutils-register decorators are run. import qutebrowser.app diff --git a/tox.ini b/tox.ini index 6676915ee..01291f9f6 100644 --- a/tox.ini +++ b/tox.ini @@ -40,7 +40,7 @@ deps = cx_Freeze==4.3.4 commands = {envpython} scripts/link_pyqt.py --tox {envdir} - {envpython} scripts/freeze_tests.py build_exe -b {envdir}/build + {envpython} scripts/dev/freeze_tests.py build_exe -b {envdir}/build {envdir}/build/run-frozen-tests --strict -rfEsw {posargs} [testenv:coverage] @@ -56,13 +56,13 @@ commands = [testenv:misc] commands = - {envpython} scripts/misc_checks.py git - {envpython} scripts/misc_checks.py vcs - {envpython} scripts/misc_checks.py spelling + {envpython} scripts/dev/misc_checks.py git + {envpython} scripts/dev/misc_checks.py vcs + {envpython} scripts/dev/misc_checks.py spelling [testenv:pylint] skip_install = true -setenv = PYTHONPATH={toxinidir}/scripts +setenv = PYTHONPATH={toxinidir}/scripts/dev deps = -r{toxinidir}/requirements.txt astroid==1.3.6 @@ -73,7 +73,7 @@ deps = commands = {envpython} scripts/link_pyqt.py --tox {envdir} {envpython} -m pylint scripts qutebrowser --rcfile=.pylintrc --output-format=colorized --reports=no --expected-line-ending-format=LF - {envpython} scripts/run_pylint_on_tests.py --rcfile=.pylintrc --output-format=colorized --reports=no --expected-line-ending-format=LF + {envpython} scripts/dev/run_pylint_on_tests.py --rcfile=.pylintrc --output-format=colorized --reports=no --expected-line-ending-format=LF [testenv:pep257] skip_install = true @@ -167,7 +167,7 @@ deps = cx_Freeze==4.3.4 commands = {envpython} scripts/link_pyqt.py --tox {envdir} - {envpython} scripts/freeze.py build_exe --qute-skip-html -b {envdir}/build + {envpython} scripts/dev/freeze.py build_exe --qute-skip-html -b {envdir}/build {envdir}/build/qutebrowser --no-err-windows --nowindow --temp-basedir about:blank ":later 500 quit" [testenv:cxfreeze-windows] @@ -178,7 +178,7 @@ skip_install = true deps = {[testenv:smoke-frozen]deps} commands = {envpython} scripts/link_pyqt.py --tox {envdir} - {envpython} scripts/freeze.py {posargs} + {envpython} scripts/dev/freeze.py {posargs} [pytest] norecursedirs = .tox .venv