Skip to content

Commit

Permalink
Merge pull request #1433 from timkpaine/cisdist
Browse files Browse the repository at this point in the history
add some light sdist tests and upload sdist in CI
  • Loading branch information
texodus authored Sep 21, 2021
2 parents 5a6d0cf + 458963b commit 980ed2d
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
31 changes: 31 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,20 @@ parameters:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/*coverage.xml'

- name: pythonSDistSteps
type: stepList
default:
# Build a python sdist
- bash: export SDIST_PUBLISH_NAME=perspective-python-$(Build.SourceBranchName)-$(Build.BuildId).tar.gz && cd $(System.DefaultWorkingDirectory)/python/perspective && ./scripts/build_sdist.sh
displayName: 'Build sdist'


# Save the artifact to Azure storage
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(System.DefaultWorkingDirectory)/python/perspective/dist/'
artifactName: 'perspective-python-$(Build.SourceBranchName)-$(Build.BuildId)'

- name: pythonMacWheelSteps
type: stepList
default:
Expand Down Expand Up @@ -339,6 +353,23 @@ jobs:
- ${{ parameters.pythonCoverageSteps }}
- ${{ parameters.pythonLinuxWheelSteps }}

- job: 'Linux_Python_SDist'
pool:
vmImage: 'ubuntu-18.04'

strategy:
matrix:
Python37:
python.version: '3.7'
python_flag: ''

steps:
- ${{ parameters.initSteps }}
- ${{ parameters.linuxInitSteps }}
- ${{ parameters.pythonBuildSteps }}
- ${{ parameters.pythonSDistSteps }}


- job: 'Windows'
pool:
vmImage: 'vs2017-win2016'
Expand Down
42 changes: 42 additions & 0 deletions python/perspective/scripts/build_sdist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
#
# Copyright (c) 2021, the Perspective Authors.
#
# This file is part of the Perspective library, distributed under the terms of
# the Apache License 2.0. The full license can be found in the LICENSE file.
set -e

SDIST_NAME=perspective-python
SDIST_VERSION=`git describe --abbrev=0 --tags | cut -c2-`
SDIST_FULL_NAME=$SDIST_NAME-$SDIST_VERSION
SDIST_FULL_NAME_TAR=$SDIST_FULL_NAME.tar.gz

# Remove build assets
rm -rf perspective/table/*.{so,dll}

# Run sdist
echo "-----------------------"
echo "Building sdist"

python3 setup.py sdist

# Extract the sdist
echo "-----------------------"
echo "Extracting built sdist"

mkdir tmp && tar xfzv ./dist/$SDIST_FULL_NAME_TAR -C ./tmp

# build the sdisted assets
echo "-----------------------"
echo "Building extracted sdist"

cd tmp/$SDIST_FULL_NAME && python3 setup.py build

# try to import the libs
echo "-----------------------"
echo "Testing sdist-built assets"

python3 -c "import perspective;print(perspective.is_libpsp())"

echo "-----------------------"
echo "Done.."
2 changes: 2 additions & 0 deletions python/perspective/scripts/test_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#
# This file is part of the Perspective library, distributed under the terms of
# the Apache License 2.0. The full license can be found in the LICENSE file.
set -e

#
# Creates a new virtual environment and installs Perspective from a wheel,
# testing whether C++ bindings are imported properly.
Expand Down

0 comments on commit 980ed2d

Please sign in to comment.