Skip to content

Commit f165cde

Browse files
committed
Add new CI job which build the release artifact (tarball, wheel) and
verifies it works (unpacks the tarball, runs tests).
1 parent 1ebd605 commit f165cde

File tree

2 files changed

+57
-3
lines changed

2 files changed

+57
-3
lines changed

.github/workflows/main.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,60 @@ jobs:
201201
run: |
202202
tox -e black-check,isort-check,pyupgrade,checks,import-timings,lint,pylint,mypy
203203
204+
build_test_release_artifact:
205+
name: Build and Test Release Artifact
206+
runs-on: ubuntu-latest
207+
208+
strategy:
209+
matrix:
210+
python_version: [3.8]
211+
212+
steps:
213+
- uses: actions/checkout@master
214+
with:
215+
fetch-depth: 1
216+
217+
- name: Use Python ${{ matrix.python_version }}
218+
uses: actions/setup-python@v5
219+
with:
220+
python-version: ${{ matrix.python_version }}
221+
222+
- name: Cache Python Dependencies
223+
uses: actions/cache@v4
224+
with:
225+
path: ~/.cache/pip
226+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-lint.txt') }}
227+
restore-keys: |
228+
${{ runner.os }}-pip-
229+
230+
- name: Install Python Dependencies
231+
run: |
232+
pip install -r requirements-ci.txt
233+
pip install -e ".[build]"
234+
235+
- name: Build Release Artifact
236+
run: |
237+
python -m build -vv
238+
239+
- name: Verify Release Artifact
240+
run: |
241+
export PYTHONPATH=.
242+
export VERSION=$(python -c "import libcloud ; print(libcloud.__version__)")
243+
unset PYTHONPATH
244+
245+
# Verify tarball + wheel file exists
246+
export TARBALL_FILENAME="apache_libcloud-${VERSION}.tar.gz"
247+
248+
ls -la "dist/${TARBALL_FILENAME}"
249+
ls -la "dist/apache_libcloud-${VERSION}-py2.py3-none-any.whl"
250+
251+
# Unpack tarball and run the tests
252+
cd dist/
253+
tar -xzvf "${TARBALL_FILENAME}"
254+
255+
cd "apache_libcloud-${VERSION}/"
256+
tox -epy3.8
257+
204258
build_test_docker_image:
205259
name: Build and Verify Docker Image
206260
runs-on: ubuntu-latest

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,16 @@ test = [
8585
]
8686

8787
[tool.setuptools.packages.find]
88-
where = ["./"]
89-
include = ["libcloud", "libcloud.test*" ]
88+
include = ["libcloud"]
89+
namespaces = false
9090

9191
[tool.setuptools.package-data]
9292
"*" = ["*.json", "*.xml", "*.pub", "*.key", "*.pem", "*.crt", "*.csv", "*.txt", "*.html"]
9393
"libcloud.test.compute.fixtures.misc" = ["*"]
9494
"libcloud.test.dns.fixtures.worldwidedns" = ["*"]
9595

9696
[tool.setuptools]
97-
include-package-data = true
97+
include-package-data = false
9898
exclude-package-data = { "*" = ["secrets.py"], "libcloud.test" = ["secrets.py"] }
9999

100100
[tool.setuptools.dynamic]

0 commit comments

Comments
 (0)