Skip to content

Commit

Permalink
Start building packages on Windows
Browse files Browse the repository at this point in the history
- Prepend C:\cygwin64\bin to PATH
- Prepend C:\Users\appveyor\AppData\Roaming\Python\Python36\Scripts
  to PATH (for wheel.exe)
- unpack wheel packages instead of using unzip -t b/c in AppVeyor
  cygwin64 doesn't have unzip and the one which is in PATH fails
- Use the default Python executable when building venvs for testing
- Replace "bin/activate" with "Scripts/activate" via sed
- Remove "pip install kerberos" b/c winkerberos ships both Source and
  Whell packages
- Start keeping the built artifacts on AppVeyor
  • Loading branch information
atodorov committed Mar 22, 2020
1 parent cccc771 commit 0c85f39
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
18 changes: 13 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,29 @@ environment:
PYTHON: "C:\\Python36-x64"

matrix:
- MAKE: build
- MAKE: flake8
- MAKE: pylint
- MAKE: test

install:
# Prepend Python to the PATH of this build (this cannot be
# done from inside the powershell script as it would require to restart
# the parent CMD process).
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
# Prepend Python to the PATH of this build (this cannot be done from inside
# the powershell script as it would require to restart the parent CMD process).
# cygwin64\bin contains all commands used by 'make build'
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;C:\\Users\\appveyor\\AppData\\Roaming\\Python\\Python36\\Scripts;C:\\cygwin64\\bin;%PATH%"

- "python --version"
- "python -m pip install --disable-pip-version-check --user --upgrade pip wheel"
- "python -m pip install coverage pylint flake8 twine winkerberos requests"

build: off

artifacts:
- path: 'dist\tcms*'
name: Python packages
type: file

test_script:
- "C:\\cygwin64\\bin\\make %MAKE%"
- 'sed -i "s|bin/activate|Scripts/activate|" tests/check-build'
- 'sed -i "s|pip install kerberos||" tests/check-build'
- "make %MAKE%"
9 changes: 6 additions & 3 deletions tests/check-build
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ if [ "$matched_files" -gt "0" ]; then
echo "ERROR: .pyc files found in .tar.gz package"
exit 1
fi
matched_files=`unzip -t dist/tcms_api*.whl | grep -c "\.pyc"`
WHEEL_UNPACK_DIR=`mktemp -d`
wheel unpack --dest "$WHEEL_UNPACK_DIR" dist/tcms_api*.whl
matched_files=`find "$WHEEL_UNPACK_DIR" -type f | grep -c "\.pyc"`
rm -rf "$WHEEL_UNPACK_DIR"
if [ "$matched_files" -gt "0" ]; then
echo "ERROR: .pyc files found in wheel package"
exit 1
Expand All @@ -40,7 +43,7 @@ fi
set -e

echo "..... Trying to install the new tarball inside a virtualenv"
virtualenv -q -p $(which python) .venv/test-tarball
virtualenv -q .venv/test-tarball
source .venv/test-tarball/bin/activate
pip install --upgrade setuptools pip
pip install --no-binary :all: -f dist/ tcms-api
Expand All @@ -49,7 +52,7 @@ deactivate
rm -rf .venv/

echo "..... Trying to install the new wheel inside a virtualenv"
virtualenv -q -p $(which python) .venv/test-wheel
virtualenv -q .venv/test-wheel
source .venv/test-wheel/bin/activate
pip install --upgrade setuptools pip
pip install kerberos
Expand Down

0 comments on commit 0c85f39

Please sign in to comment.