Skip to content

Commit 8f3d0b4

Browse files
authored
Merge pull request #2024 from apache/build_release_artifact_ci_job
Add new CI job which builds the release artifact, remove MANIFEST.in
2 parents 11a20e6 + 8546be9 commit 8f3d0b4

File tree

9 files changed

+133
-32
lines changed

9 files changed

+133
-32
lines changed

.github/workflows/main.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,83 @@ jobs:
170170
run: |
171171
tox -e black-check,isort-check,pyupgrade,checks,import-timings,lint,pylint,mypy
172172
173+
build_test_release_artifact:
174+
name: Build and Test Release Artifact
175+
runs-on: ubuntu-latest
176+
177+
strategy:
178+
matrix:
179+
python_version: [3.9]
180+
181+
steps:
182+
- uses: actions/checkout@master
183+
with:
184+
fetch-depth: 1
185+
186+
- name: Use Python ${{ matrix.python_version }}
187+
uses: actions/setup-python@v5
188+
with:
189+
python-version: ${{ matrix.python_version }}
190+
191+
- name: Cache Python Dependencies
192+
uses: actions/cache@v4
193+
with:
194+
path: ~/.cache/pip
195+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-lint.txt') }}
196+
restore-keys: |
197+
${{ runner.os }}-pip-
198+
199+
- name: Install Python Dependencies
200+
run: |
201+
pip install -r requirements-ci.txt
202+
pip install "build==1.2.2"
203+
204+
- name: Build Release Artifact
205+
run: |
206+
pip list installed
207+
python -m build -vv
208+
209+
- name: Set Environment
210+
run: |
211+
export PYTHONPATH=.
212+
export VERSION=$(python -c "import libcloud ; print(libcloud.__version__)")
213+
echo "VERSION=${VERSION}" >> "$GITHUB_ENV"
214+
215+
- name: Verify Tarball Release Artifact
216+
run: |
217+
# Verify tarball file exists
218+
export TARBALL_FILENAME="apache_libcloud-${VERSION}.tar.gz"
219+
220+
ls -la "dist/${TARBALL_FILENAME}"
221+
222+
cd dist/
223+
224+
# Unpack tarball and verify + run the tests
225+
tar -xzvf "${TARBALL_FILENAME}"
226+
227+
cd "apache_libcloud-${VERSION}/"
228+
tox -c tox.ini -epy3.9
229+
230+
- name: Verify Wheel Release Artifact
231+
run: |
232+
# Verify wheel file exists
233+
export WHEEL_FILENAME="apache_libcloud-${VERSION}-py3-none-any.whl"
234+
235+
ls -la "dist/${WHEEL_FILENAME}"
236+
237+
cd dist/
238+
239+
# Unpack wheel and verify + run tests
240+
unzip "${WHEEL_FILENAME}" -d "wheel"
241+
cd wheel
242+
243+
# Since wheel doesn't include those files, we need to manually copy them over from
244+
# repo root so we can run the tests
245+
cp ../../tox.ini .
246+
cp ../../requirements-tests.txt .
247+
cp ../../libcloud/test/secrets.py-dist libcloud/test/secrets.py-dist
248+
tox -c tox.ini -epy3.9
249+
173250
build_test_docker_image:
174251
name: Build and Verify Docker Image
175252
runs-on: ubuntu-latest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ coverage.xml
1515
.idea
1616
dist/*apache-libcloud*
1717
dist/*apache_libcloud*
18+
dist/wheel
1819
docs/apidocs/*
1920
_build/
2021
apache_libcloud.egg-info/

CHANGES.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ Changes in Apache Libcloud 3.9.0
77
Common
88
~~~~~~
99

10+
- Unused ``setup.py`` file has been removed. The project has switched
11+
to ``pyproject.toml`` a while ago and unused file has been removed to
12+
reduce potential confusion.
13+
(#2024)
14+
[Tomaz Muraus - @Kami]
15+
1016
- Indicate we also support Python 3.12 (non beta) and Python 3.13.
1117
(#2050)
1218
[Tomaz Muraus - @Kami]
@@ -36,6 +42,16 @@ Common
3642
(#1940)
3743
[@munahaf on behalf of OpenRefactory and Open Source Security Foundation]
3844

45+
- Update versions of build and packaging tools required to build the package.
46+
47+
Per report from Rui Chen (@chenrui333) ansible homebrew package which
48+
depends on libcloud was failing to build with Libcloud 3.8.0.
49+
50+
Special thanks to Rui Chen for their assistance with troubleshooting the issue
51+
and testing v3.9.0 release candidate.
52+
(#2047)
53+
[Tomaz Muraus - @Kami, Rui Chen - @chenrui333]
54+
3955
Compute
4056
~~~~~~~
4157

MANIFEST.in

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
# NOTE: We still need to use MANIFEST.in for backward compatibility with past
2+
# distributions since pyproject.toml + setuptools backend doesn't support
3+
# as flexible includes and excludes as we need.
14
global-exclude *.py[cod]
25
global-exclude .pytest_cache
6+
7+
# Include common files at the repository root
38
include LICENSE
49
include NOTICE
510
include example_*.py
@@ -23,3 +28,16 @@ prune docs/
2328
prune demos/
2429
prune integration/
2530
prune pylint_plugins/
31+
prune __pycache__
32+
33+
# Recursively include all files under the fixture directories
34+
recursive-include libcloud/test/backup/fixtures *
35+
recursive-include libcloud/test/common/fixtures *
36+
recursive-include libcloud/test/compute/fixtures *
37+
recursive-include libcloud/test/container/fixtures *
38+
recursive-include libcloud/test/dns/fixtures *
39+
recursive-include libcloud/test/loadbalancer/fixtures *
40+
recursive-include libcloud/test/storage/fixtures *
41+
42+
# Exclude __pycache__ directories
43+
prune **/__pycache__

