Package: docker-pycreds / 0.4.0-1

remove_distutils.patch Patch series | download
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Description: Remove references of distutils
 This patch remove the use of distutils to remove python3-distutils from build
 dependency.
Author: Emmanuel Arias <[email protected]>
Bug-Debian: https://bugs.debian.org/1065849
Forwarded: no
Last-Update: 2024-07-10
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/dockerpycreds/utils.py
    b/dockerpycreds/utils.py
@@ -1,4  1,4 @@
-import distutils.spawn
 from shutil import which
 import os
 import sys
 
@@ -9,7  9,7 @@
     every extension declared in PATHEXT instead of just `.exe`
     """
     if sys.platform != 'win32':
-        return distutils.spawn.find_executable(executable, path)
         return which(executable, path=path)
 
     if path is None:
         path = os.environ['PATH']
--- a/tests/store_test.py
    b/tests/store_test.py
@@ -4,7  4,7 @@
 
 import pytest
 import six
-from distutils.spawn import find_executable
 from shutil import which
 
 from dockerpycreds import (
     CredentialsNotFound, Store, StoreError, DEFAULT_LINUX_STORE,
@@ -23,9  23,9 @@
     def setup_method(self):
         self.tmp_keys = []
         if sys.platform.startswith('linux'):
-            if find_executable('docker-credential-'   DEFAULT_LINUX_STORE):
             if which('docker-credential-'   DEFAULT_LINUX_STORE):
                 self.store = Store(DEFAULT_LINUX_STORE)
-            elif find_executable('docker-credential-pass'):
             elif which('docker-credential-pass'):
                 self.store = Store('pass')
             else:
                 raise Exception('No supported docker-credential store in PATH')