From 8ea5b0a8e77ff2c4e11436635cebbf0bd0c0a8b8 Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Jun 24 2022 19:08:18 +0000 Subject: Get source from git repository --- diff --git a/.gitignore b/.gitignore index 09b8a9b..fcf4041 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /azure-mgmt-network-19.1.0.zip /azure-mgmt-network-19.3.0.zip /azure-mgmt-network-20.0.0.zip +/azure-mgmt-network-20.0.0.tgz diff --git a/generate-source.sh b/generate-source.sh new file mode 100755 index 0000000..215bfd9 --- /dev/null +++ b/generate-source.sh @@ -0,0 +1,21 @@ +#!/bin/bash +set -euxo pipefail + +export VERSION=20.0.0 +export PACKAGE_NAME=azure-mgmt-network +WORKING_DIR=$(pwd) + +# Download the release and unpack it. +curl -LO https://github.com/Azure/azure-sdk-for-python/archive/refs/tags/${PACKAGE_NAME}_${VERSION}.tar.gz +tar xzf ${PACKAGE_NAME}_${VERSION}.tar.gz + +# Find the package directory in the SDK release and the parent directory. +PACKAGE_DIR=$(find azure-sdk-for-python-${PACKAGE_NAME}_${VERSION} -type d -name $PACKAGE_NAME) +PARENT_DIR=$(dirname $PACKAGE_DIR) + +# Build a tarball with a prefix directory that contains the package name and +# version. Store that in the directory where the script is running. +pushd $PARENT_DIR + tar --transform "s/^${PACKAGE_NAME}/${PACKAGE_NAME}-${VERSION}/" -cz \ + -f ${WORKING_DIR}/${PACKAGE_NAME}-${VERSION}.tgz $PACKAGE_NAME +popd \ No newline at end of file diff --git a/python-azure-mgmt-network.spec b/python-azure-mgmt-network.spec index 39742ac..8162292 100644 --- a/python-azure-mgmt-network.spec +++ b/python-azure-mgmt-network.spec @@ -1,4 +1,4 @@ -# All tests are marked as "live" tests which require network connectivity. +# All of the tests require a proxy running under docker. %bcond_with tests %global srcname azure-mgmt-network @@ -9,7 +9,9 @@ Release: %autorelease Summary: Microsoft Azure Network Management Client Library for Python License: MIT URL: https://pypi.org/project/%{srcname}/ -Source0: %{pypi_source %{srcname} %{version} zip} +# This source comes from making a git archive of the main azure-sdk-for-python +# repository. To reproduce the source code, run the generate-source.sh script. +Source0: %{srcname}-%{version}.tgz BuildArch: noarch @@ -33,7 +35,7 @@ Microsoft Azure Network Management Client Library for Python} %package -n python3-%{srcname} Summary: %{summary} -Obsoletes: python3-azure-sdk < 5.0.1 + %description -n python3-%{srcname} %{_description} @@ -42,7 +44,7 @@ Obsoletes: python3-azure-sdk < 5.0.1 %generate_buildrequires -%pyproject_buildrequires -r +%pyproject_buildrequires %build @@ -54,9 +56,11 @@ Obsoletes: python3-azure-sdk < 5.0.1 %pyproject_save_files azure -%if %{with tests} %check -%pytest -m "not live_test_only" +%pyproject_check_import + +%if %{with tests} +%pytest %endif diff --git a/sources b/sources index 97b2829..b4e6ba5 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (azure-mgmt-network-20.0.0.zip) = 75869f1f01bdf289afbeb70c3e73677d0618256ad4fecf7ee88bcb26434c9f15e3a1d071858f7c8c7de218942d284206a84117638f5f47eac195c49fbe9e4496 +SHA512 (azure-mgmt-network-20.0.0.tgz) = f8678895e7e06bf0df4b1202cd8503896231eceaccc701a145ba00e907637b7ba77cb447da2930e30a748c7c386c06a13206ebb2f817d806b00c620ee5b81935