[Notes] [Git][BuildStream/buildstream][master] 2 commits: tests/testutils/python_repo.py: Use subprocess to run sdist



Title: GitLab

Tristan Van Berkom pushed to branch master at BuildStream / buildstream

Commits:

1 changed file:

Changes:

  • tests/testutils/python_repo.py
    1
    -from setuptools.sandbox import run_setup
    
    2 1
     import os
    
    3 2
     import pytest
    
    4 3
     import re
    
    5 4
     import shutil
    
    5
    +import subprocess
    
    6 6
     
    
    7 7
     
    
    8 8
     SETUP_TEMPLATE = '''\
    
    ... ... @@ -88,7 +88,9 @@ def generate_pip_package(tmpdir, pypi, name, version='0.1'):
    88 88
             f.write(INIT_TEMPLATE.format(name=name))
    
    89 89
         os.chmod(main_file, 0o644)
    
    90 90
     
    
    91
    -    run_setup(setup_file, ['sdist'])
    
    91
    +    # Run sdist with a fresh process
    
    92
    +    p = subprocess.run(['python3', 'setup.py', 'sdist'], cwd=tmpdir)
    
    93
    +    assert p.returncode == 0
    
    92 94
     
    
    93 95
         # create directory for this package in pypi resulting in a directory
    
    94 96
         # tree resembling the following structure:
    



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