dist/deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pushd "${SCRIPT_DIR}/../"
2121

2222
# We redirect stderr to /dev/null since sometimes setuptools may print pyproject
2323
# related warning
24-
VERSION=$(python setup.py --version 2> /dev/null)
24+
VERSION=$(grep -Po '(?<=^__version__ = ")[^"]+' libcloud/__init__.py)
2525
popd
2626

2727
pushd "${SCRIPT_DIR}"

dist/verify_checksums.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ TMP_DIR=$(mktemp -d)
3030
# TODO: Use json endpoint + jq to parse out the url
3131
# https://pypi.org/pypi/apache-libcloud/3.4.0/json
3232
EXTENSIONS[0]=".tar.gz"
33-
EXTENSIONS[1]="-py2.py3-none-any.whl"
33+
EXTENSIONS[1]="-py3-none-any.whl"
3434

3535
APACHE_MIRROR_URL="http://www.apache.org/dist/libcloud"
3636
PYPI_MIRROR_URL_SOURCE="https://pypi.python.org/packages/source/a/apache-libcloud"
37-
PYPI_MIRROR_URL_WHEEL="https://files.pythonhosted.org/packages/py2.py3/a/apache-libcloud"
37+
PYPI_MIRROR_URL_WHEEL="https://files.pythonhosted.org/packages/py3/a/apache-libcloud"
3838

3939
# From http://tldp.org/LDP/abs/html/debugging.html#ASSERT
4040
function assert () # If condition false,
@@ -69,15 +69,15 @@ do
6969
extension=${EXTENSIONS[$i]}
7070
file_name="${VERSION}${extension}"
7171

72-
if [ "${extension}" = "-py2.py3-none-any.whl" ]; then
72+
if [ "${extension}" = "-py3-none-any.whl" ]; then
7373
# shellcheck disable=SC2001
7474
file_name=$(echo "${file_name}" | sed "s/apache-libcloud/apache_libcloud/g")
7575
fi
7676

7777
apache_url="${APACHE_MIRROR_URL}/${file_name}"
7878
pypi_url="${PYPI_MIRROR_URL}/${file_name}"
7979

80-
if [ "${extension}" = "-py2.py3-none-any.whl" ]; then
80+
if [ "${extension}" = "-py3-none-any.whl" ]; then
8181
pypi_url="${PYPI_MIRROR_URL_WHEEL}/${file_name}"
8282
else
8383
pypi_url="${PYPI_MIRROR_URL_SOURCE}/${file_name}"

docs/testing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ To generate the test coverage run the following command:
7777

7878
.. sourcecode:: bash
7979

80-
PYTHONPATH=. python setup.py coverage
80+
tox -e coverage_html_report
8181

8282
When it completes you should see a new ``coverage_html_report`` directory which
8383
contains the test coverage.

pyproject.toml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Changelog = "https://github.com/apache/libcloud/blob/trunk/CHANGES.rst"
7474

7575
[project.optional-dependencies]
7676
build = [
77-
"build==1.2.1"
77+
"build==1.2.2"
7878
]
7979
publish = [
8080
"twine==5.1.1"
@@ -89,9 +89,20 @@ where = ["./"]
8989
include = ["libcloud", "libcloud.test*", "libcloud.*" ]
9090

9191
[tool.setuptools.package-data]
92-
"*" = ["*.json", "*.xml", "*.pub", "*.key", "*.pem", "*.crt", "*.csv", "*.txt", "*.html"]
93-
"libcloud.test.compute.fixtures.misc" = ["*"]
94-
"libcloud.test.dns.fixtures.worldwidedns" = ["*"]
92+
"libcloud.data" = [
93+
"pricing.json"
94+
]
95+
"libcloud.test" = [
96+
"**/*.json",
97+
"**/*.xml",
98+
"**/*.pub",
99+
"**/*.key",
100+
"**/*.pem",
101+
"**/*.crt",
102+
"**/*.csv",
103+
"**/*.txt",
104+
"**/*.html",
105+
]
95106

96107
[tool.setuptools]
97108
include-package-data = true
@@ -102,7 +113,6 @@ version = {attr = "libcloud.__version__"}
102113
readme = {file = ["README.rst"], content-type = "text/x-rst"}
103114

104115
[tool.distutils.bdist_wheel]
105-
universal = true
106116

107117

108118
[tool.black]

setup.py

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

0 commit comments

Comments
 (0)