From dc53063aabf748307d4764f6d0d61c2ee500097f Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Sun, 13 Jan 2019 16:21:32 -0500 Subject: [PATCH 01/12] #12: add more aggressive tests for version, use conda-build to source binaries and check checksums instead of python/curl, add maintainer --- recipe/bld.bat | 6 ------ recipe/build.sh | 5 ----- recipe/download-chromedriver.py | 21 --------------------- recipe/meta.yaml | 25 +++++++++++++++++-------- recipe/run_test.py | 17 +++++++++++++++++ 5 files changed, 34 insertions(+), 40 deletions(-) delete mode 100644 recipe/bld.bat delete mode 100644 recipe/build.sh delete mode 100644 recipe/download-chromedriver.py create mode 100644 recipe/run_test.py diff --git a/recipe/bld.bat b/recipe/bld.bat deleted file mode 100644 index 205f8d0..0000000 --- a/recipe/bld.bat +++ /dev/null @@ -1,6 +0,0 @@ -python %RECIPE_DIR%\download-chromedriver.py -if errorlevel 1 exit 1 - -REM Add chromedriver to PATH so chromedriver_binary install can find it -set PATH=%PATH%;%CD%\chromedriver -python -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv diff --git a/recipe/build.sh b/recipe/build.sh deleted file mode 100644 index ceb0cee..0000000 --- a/recipe/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -python $RECIPE_DIR/download-chromedriver.py -chmod 755 chromedriver/chromedriver -# Add chromedriver to PATH so chromedriver_binary install can find it -export PATH=$PATH:$PWD/chromedriver -python -m pip install . --no-deps --ignore-installed --no-cache-dir -vvv diff --git a/recipe/download-chromedriver.py b/recipe/download-chromedriver.py deleted file mode 100644 index 9f37804..0000000 --- a/recipe/download-chromedriver.py +++ /dev/null @@ -1,21 +0,0 @@ -import os -import sys -import subprocess -import zipfile - -pkg_version = os.environ['PKG_VERSION'] -driver_version = "{0}.{1}".format(*pkg_version.split(".")) -if sys.platform == 'win32': - chromedriver_pkg = 'chromedriver_win32.zip' -elif sys.platform == 'darwin': - chromedriver_pkg = 'chromedriver_mac64.zip' -else: - chromedriver_pkg = 'chromedriver_linux64.zip' - -download_url = 'https://chromedriver.storage.googleapis.com/{0}/{1}'.format(driver_version, chromedriver_pkg) - -subprocess.check_call('curl "{}" -o chromedriver.zip'.format(download_url), shell=True) - -os.mkdir('chromedriver') -with zipfile.ZipFile('chromedriver.zip') as chromedriver_zip_file: - chromedriver_zip_file.extractall('chromedriver') diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 834111b..435ce68 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,25 +1,31 @@ {% set name = "python-chromedriver-binary" %} {% set version = "2.45.0" %} -{% set sha256 = "d39f928d96e9d939dfc19fe8e4c8d18a7fb81f63940ed6a8e2b7263c1d0a7d0d" %} +{% set chromedriver_version = ".".join(version.split(".")[:2]) %} +{% set sha256 = "" %} package: name: {{ name|lower }} version: {{ version }} source: - fn: {{ name }}-{{ version }}.tar.gz - url: https://github.com/danielkaiser/{{ name }}/archive/v{{ version }}.tar.gz - sha256: {{ sha256 }} + - url: https://github.com/danielkaiser/{{ name }}/archive/v{{ version }}.tar.gz + sha256: d39f928d96e9d939dfc19fe8e4c8d18a7fb81f63940ed6a8e2b7263c1d0a7d0d + - url: https://chromedriver.storage.googleapis.com/{{ chromedriver_version }}/chromedriver_linux64.zip # [linux] + sha256: d4a5eec0a3b7fec9bcb71353233dde38630e51b29fa7b218cdd196e2e4487da7 # [linux] + - url: https://chromedriver.storage.googleapis.com/{{ chromedriver_version }}/chromedriver_max64.zip # [osx] + sha256: aa0f416a48e20185da62525869c1f98f994bf99f241d6ce2eb1af6ceb517c425 # [osx] + - url: https://chromedriver.storage.googleapis.com/{{ chromedriver_version }}/chromedriver_win32.zip # [win] + sha256: 8f3373a260a524410e25ea643ecb0175ed49a078088c7ab4d88db323ee19a230 # [win] build: - number: 1000 + number: 1001 + script: {{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-cache-dir -vv + requirements: host: - python - pip - - setuptools - - pandoc run: - python @@ -30,6 +36,8 @@ test: - chromedriver_binary commands: - chromedriver-path + - PATH=$(chromedriver-path) chromedriver --version # [unix] + - PATH=$(chromedriver-path) chromedriver --help # [unix] about: home: https://github.com/danielkaiser/python-chromedriver-binary @@ -39,10 +47,11 @@ about: summary: 'Downloads and installs the chromedriver binary version' description: | Downloads and installs the chromedriver binary for automated - testing of webapps. The installer supports Linux, MacOS and Windows + testing of webapps. The installer supports Linux, MacOS and Windows operating systems. extra: recipe-maintainers: - igortg - williamjamir + - bollwyvl diff --git a/recipe/run_test.py b/recipe/run_test.py new file mode 100644 index 0000000..57e5225 --- /dev/null +++ b/recipe/run_test.py @@ -0,0 +1,17 @@ +import subprocess +import os + +# artificially clear the path +os.environ["PATH"] = "" + +# allow side-effects to happen +import chromedriver_binary # noqa + +# it doesn't appear they do patch releases +CHROMEDRIVER_VERSION = ".".join(os.environ["PKG_VERSION"].split(".")[:2]) + +# test if the command executes, and capture the output +output = subprocess.check_output(["chromedriver", "--version"]).decode("utf-8") + +# test that we got a version that matches the upstream +assert output.startswith("ChromeDriver " + CHROMEDRIVER_VERSION), output From 576b7bfc6a439907fd5db998aba9d054986e232c Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Sun, 13 Jan 2019 16:33:25 -0500 Subject: [PATCH 02/12] MNT: Re-rendered with conda-smithy 3.2.2 and pinning 2019.01.09 --- .appveyor.yml | 11 +-- .azure-pipelines/azure-pipelines-linux.yml | 22 ++++++ .azure-pipelines/azure-pipelines-osx.yml | 78 +++++++++++++++++++ .azure-pipelines/azure-pipelines-win.yml | 91 ++++++++++++++++++++++ .azure-pipelines/build_steps.sh | 38 +++++++++ .azure-pipelines/run_docker_build.sh | 56 +++++++++++++ .circleci/build_steps.sh | 6 +- .circleci/run_docker_build.sh | 14 +++- .travis.yml | 7 +- README.md | 10 +++ azure-pipelines.yml | 10 +++ recipe/meta.yaml | 4 - 12 files changed, 326 insertions(+), 21 deletions(-) create mode 100755 .azure-pipelines/azure-pipelines-linux.yml create mode 100755 .azure-pipelines/azure-pipelines-osx.yml create mode 100755 .azure-pipelines/azure-pipelines-win.yml create mode 100755 .azure-pipelines/build_steps.sh create mode 100755 .azure-pipelines/run_docker_build.sh create mode 100644 azure-pipelines.yml diff --git a/.appveyor.yml b/.appveyor.yml index 21417e2..b075c80 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -31,7 +31,7 @@ install: ff_ci_pr_build -v --ci "appveyor" "%APPVEYOR_ACCOUNT_NAME%/%APPVEYOR_PROJECT_SLUG%" "%APPVEYOR_BUILD_NUMBER%" "%APPVEYOR_PULL_REQUEST_NUMBER%" del ff_ci_pr_build.py - # Cywing's git breaks conda-build. (See https://github.com/conda-forge/conda-smithy-feedstock/pull/2.) + # Cygwin's git breaks conda-build. (See https://github.com/conda-forge/conda-smithy-feedstock/pull/2.) - cmd: rmdir C:\cygwin /s /q # Add path, activate `conda` and update conda. @@ -40,14 +40,9 @@ install: - cmd: set PYTHONUNBUFFERED=1 - # Add our channels. - - cmd: conda.exe config --set show_channel_urls true - - cmd: conda.exe config --remove channels defaults - - cmd: conda.exe config --add channels defaults - - cmd: conda.exe config --add channels conda-forge - # Configure the VM. - - cmd: conda.exe install -n root --quiet --yes conda-forge-ci-setup=2 + - cmd: conda.exe install -n root -c conda-forge --quiet --yes conda-forge-ci-setup=2 + - cmd: setup_conda_rc .\ .\recipe .\.ci_support\%CONFIG%.yaml - cmd: run_conda_forge_build_setup # Skip .NET project specific build phase. diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml new file mode 100755 index 0000000..db4818a --- /dev/null +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -0,0 +1,22 @@ +jobs: +- job: linux_64 + pool: + vmImage: ubuntu-16.04 + timeoutInMinutes: 240 + strategy: + maxParallel: 8 + matrix: + linux_python2.7: + CONFIG: linux_python2.7 + linux_python3.6: + CONFIG: linux_python3.6 + linux_python3.7: + CONFIG: linux_python3.7 + steps: + - script: | + sudo pip install --upgrade pip + sudo pip install setuptools shyaml + displayName: Install dependencies + + - script: .azure-pipelines/run_docker_build.sh + displayName: Run docker build \ No newline at end of file diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml new file mode 100755 index 0000000..bf98d68 --- /dev/null +++ b/.azure-pipelines/azure-pipelines-osx.yml @@ -0,0 +1,78 @@ +jobs: +- job: osx_64 + pool: + vmImage: macOS-10.13 + timeoutInMinutes: 240 + strategy: + maxParallel: 8 + matrix: + osx_python2.7: + CONFIG: osx_python2.7 + osx_python3.6: + CONFIG: osx_python3.6 + osx_python3.7: + CONFIG: osx_python3.7 + + steps: + # TODO: Fast finish on azure pipelines? + - script: | + echo "Fast Finish" + + + - script: | + echo "Removing homebrew from Azure to avoid conflicts." + curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall > ~/uninstall_homebrew + chmod +x ~/uninstall_homebrew + ~/uninstall_homebrew -fq + rm ~/uninstall_homebrew + displayName: Remove homebrew + + - script: | + echo "Installing Miniconda" + set -x -e + curl -o $(Build.StagingDirectory)/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh + chmod +x $(Build.StagingDirectory)/miniconda.sh + $(Build.StagingDirectory)/miniconda.sh -b -p $(Build.StagingDirectory)/miniconda + export PATH=$(Build.StagingDirectory)/miniconda/bin:$PATH + echo "Setting up Conda environment" + displayName: 'Install miniconda' + + - script: | + export PATH=$(Build.StagingDirectory)/miniconda/bin:$PATH + set -x -e + conda install -n base -c conda-forge --quiet --yes conda-forge-ci-setup=2 + displayName: 'Add conda-forge-ci-setup=2' + + - script: | + set -x -e + export PATH=$(Build.StagingDirectory)/miniconda/bin:$PATH + echo "Configuring conda." + + setup_conda_rc ./ ./recipe ./.ci_support/${CONFIG}.yaml + + source run_conda_forge_build_setup + conda update --yes --quiet --override-channels -c conda-forge -c defaults --all + env: { + OSX_FORCE_SDK_DOWNLOAD: "1" + } + displayName: Configure conda and conda-build + + - script: | + export PATH=$(Build.StagingDirectory)/miniconda/bin:$PATH + set -x -e + mangle_compiler ./ ./recipe ./.ci_support/${CONFIG}.yaml + displayName: Mangle compiler + + - script: | + export PATH=$(Build.StagingDirectory)/miniconda/bin:$PATH + set -x -e + make_build_number ./ ./recipe ./.ci_support/${CONFIG}.yaml + displayName: Generate build number clobber file + + - script: | + export PATH=$(Build.StagingDirectory)/miniconda/bin:$PATH + set -x -e + conda build ./recipe -m ./.ci_support/${CONFIG}.yaml --clobber-file ./.ci_support/clobber_${CONFIG}.yaml + displayName: Build recipe + + \ No newline at end of file diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml new file mode 100755 index 0000000..e47dba4 --- /dev/null +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -0,0 +1,91 @@ +jobs: +- job: win_64 + pool: + vmImage: vs2017-win2016 + timeoutInMinutes: 240 + strategy: + maxParallel: 4 + matrix: + win_python2.7: + CONFIG: win_python2.7 + CONDA_BLD_PATH: D:\\bld\\ + win_python3.6: + CONFIG: win_python3.6 + CONDA_BLD_PATH: D:\\bld\\ + win_python3.7: + CONFIG: win_python3.7 + CONDA_BLD_PATH: D:\\bld\\ + steps: + # TODO: Fast finish on azure pipelines? + - script: | + ECHO ON + + + - script: | + choco install vcpython27 -fdv -y --debug + condition: contains(variables['CONFIG'], 'vs2008') + displayName: Install vcpython27.msi (if needed) + + # Cygwin's git breaks conda-build. (See https://github.com/conda-forge/conda-smithy-feedstock/pull/2.) + # - script: rmdir C:\cygwin /s /q + # continueOnError: true + + + - powershell: | + Set-PSDebug -Trace 1 + + $batchcontent = @" + ECHO ON + SET vcpython=C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0 + + DIR "%vcpython%" + + CALL "%vcpython%\vcvarsall.bat" %* + "@ + + $batchDir = "C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC" + $batchPath = "$batchDir" + "\vcvarsall.bat" + New-Item -Path $batchPath -ItemType "file" -Force + + Set-Content -Value $batchcontent -Path $batchPath + + Get-ChildItem -Path $batchDir + + Get-ChildItem -Path ($batchDir + '\..') + + condition: contains(variables['CONFIG'], 'vs2008') + displayName: Patch vs2008 (if needed) + + - task: CondaEnvironment@1 + inputs: + packageSpecs: 'python=3.6 conda-build conda conda-forge::conda-forge-ci-setup=2' # Optional + installOptions: "-c conda-forge" + updateConda: false + displayName: Install conda-build and activate environment + + - script: set PYTHONUNBUFFERED=1 + + # Configure the VM + - script: setup_conda_rc .\ .\recipe .\.ci_support\%CONFIG%.yaml + + # Configure the VM. + - script: | + run_conda_forge_build_setup + displayName: conda-forge build setup + run_conda_forge_build_setup + + # Special cased version setting some more things! + - script: | + conda.exe build recipe -m .ci_support\%CONFIG%.yaml --quiet + displayName: Build recipe (vs2008) + env: { + VS90COMNTOOLS: "C:\\Program Files (x86)\\Common Files\\Microsoft\\Visual C++ for Python\\9.0\\VC\\bin", + } + condition: contains(variables['CONFIG'], 'vs2008') + + - script: | + conda.exe build recipe -m .ci_support\%CONFIG%.yaml --quiet + displayName: Build recipe + condition: not(contains(variables['CONFIG'], 'vs2008')) + + \ No newline at end of file diff --git a/.azure-pipelines/build_steps.sh b/.azure-pipelines/build_steps.sh new file mode 100755 index 0000000..82832dc --- /dev/null +++ b/.azure-pipelines/build_steps.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +# PLEASE NOTE: This script has been automatically generated by conda-smithy. Any changes here +# will be lost next time ``conda smithy rerender`` is run. If you would like to make permanent +# changes to this script, consider a proposal to conda-smithy so that other feedstocks can also +# benefit from the improvement. + +set -xeuo pipefail +export PYTHONUNBUFFERED=1 +export FEEDSTOCK_ROOT=/home/conda/feedstock_root +export RECIPE_ROOT=/home/conda/recipe_root +export CI_SUPPORT=/home/conda/feedstock_root/.ci_support +export CONFIG_FILE="${CI_SUPPORT}/${CONFIG}.yaml" + +cat >~/.condarc </dev/null && pwd )" +PROVIDER_DIR="$(basename $THISDIR)" + +FEEDSTOCK_ROOT=$(cd "$(dirname "$0")/.."; pwd;) +RECIPE_ROOT="${FEEDSTOCK_ROOT}/recipe" + +docker info + +# In order for the conda-build process in the container to write to the mounted +# volumes, we need to run with the same id as the host machine, which is +# normally the owner of the mounted volumes, or at least has write permission +export HOST_USER_ID=$(id -u) +# Check if docker-machine is being used (normally on OSX) and get the uid from +# the VM +if hash docker-machine 2> /dev/null && docker-machine active > /dev/null; then + export HOST_USER_ID=$(docker-machine ssh $(docker-machine active) id -u) +fi + +ARTIFACTS="$FEEDSTOCK_ROOT/build_artifacts" + +if [ -z "$CONFIG" ]; then + echo "Need to set CONFIG env variable" + exit 1 +fi + +pip install shyaml +DOCKER_IMAGE=$(cat "${FEEDSTOCK_ROOT}/.ci_support/${CONFIG}.yaml" | shyaml get-value docker_image.0 condaforge/linux-anvil ) + +mkdir -p "$ARTIFACTS" +DONE_CANARY="$ARTIFACTS/conda-forge-build-done-${CONFIG}" +rm -f "$DONE_CANARY" +# Not all providers run with a real tty. Disable using one +DOCKER_RUN_ARGS=" " + + +docker run ${DOCKER_RUN_ARGS} \ + -v "${RECIPE_ROOT}":/home/conda/recipe_root:ro,z \ + -v "${FEEDSTOCK_ROOT}":/home/conda/feedstock_root:rw,z \ + -e CONFIG \ + -e BINSTAR_TOKEN \ + -e HOST_USER_ID \ + $DOCKER_IMAGE \ + bash \ + /home/conda/feedstock_root/${PROVIDER_DIR}/build_steps.sh + +# verify that the end of the script was reached +test -f "$DONE_CANARY" \ No newline at end of file diff --git a/.circleci/build_steps.sh b/.circleci/build_steps.sh index 258a085..cc002c4 100755 --- a/.circleci/build_steps.sh +++ b/.circleci/build_steps.sh @@ -19,7 +19,7 @@ conda-build: CONDARC -conda install --yes --quiet conda-forge::conda-forge-ci-setup=2 conda-build +conda install --yes --quiet conda-forge-ci-setup=2 conda-build -c conda-forge # set up the condarc setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" @@ -33,8 +33,10 @@ source run_conda_forge_build_setup make_build_number "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" conda build "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ - --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" --quiet + --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" + upload_package "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" + touch "/home/conda/feedstock_root/build_artifacts/conda-forge-build-done-${CONFIG}" \ No newline at end of file diff --git a/.circleci/run_docker_build.sh b/.circleci/run_docker_build.sh index f2959f6..2b3e413 100755 --- a/.circleci/run_docker_build.sh +++ b/.circleci/run_docker_build.sh @@ -7,6 +7,9 @@ set -xeuo pipefail +THISDIR="$( cd "$( dirname "$0" )" >/dev/null && pwd )" +PROVIDER_DIR="$(basename $THISDIR)" + FEEDSTOCK_ROOT=$(cd "$(dirname "$0")/.."; pwd;) RECIPE_ROOT="${FEEDSTOCK_ROOT}/recipe" @@ -35,16 +38,19 @@ DOCKER_IMAGE=$(cat "${FEEDSTOCK_ROOT}/.ci_support/${CONFIG}.yaml" | shyaml get-v mkdir -p "$ARTIFACTS" DONE_CANARY="$ARTIFACTS/conda-forge-build-done-${CONFIG}" rm -f "$DONE_CANARY" +# Enable running in interactive mode attached to a tty +DOCKER_RUN_ARGS=" -it " + -docker run -it \ - -v "${RECIPE_ROOT}":/home/conda/recipe_root \ - -v "${FEEDSTOCK_ROOT}":/home/conda/feedstock_root \ +docker run ${DOCKER_RUN_ARGS} \ + -v "${RECIPE_ROOT}":/home/conda/recipe_root:ro,z \ + -v "${FEEDSTOCK_ROOT}":/home/conda/feedstock_root:rw,z \ -e CONFIG \ -e BINSTAR_TOKEN \ -e HOST_USER_ID \ $DOCKER_IMAGE \ bash \ - /home/conda/feedstock_root/.circleci/build_steps.sh + /home/conda/feedstock_root/${PROVIDER_DIR}/build_steps.sh # verify that the end of the script was reached test -f "$DONE_CANARY" \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 022e993..4a156e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,8 @@ language: generic os: osx -osx_image: xcode6.4 +osx_image: xcode9.4 + env: matrix: @@ -49,7 +50,7 @@ install: echo "Configuring conda." source /Users/travis/miniconda3/bin/activate root - conda install --yes --quiet conda-forge::conda-forge-ci-setup=2 + conda install -n root -c conda-forge --quiet --yes conda-forge-ci-setup=2 setup_conda_rc ./ ./recipe ./.ci_support/${CONFIG}.yaml source run_conda_forge_build_setup @@ -62,4 +63,4 @@ script: # generate the build number clobber - make_build_number ./ ./recipe ./.ci_support/${CONFIG}.yaml - conda build ./recipe -m ./.ci_support/${CONFIG}.yaml --clobber-file ./.ci_support/clobber_${CONFIG}.yaml - - upload_package ./ ./recipe ./.ci_support/${CONFIG}.yaml + - upload_package ./ ./recipe ./.ci_support/${CONFIG}.yaml \ No newline at end of file diff --git a/README.md b/README.md index e053a16..570280f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ About python-chromedriver-binary ================================ +[![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](http://numfocus.org) + Home: https://github.com/danielkaiser/python-chromedriver-binary Package license: MIT @@ -107,3 +109,11 @@ In order to produce a uniquely identifiable distribution: * If the version of a package **is** being increased, please remember to return the [``build/number``](https://conda.io/docs/user-guide/tasks/build-packages/define-metadata.html#build-number-and-string) back to 0. + +Feedstock Maintainers +===================== + +* [@bollwyvl](https://github.com/bollwyvl/) +* [@igortg](https://github.com/igortg/) +* [@williamjamir](https://github.com/williamjamir/) + diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..26fc203 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,10 @@ +jobs: + - template: ./.azure-pipelines/azure-pipelines-linux.yml + + + - template: ./.azure-pipelines/azure-pipelines-osx.yml + + + - template: ./.azure-pipelines/azure-pipelines-win.yml + + \ No newline at end of file diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 435ce68..b0c71d2 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,7 +1,6 @@ {% set name = "python-chromedriver-binary" %} {% set version = "2.45.0" %} {% set chromedriver_version = ".".join(version.split(".")[:2]) %} -{% set sha256 = "" %} package: name: {{ name|lower }} @@ -21,7 +20,6 @@ build: number: 1001 script: {{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-cache-dir -vv - requirements: host: - python @@ -30,8 +28,6 @@ requirements: - python test: - requires: - - setuptools imports: - chromedriver_binary commands: From 9eaa71ba088febba5cf5590314429d0937a511d7 Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Sun, 13 Jan 2019 16:45:57 -0500 Subject: [PATCH 03/12] uses pkgresources --- recipe/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index b0c71d2..6188c6b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -26,6 +26,7 @@ requirements: - pip run: - python + - setuptools test: imports: From 7aec4e4161f1e7fd26d1d16244f368439c6748da Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Sun, 13 Jan 2019 17:07:58 -0500 Subject: [PATCH 04/12] try adding x in test --- recipe/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 6188c6b..2171694 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -31,6 +31,7 @@ requirements: test: imports: - chromedriver_binary + - xorg-libx11 # [linux] commands: - chromedriver-path - PATH=$(chromedriver-path) chromedriver --version # [unix] From 50fce1638681985621370c5e2e08ade0286ace26 Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Sun, 13 Jan 2019 17:10:34 -0500 Subject: [PATCH 05/12] fix url --- recipe/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 2171694..6f900eb 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -11,7 +11,7 @@ source: sha256: d39f928d96e9d939dfc19fe8e4c8d18a7fb81f63940ed6a8e2b7263c1d0a7d0d - url: https://chromedriver.storage.googleapis.com/{{ chromedriver_version }}/chromedriver_linux64.zip # [linux] sha256: d4a5eec0a3b7fec9bcb71353233dde38630e51b29fa7b218cdd196e2e4487da7 # [linux] - - url: https://chromedriver.storage.googleapis.com/{{ chromedriver_version }}/chromedriver_max64.zip # [osx] + - url: https://chromedriver.storage.googleapis.com/{{ chromedriver_version }}/chromedriver_mac64.zip # [osx] sha256: aa0f416a48e20185da62525869c1f98f994bf99f241d6ce2eb1af6ceb517c425 # [osx] - url: https://chromedriver.storage.googleapis.com/{{ chromedriver_version }}/chromedriver_win32.zip # [win] sha256: 8f3373a260a524410e25ea643ecb0175ed49a078088c7ab4d88db323ee19a230 # [win] @@ -31,7 +31,7 @@ requirements: test: imports: - chromedriver_binary - - xorg-libx11 # [linux] + - xorg-libx11 # [unix] commands: - chromedriver-path - PATH=$(chromedriver-path) chromedriver --version # [unix] From 18e17771ed40b8098b358524986e8d0f079e104b Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Sun, 13 Jan 2019 17:25:45 -0500 Subject: [PATCH 06/12] move xorg to test requirements --- recipe/meta.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 6f900eb..faa0c95 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -29,9 +29,10 @@ requirements: - setuptools test: + requires: + - xorg-libx11 # [unix] imports: - chromedriver_binary - - xorg-libx11 # [unix] commands: - chromedriver-path - PATH=$(chromedriver-path) chromedriver --version # [unix] From 295f90ff42378e5d44002ec3c9604f0a5e177447 Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Sun, 13 Jan 2019 17:59:30 -0500 Subject: [PATCH 07/12] add glib for testing --- recipe/meta.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index faa0c95..01cf746 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -31,6 +31,7 @@ requirements: test: requires: - xorg-libx11 # [unix] + - glib >=2.14 # [unix] imports: - chromedriver_binary commands: From 0d1df905cfbc421741442f002f06e6c92b08476b Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Sun, 13 Jan 2019 20:06:20 -0500 Subject: [PATCH 08/12] change testing strategy on linux --- recipe/meta.yaml | 9 +++------ recipe/run_test.py | 25 +++++++++++++++++-------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 01cf746..d52657e 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -18,7 +18,9 @@ source: build: number: 1001 - script: {{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-cache-dir -vv + script: + - chmod +x chromedriver #[unix] + - {{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-cache-dir -vv requirements: host: @@ -29,15 +31,10 @@ requirements: - setuptools test: - requires: - - xorg-libx11 # [unix] - - glib >=2.14 # [unix] imports: - chromedriver_binary commands: - chromedriver-path - - PATH=$(chromedriver-path) chromedriver --version # [unix] - - PATH=$(chromedriver-path) chromedriver --help # [unix] about: home: https://github.com/danielkaiser/python-chromedriver-binary diff --git a/recipe/run_test.py b/recipe/run_test.py index 57e5225..b35ba02 100644 --- a/recipe/run_test.py +++ b/recipe/run_test.py @@ -1,17 +1,26 @@ import subprocess import os +import sys -# artificially clear the path -os.environ["PATH"] = "" +# it doesn't appear they do patch releases +CHROMEDRIVER_VERSION = ".".join(os.environ["PKG_VERSION"].split(".")[:2]) # allow side-effects to happen import chromedriver_binary # noqa -# it doesn't appear they do patch releases -CHROMEDRIVER_VERSION = ".".join(os.environ["PKG_VERSION"].split(".")[:2]) +assert "chromedriver" in os.environ["PATH"], os.environ["PATH"] + +if sys.platform.startswith("linux"): + # on conda-forge builds, glibc is too old. just look at the thing. + bin = subprocess.check_output(["which", "chromedriver"]).decode("utf-8").strip() + assert os.access(bin, os.X_OK), "not executable" -# test if the command executes, and capture the output -output = subprocess.check_output(["chromedriver", "--version"]).decode("utf-8") + with open(bin, "rb") as fp: + assert (CHROMEDRIVER_VERSION + ".").encode("utf-8") in fp.read(), \ + "version string doesn't appear" +else: + # test if the command executes, and capture the output + output = subprocess.check_output(["chromedriver", "--version"]).decode("utf-8") -# test that we got a version that matches the upstream -assert output.startswith("ChromeDriver " + CHROMEDRIVER_VERSION), output + # test that we got a version that matches the upstream + assert output.startswith("ChromeDriver " + CHROMEDRIVER_VERSION + "."), output From 4759e53ee28850531e4a664aa7104925cac8e6df Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Sun, 13 Jan 2019 20:06:58 -0500 Subject: [PATCH 09/12] fix perms --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index d52657e..deab900 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -19,7 +19,7 @@ source: build: number: 1001 script: - - chmod +x chromedriver #[unix] + - chmod +x chromedriver # [unix] - {{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-cache-dir -vv requirements: From 79fab494a9147bbfba7e136bf6dd1c74a6f0a931 Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Sun, 13 Jan 2019 20:16:56 -0500 Subject: [PATCH 10/12] appveyor has an older chromedriver --- recipe/run_test.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/recipe/run_test.py b/recipe/run_test.py index b35ba02..7f5557c 100644 --- a/recipe/run_test.py +++ b/recipe/run_test.py @@ -5,22 +5,26 @@ # it doesn't appear they do patch releases CHROMEDRIVER_VERSION = ".".join(os.environ["PKG_VERSION"].split(".")[:2]) -# allow side-effects to happen -import chromedriver_binary # noqa +path = subprocess.check_output(["chromedriver-path"]) -assert "chromedriver" in os.environ["PATH"], os.environ["PATH"] if sys.platform.startswith("linux"): # on conda-forge builds, glibc is too old. just look at the thing. - bin = subprocess.check_output(["which", "chromedriver"]).decode("utf-8").strip() + bin = subprocess.check_output( + ["which", "chromedriver"], env=dict(PATH=path) + ).decode("utf-8").strip() assert os.access(bin, os.X_OK), "not executable" with open(bin, "rb") as fp: assert (CHROMEDRIVER_VERSION + ".").encode("utf-8") in fp.read(), \ - "version string doesn't appear" + "version string doesn't appear in " + bin else: # test if the command executes, and capture the output - output = subprocess.check_output(["chromedriver", "--version"]).decode("utf-8") + output = subprocess.check_output( + ["chromedriver", "--version"], + env=dict(PATH=path) + ).decode("utf-8") # test that we got a version that matches the upstream - assert output.startswith("ChromeDriver " + CHROMEDRIVER_VERSION + "."), output + assert output.startswith("ChromeDriver " + CHROMEDRIVER_VERSION + "."), \ + "version string doesn't appear in " + output From 0fec136cb172b96a909313e0cebd714a7bceb8e1 Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Sun, 13 Jan 2019 20:23:15 -0500 Subject: [PATCH 11/12] move side-effect test to end --- recipe/run_test.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/recipe/run_test.py b/recipe/run_test.py index 7f5557c..9ea7b31 100644 --- a/recipe/run_test.py +++ b/recipe/run_test.py @@ -5,19 +5,21 @@ # it doesn't appear they do patch releases CHROMEDRIVER_VERSION = ".".join(os.environ["PKG_VERSION"].split(".")[:2]) -path = subprocess.check_output(["chromedriver-path"]) +path = subprocess.check_output(["chromedriver-path"]).decode("utf-8").strip() if sys.platform.startswith("linux"): # on conda-forge builds, glibc is too old. just look at the thing. bin = subprocess.check_output( - ["which", "chromedriver"], env=dict(PATH=path) + ["which", "chromedriver"], env=dict(PATH=os.pathsep.join([ + path, os.environ["PATH"] + ])) ).decode("utf-8").strip() assert os.access(bin, os.X_OK), "not executable" with open(bin, "rb") as fp: assert (CHROMEDRIVER_VERSION + ".").encode("utf-8") in fp.read(), \ - "version string doesn't appear in " + bin + "version string doesn't appear in content of: " + bin else: # test if the command executes, and capture the output output = subprocess.check_output( @@ -27,4 +29,10 @@ # test that we got a version that matches the upstream assert output.startswith("ChromeDriver " + CHROMEDRIVER_VERSION + "."), \ - "version string doesn't appear in " + output + "version string doesn't appear in: " + output + +# finally test weird $PATH side-effect behavior +os.environ["PATH"] = "" +import chromedriver_binary # noqa +assert path in os.environ["PATH"], \ + "Path didn't get installed by side-effect: " + os.environ["PATH"] From 5477451a58d4aef4f2b1fa76b961eafa2854d8c5 Mon Sep 17 00:00:00 2001 From: Nicholas Bollweg Date: Sun, 13 Jan 2019 21:16:46 -0500 Subject: [PATCH 12/12] more path/string work --- recipe/run_test.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/recipe/run_test.py b/recipe/run_test.py index 9ea7b31..258089c 100644 --- a/recipe/run_test.py +++ b/recipe/run_test.py @@ -5,7 +5,9 @@ # it doesn't appear they do patch releases CHROMEDRIVER_VERSION = ".".join(os.environ["PKG_VERSION"].split(".")[:2]) -path = subprocess.check_output(["chromedriver-path"]).decode("utf-8").strip() +path = str( + subprocess.check_output(["chromedriver-path"]).decode("utf-8").strip() +) if sys.platform.startswith("linux"): @@ -21,14 +23,16 @@ assert (CHROMEDRIVER_VERSION + ".").encode("utf-8") in fp.read(), \ "version string doesn't appear in content of: " + bin else: + bin = os.path.join(path, "chromedriver") + + if sys.platform == "win32": + bin += ".exe" + # test if the command executes, and capture the output - output = subprocess.check_output( - ["chromedriver", "--version"], - env=dict(PATH=path) - ).decode("utf-8") + output = subprocess.check_output([bin, "--version"]).decode("utf-8") # test that we got a version that matches the upstream - assert output.startswith("ChromeDriver " + CHROMEDRIVER_VERSION + "."), \ + assert (("ChromeDriver " + CHROMEDRIVER_VERSION + ".") in output), \ "version string doesn't appear in: " + output # finally test weird $PATH side-effect behavior