diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0a46cf3157..9a01cd5a96 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -201,6 +201,81 @@ 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: | + python -m build -vv + + - name: Set Environment + run: | + export PYTHONPATH=. + export VERSION=$(python -c "import libcloud ; print(libcloud.__version__)") + unset PYTHONPATH + + - 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 . + tox -epy3.8 + build_test_docker_image: name: Build and Verify Docker Image runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index 9f79c16590..62e23cfe49 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ coverage.xml .idea dist/*apache-libcloud* dist/*apache_libcloud* +dist/wheel docs/apidocs/* _build/ apache_libcloud.egg-info/ diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 67421d7f94..0000000000 --- a/MANIFEST.in +++ /dev/null @@ -1,25 +0,0 @@ -global-exclude *.py[cod] -global-exclude .pytest_cache -include LICENSE -include NOTICE -include example_*.py -include CHANGES.rst -include README.rst -include tox.ini -include pyproject.toml -include requirements-tests.txt -include requirements-lint.txt -include libcloud/data/pricing.json -include libcloud/test/secrets.py-dist -include demos/* -include scripts/check_file_names.sh -recursive-exclude libcloud/test secrets.py -prune libcloud/test/secrets.py -prune requirements-rtd.txt -prune dist -prune build -prune contrib/ -prune docs/ -prune demos/ -prune integration/ -prune pylint_plugins/ diff --git a/pyproject.toml b/pyproject.toml index d89e53b564..8a4b0b6631 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" = ["*"]