Skip to content

Commit 49594ba

Browse files
authored
Build sdist in CI (#388)
* first stab at building source distribution in CI pipeline * update manifest to include necessary files * bump ubuntu version to 18.04, remove temporary sdist testing * add python 3.9 line
1 parent bb4b26b commit 49594ba

3 files changed

Lines changed: 43 additions & 11 deletions

File tree

MANIFEST.in

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
recursive-include _cffi_build *
2-
31
# Remove CFFI files
42
global-exclude __pycache__/*
53

64
# Include Cython code
75
global-include *.pyx
86
global-include *.pxd
97
include anonlink/solving/_multiparty_solving_inner.h
10-
include _cffi_build/libpopcount.h
8+
include anonlink/similarities/libpopcount.h
119
include anonlink/_entitymatcher*
10+
include anonlink/similarities/dice.cpp

azurePipeline.yml

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
trigger:
2+
branches:
3+
include:
4+
- '*'
5+
tags:
6+
include:
7+
- v*
8+
19
stages:
210
- stage: wheels
311
displayName: Build Wheel Packages
@@ -11,7 +19,7 @@ stages:
1119
- job: linux_39
1220
displayName: Linux + Python3.9
1321
pool:
14-
vmImage: 'ubuntu-16.04'
22+
vmImage: 'ubuntu-18.04'
1523
variables:
1624
CIBW_BUILD: 'cp39-*'
1725
steps:
@@ -20,7 +28,7 @@ stages:
2028
- job: linux_38
2129
displayName: Linux + Python3.8
2230
pool:
23-
vmImage: 'ubuntu-16.04'
31+
vmImage: 'ubuntu-18.04'
2432
variables:
2533
CIBW_BUILD: 'cp38-*'
2634
steps:
@@ -29,7 +37,7 @@ stages:
2937
- job: linux_37
3038
displayName: Linux + Python3.7
3139
pool:
32-
vmImage: 'ubuntu-16.04'
40+
vmImage: 'ubuntu-18.04'
3341
variables:
3442
CIBW_BUILD: 'cp37-*'
3543
steps:
@@ -38,7 +46,7 @@ stages:
3846
- job: linux_36
3947
displayName: Linux + Python3.6
4048
pool:
41-
vmImage: 'ubuntu-16.04'
49+
vmImage: 'ubuntu-18.04'
4250
variables:
4351
CIBW_BUILD: 'cp36-*'
4452
steps:
@@ -67,14 +75,37 @@ stages:
6775
- {task: UsePythonVersion@0, inputs: {versionSpec: '3.9', architecture: x64}}
6876
- template: .azurePipeline/cibuildwheel_steps.yml
6977

78+
- stage: sdist
79+
displayName: Build source distribution
80+
dependsOn: []
81+
jobs:
82+
- job: sdist
83+
displayName: build source distribution
84+
pool:
85+
vmImage: 'ubuntu-18.04'
86+
steps:
87+
- task: UsePythonVersion@0
88+
inputs:
89+
versionSpec: '3.9'
90+
- script: |
91+
python setup.py sdist
92+
displayName: 'Artifact creation'
93+
- task: CopyFiles@2
94+
inputs:
95+
targetFolder: 'sdist'
96+
- task: PublishBuildArtifacts@1
97+
inputs:
98+
PathtoPublish: 'sdist/dist'
99+
ArtifactName: 'drop'
100+
70101
- stage: test
71102
displayName: Unit tests
72103
dependsOn: ['wheels']
73104
jobs:
74105
- job:
75106
displayName: Linux
76107
pool:
77-
vmImage: 'ubuntu-16.04'
108+
vmImage: 'ubuntu-18.04'
78109
strategy:
79110
matrix:
80111
Python3.6:
@@ -94,7 +125,7 @@ stages:
94125
parameters:
95126
artifactName: $(artifactName)
96127
pythonVersion: $(pythonVersion)
97-
operatingSystem: 'ubuntu-16.04'
128+
operatingSystem: 'ubuntu-18.04'
98129
- job:
99130
displayName: MacOS
100131
pool:
@@ -157,7 +188,7 @@ stages:
157188
- job:
158189
displayName: Typecheck
159190
pool:
160-
vmImage: 'ubuntu-16.04'
191+
vmImage: 'ubuntu-18.04'
161192
steps:
162193
- task: UsePythonVersion@0
163194
inputs:
@@ -183,11 +214,12 @@ stages:
183214
- task: DownloadPipelineArtifact@2
184215
inputs:
185216
artifactName: 'drop'
186-
patterns: '**/*.whl'
217+
patterns: '**/*.(whl|tar.gz)'
187218
path: $(Pipeline.Workspace)
188219
- task: TwineAuthenticate@1
189220
inputs:
190221
artifactFeed: $(artifactFeed)
191222
- script: 'echo $(Build.Repository.Name)'
192223
- script: 'echo $(Build.SourceBranchName)'
193224
- script: 'twine upload -r $(artifactFeed) --config-file $(PYPIRC_PATH) $(Pipeline.Workspace)/*.whl --skip-existing'
225+
- script: 'twine upload -r $(artifactFeed) --config-file $(PYPIRC_PATH) $(Pipeline.Workspace)/*.tar.gz --skip-existing'

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
"Programming Language :: Python :: 3.6",
100100
"Programming Language :: Python :: 3.7",
101101
"Programming Language :: Python :: 3.8",
102+
"Programming Language :: Python :: 3.9",
102103
"Programming Language :: Python :: Implementation :: CPython",
103104
"Topic :: Scientific/Engineering :: Information Analysis",
104105
"Topic :: Security :: Cryptography",

0 commit comments

Comments
 (0)