File: verify_dependencies_present.py

package info (click to toggle)
python-azure 20250603%2Bgit-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 851,724 kB
  • sloc: python: 7,362,925; ansic: 804; javascript: 287; makefile: 195; sh: 145; xml: 109
file content (33 lines) | stat: -rw-r--r-- 1,007 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import os
import argparse

root_dir = os.path.abspath(os.path.join(os.path.abspath(__file__), "..", "..", ".."))

from common_tasks import find_packages_missing_on_pypi

if __name__ == "__main__":

    parser = argparse.ArgumentParser(
        description="This script is used during a release stage to prevent releasing packages on PyPI with missing dependencies."
    )

    parser.add_argument(
        "--package-name",
        required=True,
        help="name of package (accepts both formats: azure-service-package and azure_service_package)",
    )
    parser.add_argument(
        "--service",
        required=True,
        help="name of the service for which to set the dev build id (e.g. keyvault)",
    )

    args = parser.parse_args()

    package_name = args.package_name.replace("_", "-")
    path_to_setup = os.path.join(root_dir, "sdk", args.service, package_name, "setup.py")

    missing_packages = find_packages_missing_on_pypi(path_to_setup)

    if missing_packages:
        exit(1)