Skip to content

Commit 0b1830a

Browse files
committed
Add new CI job which build the release artifact (tarball, wheel) and
verifies it works (unpacks the tarball, runs tests). Also remove MANIFEST.in in favor or include rules declared in pyproject.toml.
1 parent 1ebd605 commit 0b1830a

File tree

3 files changed

+83
-28
lines changed

3 files changed

+83
-28
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

MANIFEST.in

Lines changed: 0 additions & 25 deletions
This file was deleted.

pyproject.toml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,37 @@ 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]
92-
"*" = ["*.json", "*.xml", "*.pub", "*.key", "*.pem", "*.crt", "*.csv", "*.txt", "*.html"]
92+
"*" = [
93+
"LICENSE",
94+
"NOTICE",
95+
"example*.py",
96+
"CHANGES.rst",
97+
"README.rst",
98+
"tox.ini",
99+
"pyproject.toml",
100+
"requirements-tests.txt",
101+
"requirements-lint.txt",
102+
"libcloud/test/secrets.py-dist",
103+
"demos/*"
104+
]
105+
"libcloud.data" = [
106+
"pricing.json"
107+
]
108+
"libcloud.test" = [
109+
"*.json",
110+
"*.xml",
111+
"*.pub",
112+
"*.key",
113+
"*.pem",
114+
"*.crt",
115+
"*.csv",
116+
"*.txt",
117+
"*.html"
118+
]
93119
"libcloud.test.compute.fixtures.misc" = ["*"]
94120
"libcloud.test.dns.fixtures.worldwidedns" = ["*"]
95121

0 commit comments

Comments
 (0)