[Notes] [Git][BuildStream/buildstream][bschubert/remove-pytest-runner] 3 commits: _downloadablefilesource: handle ValueError-s



Title: GitLab

Benjamin Schubert pushed to branch bschubert/remove-pytest-runner at BuildStream / buildstream

Commits:

2 changed files:

Changes:

  • buildstream/plugins/sources/_downloadablefilesource.py
    ... ... @@ -152,7 +152,9 @@ class DownloadableFileSource(Source):
    152 152
                 raise SourceError("{}: Error mirroring {}: {}"
    
    153 153
                                   .format(self, self.url, e), temporary=True) from e
    
    154 154
     
    
    155
    -        except (urllib.error.URLError, urllib.error.ContentTooShortError, OSError) as e:
    
    155
    +        except (urllib.error.URLError, urllib.error.ContentTooShortError, OSError, ValueError) as e:
    
    156
    +            # Note that urllib.request.Request in the try block may throw a
    
    157
    +            # ValueError for unknown url types, so we handle it here.
    
    156 158
                 raise SourceError("{}: Error mirroring {}: {}"
    
    157 159
                                   .format(self, self.url, e), temporary=True) from e
    
    158 160
     
    

  • setup.py
    ... ... @@ -39,6 +39,7 @@ if sys.version_info[0] != REQUIRED_PYTHON_MAJOR or sys.version_info[1] < REQUIRE
    39 39
     try:
    
    40 40
         from setuptools import setup, find_packages, Command
    
    41 41
         from setuptools.command.easy_install import ScriptWriter
    
    42
    +    from setuptools.command.test import test as TestCommand
    
    42 43
     except ImportError:
    
    43 44
         print("BuildStream requires setuptools in order to build. Install it using"
    
    44 45
               " your package manager (usually python3-setuptools) or via pip (pip3"
    
    ... ... @@ -219,9 +220,48 @@ class BuildGRPC(Command):
    219 220
                             f.write(code)
    
    220 221
     
    
    221 222
     
    
    223
    +#####################################################
    
    224
    +#                   Pytest command                  #
    
    225
    +#####################################################
    
    226
    +class PyTest(TestCommand):
    
    227
    +    """Defines a pytest command class to run tests from setup.py"""
    
    228
    +
    
    229
    +    user_options = TestCommand.user_options + [
    
    230
    +        ("addopts=", None, "Arguments to pass to pytest"),
    
    231
    +        ('index-url=''build_grpc': BuildGRPC,
    
    264
    +        'pytest': PyTest,
    
    225 265
         }
    
    226 266
         cmdclass.update(versioneer.get_cmdclass())
    
    227 267
         return cmdclass
    
    ... ... @@ -305,6 +345,5 @@ setup(name='BuildStream',
    305 345
               'grpcio >= 1.10',
    
    306 346
           ],
    
    307 347
           entry_points=bst_install_entry_points,
    
    308
    -      setup_requires=['pytest-runner'],
    
    309 348
           tests_require=dev_requires,
    
    310 349
           zip_safe=False)



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]