| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,8 +5,6 @@ environment: | |||
| 5 | 5 | CYGWIN64_GIT_PATH: "C:\\cygwin64\\bin;%GIT_DAEMON_PATH%" | |
| 6 | 6 | ||
| 7 | 7 | matrix: | |
| 8 | - ## MINGW | ||
| 9 | - # | ||
| 10 | 8 | - PYTHON: "C:\\Python27" | |
| 11 | 9 | PYTHON_VERSION: "2.7" | |
| 12 | 10 | GIT_PATH: "%GIT_DAEMON_PATH%" | |
@@ -25,21 +23,24 @@ environment: | |||
| 25 | 23 | - PYTHON: "C:\\Miniconda35-x64" | |
| 26 | 24 | PYTHON_VERSION: "3.5" | |
| 27 | 25 | IS_CONDA: "yes" | |
| 26 | + MAYFAIL: "yes" | ||
| 28 | 27 | GIT_PATH: "%GIT_DAEMON_PATH%" | |
| 29 | - | ||
| 30 | 28 | ## Cygwin | |
| 31 | - # | ||
| 32 | 29 | - PYTHON: "C:\\Miniconda-x64" | |
| 33 | 30 | PYTHON_VERSION: "2.7" | |
| 34 | 31 | IS_CONDA: "yes" | |
| 35 | 32 | IS_CYGWIN: "yes" | |
| 33 | + MAYFAIL: "yes" | ||
| 36 | 34 | GIT_PATH: "%CYGWIN_GIT_PATH%" | |
| 37 | 35 | - PYTHON: "C:\\Python35-x64" | |
| 38 | 36 | PYTHON_VERSION: "3.5" | |
| 39 | - GIT_PATH: "%CYGWIN64_GIT_PATH%" | ||
| 40 | 37 | IS_CYGWIN: "yes" | |
| 38 | + MAYFAIL: "yes" | ||
| 39 | + GIT_PATH: "%CYGWIN64_GIT_PATH%" | ||
| 41 | 40 | ||
| 42 | - | ||
| 41 | + matrix: | ||
| 42 | + allow_failures: | ||
| 43 | + - MAYFAIL: "yes" | ||
| 43 | 44 | install: | |
| 44 | 45 | - set PATH=%PYTHON%;%PYTHON%\Scripts;%GIT_PATH%;%PATH% | |
| 45 | 46 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,2 @@ | |||
| 1 | + .git/ | ||
| 2 | + .tox/ | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,12 +9,13 @@ matrix: | |||
| 9 | 9 | include: | |
| 10 | 10 | - python: 3.7 | |
| 11 | 11 | dist: xenial | |
| 12 | - sudo: required | ||
| 13 | 12 | - python: "nightly" | |
| 14 | 13 | dist: xenial | |
| 15 | - sudo: required | ||
| 16 | 14 | allow_failures: | |
| 15 | + - python: 3.7 | ||
| 16 | + dist: xenial | ||
| 17 | 17 | - python: "nightly" | |
| 18 | + dist: xenial | ||
| 18 | 19 | git: | |
| 19 | 20 | # a higher depth is needed for most of the tests - must be high enough to not actually be shallow | |
| 20 | 21 | # as we clone our own repository in the process | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,78 @@ | |||
| 1 | + # | ||
| 2 | + # Contributed by: James E. King III (@jeking3) <jking@apache.org> | ||
| 3 | + # | ||
| 4 | + # This Dockerfile creates an Ubuntu Xenial build environment | ||
| 5 | + # that can run the same test suite as Travis CI. | ||
| 6 | + # | ||
| 7 | + | ||
| 8 | + FROM ubuntu:xenial | ||
| 9 | + MAINTAINER James E. King III <jking@apache.org> | ||
| 10 | + ENV CONTAINER_USER=user | ||
| 11 | + ENV DEBIAN_FRONTEND noninteractive | ||
| 12 | + | ||
| 13 | + RUN apt-get update && \ | ||
| 14 | + apt-get install -y --no-install-recommends \ | ||
| 15 | + add-apt-key \ | ||
| 16 | + apt \ | ||
| 17 | + apt-transport-https \ | ||
| 18 | + apt-utils \ | ||
| 19 | + ca-certificates \ | ||
| 20 | + curl \ | ||
| 21 | + git \ | ||
| 22 | + net-tools \ | ||
| 23 | + openssh-client \ | ||
| 24 | + sudo \ | ||
| 25 | + vim \ | ||
| 26 | + wget | ||
| 27 | + | ||
| 28 | + RUN add-apt-key -v 6A755776 -k keyserver.ubuntu.com && \ | ||
| 29 | + echo "deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu xenial main" >> /etc/apt/sources.list && \ | ||
| 30 | + apt-get update && \ | ||
| 31 | + apt-get install -y --install-recommends python2.7 python3.4 python3.5 python3.6 python3.7 && \ | ||
| 32 | + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python2.7 27 && \ | ||
| 33 | + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.4 34 && \ | ||
| 34 | + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 35 && \ | ||
| 35 | + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 36 && \ | ||
| 36 | + update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 37 | ||
| 37 | + | ||
| 38 | + RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \ | ||
| 39 | + python3 get-pip.py && \ | ||
| 40 | + pip3 install tox | ||
| 41 | + | ||
| 42 | + # Clean up | ||
| 43 | + RUN rm -rf /var/cache/apt/* && \ | ||
| 44 | + rm -rf /var/lib/apt/lists/* && \ | ||
| 45 | + rm -rf /tmp/* && \ | ||
| 46 | + rm -rf /var/tmp/* | ||
| 47 | + | ||
| 48 | + ################################################################# | ||
| 49 | + # Build as a regular user | ||
| 50 | + # Credit: https://github.com/delcypher/docker-ubuntu-cxx-dev/blob/master/Dockerfile | ||
| 51 | + # License: None specified at time of import | ||
| 52 | + # Add non-root user for container but give it sudo access. | ||
| 53 | + # Password is the same as the username | ||
| 54 | + RUN useradd -m ${CONTAINER_USER} && \ | ||
| 55 | + echo ${CONTAINER_USER}:${CONTAINER_USER} | chpasswd && \ | ||
| 56 | + echo "${CONTAINER_USER} ALL=(root) ALL" >> /etc/sudoers | ||
| 57 | + RUN chsh --shell /bin/bash ${CONTAINER_USER} | ||
| 58 | + USER ${CONTAINER_USER} | ||
| 59 | + ################################################################# | ||
| 60 | + | ||
| 61 | + # The test suite will not tolerate running against a branch that isn't "master", so | ||
| 62 | + # check out the project to a well-known location that can be used by the test suite. | ||
| 63 | + # This has the added benefit of protecting the local repo fed into the container | ||
| 64 | + # as a volume from getting destroyed by a bug exposed by the test suite. :) | ||
| 65 | + ENV TRAVIS=ON | ||
| 66 | + RUN git clone --recursive https://github.com/gitpython-developers/GitPython.git /home/${CONTAINER_USER}/testrepo && \ | ||
| 67 | + cd /home/${CONTAINER_USER}/testrepo && \ | ||
| 68 | + ./init-tests-after-clone.sh | ||
| 69 | + ENV GIT_PYTHON_TEST_GIT_REPO_BASE=/home/${CONTAINER_USER}/testrepo | ||
| 70 | + ENV TRAVIS= | ||
| 71 | + | ||
| 72 | + # Ensure any local pip installations get on the path | ||
| 73 | + ENV PATH=/home/${CONTAINER_USER}/.local/bin:${PATH} | ||
| 74 | + | ||
| 75 | + # Set the global default git user to be someone non-descript | ||
| 76 | + RUN git config --global user.email ci@gitpython.org && \ | ||
| 77 | + git config --global user.name "GitPython CI User" | ||
| 78 | + | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,5 @@ | |||
| 1 | + .PHONY: all clean release force_release docker-build test nose-pdb | ||
| 2 | + | ||
| 1 | 3 | all: | |
| 2 | 4 | @grep -Ee '^[a-z].*:' Makefile | cut -d: -f1 | grep -vF all | |
| 3 | 5 | ||
@@ -16,3 +18,17 @@ force_release: clean | |||
| 16 | 18 | git push --tags origin master | |
| 17 | 19 | python3 setup.py sdist bdist_wheel | |
| 18 | 20 | twine upload -s -i byronimo@gmail.com dist/* | |
| 21 | + | ||
| 22 | + docker-build: | ||
| 23 | + docker build --quiet -t gitpython:xenial -f Dockerfile . | ||
| 24 | + | ||
| 25 | + test: docker-build | ||
| 26 | + # NOTE!!! | ||
| 27 | + # NOTE!!! If you are not running from master or have local changes then tests will fail | ||
| 28 | + # NOTE!!! | ||
| 29 | + docker run --rm -v ${CURDIR}:/src -w /src -t gitpython:xenial tox | ||
| 30 | + | ||
| 31 | + nose-pdb: docker-build | ||
| 32 | + # run tests under nose and break on error or failure into python debugger | ||
| 33 | + # HINT: set PYVER to "pyXX" to change from the default of py37 to pyXX for nose tests | ||
| 34 | + docker run --rm --env PYVER=${PYVER} -v ${CURDIR}:/src -w /src -it gitpython:xenial /bin/bash dockernose.sh | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,8 @@ | |||
| 1 | + #!/usr/bin/env bash | ||
| 2 | + set -ex | ||
| 3 | + if [ -z "${PYVER}" ]; then | ||
| 4 | + PYVER=py37 | ||
| 5 | + fi | ||
| 6 | + | ||
| 7 | + tox -e ${PYVER} --notest | ||
| 8 | + PYTHONPATH=/src/.tox/${PYVER}/lib/python*/site-packages /src/.tox/${PYVER}/bin/nosetests --pdb $* | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -715,8 +715,11 @@ def execute(self, command, | |||
| 715 | 715 | stdout_sink = (PIPE | |
| 716 | 716 | if with_stdout | |
| 717 | 717 | else getattr(subprocess, 'DEVNULL', None) or open(os.devnull, 'wb')) | |
| 718 | - log.debug("Popen(%s, cwd=%s, universal_newlines=%s, shell=%s)", | ||
| 719 | - command, cwd, universal_newlines, shell) | ||
| 718 | + istream_ok = "None" | ||
| 719 | + if istream: | ||
| 720 | + istream_ok = "<valid stream>" | ||
| 721 | + log.debug("Popen(%s, cwd=%s, universal_newlines=%s, shell=%s, istream=%s)", | ||
| 722 | + command, cwd, universal_newlines, shell, istream_ok) | ||
| 720 | 723 | try: | |
| 721 | 724 | proc = Popen(command, | |
| 722 | 725 | env=env, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -695,6 +695,8 @@ def _get_fetch_info_from_stderr(self, proc, progress): | |||
| 695 | 695 | msg += "Will ignore extra progress lines or fetch head lines." | |
| 696 | 696 | msg %= (l_fil, l_fhi) | |
| 697 | 697 | log.debug(msg) | |
| 698 | + log.debug("info lines: " + str(fetch_info_lines)) | ||
| 699 | + log.debug("head info : " + str(fetch_head_info)) | ||
| 698 | 700 | if l_fil < l_fhi: | |
| 699 | 701 | fetch_head_info = fetch_head_info[:l_fil] | |
| 700 | 702 | else: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,4 +2,5 @@ ddt>=1.1.1 | |||
| 2 | 2 | coverage | |
| 3 | 3 | flake8 | |
| 4 | 4 | nose | |
| 5 | + tox | ||
| 5 | 6 | mock; python_version=='2.7' | |
| Back | FazBrowse Home | New Git URL |
0 commit comments