Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new CI job which builds the release artifact, remove MANIFEST.in #2024

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,83 @@ jobs:
run: |
tox -e black-check,isort-check,pyupgrade,checks,import-timings,lint,pylint,mypy

build_test_release_artifact:
name: Build and Test Release Artifact
runs-on: ubuntu-latest

strategy:
matrix:
python_version: [3.8]

steps:
- uses: actions/checkout@master
with:
fetch-depth: 1

- name: Use Python ${{ matrix.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}

- name: Cache Python Dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-lint.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install Python Dependencies
run: |
pip install -r requirements-ci.txt
pip install -e ".[build]"

- name: Build Release Artifact
run: |
pip list installed
python -m build -vv

- name: Set Environment
run: |
export PYTHONPATH=.
export VERSION=$(python -c "import libcloud ; print(libcloud.__version__)")
echo "VERSION=${VERSION}" >> "$GITHUB_ENV"

- name: Verify Tarball Release Artifact
run: |
# Verify tarball file exists
export TARBALL_FILENAME="apache_libcloud-${VERSION}.tar.gz"

ls -la "dist/${TARBALL_FILENAME}"

cd dist/

# Unpack tarball and verify + run the tests
tar -xzvf "${TARBALL_FILENAME}"

cd "apache_libcloud-${VERSION}/"
tox -epy3.8

- name: Verify Wheel Release Artifact
run: |
# Verify wheel file exists
export WHEEL_FILENAME="apache_libcloud-${VERSION}-py2.py3-none-any.whl"

ls -la "dist/${WHEEL_FILENAME}"

cd dist/

# Unpack wheel and verify + run tests
unzip "${WHEEL_FILENAME}" -d "wheel"
cd wheel

# Since wheel doesn't include those files, we need to manually copy them over from
# repo root so we can run the tests
cp ../../tox.ini .
cp ../../requirements-tests.txt .
cp ../../libcloud/test/secrets.py-dist libcloud/test/secrets.py
tox -epy3.8

build_test_docker_image:
name: Build and Verify Docker Image
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ coverage.xml
.idea
dist/*apache-libcloud*
dist/*apache_libcloud*
dist/wheel
docs/apidocs/*
_build/
apache_libcloud.egg-info/
Expand Down
25 changes: 0 additions & 25 deletions MANIFEST.in

This file was deleted.

32 changes: 29 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,37 @@ test = [
]

[tool.setuptools.packages.find]
where = ["./"]
include = ["libcloud", "libcloud.test*" ]
include = ["libcloud"]
namespaces = false

[tool.setuptools.package-data]
"*" = ["*.json", "*.xml", "*.pub", "*.key", "*.pem", "*.crt", "*.csv", "*.txt", "*.html"]
"*" = [
"LICENSE",
"NOTICE",
"example*.py",
"CHANGES.rst",
"README.rst",
"tox.ini",
"pyproject.toml",
"requirements-tests.txt",
"requirements-lint.txt",
"libcloud/test/secrets.py-dist",
"demos/*"
]
"libcloud.data" = [
"pricing.json"
]
"libcloud.test" = [
"*.json",
"*.xml",
"*.pub",
"*.key",
"*.pem",
"*.crt",
"*.csv",
"*.txt",
"*.html"
]
"libcloud.test.compute.fixtures.misc" = ["*"]
"libcloud.test.dns.fixtures.worldwidedns" = ["*"]

Expand Down
Loading