Skip to content

Commit

Permalink
Add CI for testable sdist & augment MANIFEST.in
Browse files Browse the repository at this point in the history
  • Loading branch information
bskinn committed Oct 1, 2023
1 parent 0e423a5 commit 7d2bfa5
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 1 deletion.
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
include LICENSE.txt README.rst CHANGELOG.md pyproject.toml
include AUTHORS.md LICENSE.txt README.rst CHANGELOG.md pyproject.toml
include requirements-dev.txt requirements-flake8.txt tox.ini
2 changes: 2 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
spec: '3.11'
platforms: [linux, windows, macOs]

- template: azure-sdisttest.yml

- job: flake8
pool:
vmImage: 'Ubuntu-latest'
Expand Down
73 changes: 73 additions & 0 deletions azure-sdisttest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
jobs:
- job: testable_sdist
displayName: Ensure sdist is testable

variables:
pip_cache_dir: $(Pipeline.Workspace)/.pip

pool:
vmImage: 'Ubuntu-latest'

steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.10'

- task: Cache@2
inputs:
key: 'pip | "$(Agent.OS)" | requirements-dev.txt | requirements-flake8.txt'
restoreKeys: |
pip | "$(Agent.OS)"
path: $(pip_cache_dir)
displayName: Cache pip

- script: python -m pip install build
displayName: Install 'build' package

- script: |
python -m build -s
ls -lah dist
displayName: Build sdist
- script: |
mkdir sandbox
displayName: Create sandbox
- script: |
cp dist/*.gz sandbox/
cd sandbox
tar xvf *.gz
displayName: Unpack sdist in sandbox
- script: |
cd sandbox
python -m venv env
displayName: Create venv
# Only the dir of the unpacked sdist will have a digit in its name
- script: |
cd sandbox
echo $( find . -maxdepth 1 -type d -regex "./.+[0-9].+" )
displayName: Check unpack dir name
- script: |
cd sandbox
source env/bin/activate
cd $( find . -maxdepth 1 -type d -regex "./.+[0-9].+" )
python -m pip install -r requirements-dev.txt
displayName: Install dev req'ts to venv
- script: |
cd sandbox
source env/bin/activate
cd $( find . -maxdepth 1 -type d -regex "./.+[0-9].+" )
cd doc
O=-Ean make html
displayName: Build docs in sandbox
- script: |
cd sandbox
source env/bin/activate
cd $( find . -maxdepth 1 -type d -regex "./.+[0-9].+" )
pytest --nonloc
displayName: Run test suite in sandbox

0 comments on commit 7d2bfa5

Please sign in to comment.