File: ci-cleanup.py

package info (click to toggle)
oscrypto 1.3.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,164 kB
  • sloc: python: 22,115; makefile: 7
file content (28 lines) | stat: -rw-r--r-- 763 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
# coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function

import os
import shutil

from . import build_root, other_packages


def run():
    """
    Cleans up CI dependencies - used for persistent GitHub Actions
    Runners since they don't clean themselves up.
    """

    print("Removing ci dependencies")
    deps_dir = os.path.join(build_root, 'modularcrypto-deps')
    if os.path.exists(deps_dir):
        shutil.rmtree(deps_dir, ignore_errors=True)

    print("Removing modularcrypto packages")
    for other_package in other_packages:
        pkg_dir = os.path.join(build_root, other_package)
        if os.path.exists(pkg_dir):
            shutil.rmtree(pkg_dir, ignore_errors=True)
    print()

    return True