Skip to content

Commit

Permalink
Merge branch 'master' into dist_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
stdweird authored Nov 16, 2023
2 parents dc339fe + f090f62 commit 7e7845d
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions lib/vsc/install/shared_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
"""

import sys

import builtins as __builtin__ # make builtins accessible via same way as in Python 3

import glob
import hashlib
import inspect
Expand All @@ -42,6 +39,7 @@
import shutil
import traceback
import re
import builtins

import setuptools
import setuptools.dist
Expand Down Expand Up @@ -77,13 +75,13 @@

# private class variables to communicate
# between VscScanningLoader and VscTestCommand
# stored in __builtin__ because the (Vsc)TestCommand.run_tests
# stored in builtins because the (Vsc)TestCommand.run_tests
# reloads and cleans up the modules
if not hasattr(__builtin__, '__target'):
setattr(__builtin__, '__target', {})
if not hasattr(builtins, '__target'):
setattr(builtins, '__target', {})

if not hasattr(__builtin__, '__test_filter'):
setattr(__builtin__, '__test_filter', {
if not hasattr(builtins, '__test_filter'):
setattr(builtins, '__test_filter', {
'module': None,
'function': None,
'allowmods': [],
Expand Down Expand Up @@ -532,7 +530,7 @@ def remove_extra_bdist_rpm_files(self, pkgs=None):
"""For list of packages pkgs, make the function to exclude all conflicting files from rpm"""

if pkgs is None:
pkgs = getattr(__builtin__, '__target').get('excluded_pkgs_rpm', [])
pkgs = getattr(builtins, '__target').get('excluded_pkgs_rpm', [])

res = []
for pkg in pkgs:
Expand Down Expand Up @@ -772,7 +770,7 @@ def run(self):
@staticmethod
def filter_testsuites(testsuites):
"""(Recursive) filtering of (suites of) tests"""
test_filter = getattr(__builtin__, '__test_filter')['function']
test_filter = getattr(builtins, '__test_filter')['function']

res = type(testsuites)()

Expand Down Expand Up @@ -822,7 +820,7 @@ def loadTestsFromModule(self, module, pattern=None): # pylint: disable=argument

raise

test_filter = getattr(__builtin__, '__test_filter')
test_filter = getattr(builtins, '__test_filter')

res = testsuites

Expand Down Expand Up @@ -1011,11 +1009,11 @@ def __init__(self, *args, **kwargs):
def run_tests(self):
"""
Actually run the tests, but start with
passing the filter options via __builtin__
passing the filter options via builtins
set sys.path
reload vsc modules
"""
getattr(__builtin__, '__test_filter').update({
getattr(builtins, '__test_filter').update({
'function': self.test_filterf,
'module': self.test_filterm,
})
Expand Down Expand Up @@ -1646,7 +1644,7 @@ def prepare_rpm(self, target):
"""
pkgs = target.pop('excluded_pkgs_rpm', ['vsc'])
if pkgs is not None:
getattr(__builtin__, '__target')['excluded_pkgs_rpm'] = pkgs
getattr(builtins, '__target')['excluded_pkgs_rpm'] = pkgs

# Add (default) and excluded_pkgs_rpm packages to SHARED_TARGET
# the default ones are only the ones with a __init__.py file
Expand Down

0 comments on commit 7e7845d

Please sign in to comment.