[Notes] [Git][BuildStream/buildstream][bst-1.2] 9 commits: conftest.py: Don't use deprecated get_marker() function



Title: GitLab

Chandan Singh pushed to branch bst-1.2 at BuildStream / buildstream

Commits:

15 changed files:

Changes:

  • .coveragerc
    ... ... @@ -4,11 +4,15 @@ include =
    4 4
       */buildstream/*
    
    5 5
     
    
    6 6
     omit =
    
    7
    -  # Omit profiling helper module
    
    7
    +  # Omit some internals
    
    8 8
       */buildstream/_profile.py
    
    9
    +  */buildstream/__main__.py
    
    10
    +  */buildstream/_version.py
    
    9 11
       # Omit generated code
    
    10 12
       */buildstream/_protos/*
    
    11 13
       */.eggs/*
    
    14
    +  # Omit .tox directory
    
    15
    +  */.tox/*
    
    12 16
     
    
    13 17
     [report]
    
    14 18
     show_missing = True
    

  • .gitignore
    ... ... @@ -13,9 +13,12 @@ tests/**/*.pyc
    13 13
     integration-cache/
    
    14 14
     tmp
    
    15 15
     .coverage
    
    16
    +.coverage-reports/
    
    16 17
     .coverage.*
    
    17 18
     .cache
    
    19
    +.pytest_cache/
    
    18 20
     *.bst/
    
    21
    +.tox/
    
    19 22
     
    
    20 23
     # Pycache, in case buildstream is ran directly from within the source
    
    21 24
     # tree
    

  • .gitlab-ci.yml
    1
    -image: buildstream/testsuite-debian:9-master-114-4cab18e3
    
    1
    +image: buildstream/testsuite-debian:9-5da27168-32c47d1c
    
    2 2
     
    
    3 3
     cache:
    
    4 4
       key: "$CI_JOB_NAME-"
    
    ... ... @@ -6,49 +6,13 @@ cache:
    6 6
         - cache/
    
    7 7
     
    
    8 8
     stages:
    
    9
    -  - prepare
    
    10 9
       - test
    
    11 10
       - post
    
    12 11
     
    
    13
    -#####################################################
    
    14
    -#                  Prepare stage                    #
    
    15
    -#####################################################
    
    16
    -
    
    17
    -# Create a source distribution
    
    18
    -#
    
    19
    -source_dist:
    
    20
    -  stage: prepare
    
    21
    -  script:
    
    22
    -
    
    23
    -  # Generate the source distribution tarball
    
    24
    -  #
    
    25
    -  - python3 setup.py sdist
    
    26
    -  - tar -ztf dist/*
    
    27
    -  - tarball=$(cd dist && echo $(ls *))
    
    28
    -
    
    29
    -  # Create an installer script
    
    30
    -  - |
    
    31
    -    cat > dist/install.sh << EOF
    
    32
    -    #!/bin/sh
    
    33
    -    tar -zxf ${tarball}
    
    34
    -    cd ${tarball%.tar.gz}
    
    35
    -    pip3 install --no-index .
    
    36
    -    EOF
    
    37
    -
    
    38
    -  # unpack tarball as `dist/buildstream` directory
    
    39
    -  - |
    
    40
    -    cat > dist/unpack.sh << EOF
    
    41
    -    #!/bin/sh
    
    42
    -    tar -zxf ${tarball}
    
    43
    -    mv ${tarball%.tar.gz} buildstream
    
    44
    -    EOF
    
    45
    -
    
    46
    -  # Make our helpers executable
    
    47
    -  - chmod +x dist/install.sh
    
    48
    -  - chmod +x dist/unpack.sh
    
    49
    -  artifacts:
    
    50
    -    paths:
    
    51
    -    - dist/
    
    12
    +variables:
    
    13
    +  INTEGRATION_CACHE: "${CI_PROJECT_DIR}/cache/integration-cache"
    
    14
    +  TEST_COMMAND: "tox -- --color=yes --integration"
    
    15
    +  COVERAGE_PREFIX: "${CI_JOB_NAME}."
    
    52 16
     
    
    53 17
     
    
    54 18
     #####################################################
    
    ... ... @@ -57,66 +21,53 @@ source_dist:
    57 21
     
    
    58 22
     # Run premerge commits
    
    59 23
     #
    
    60
    -.linux-tests-template: &linux-tests
    
    24
    +.tests-template: &tests
    
    61 25
       stage: test
    
    62
    -  variables:
    
    63
    -    PYTEST_ADDOPTS: "--color=yes"
    
    64
    -  script:
    
    26
    +
    
    27
    +  before_script:
    
    65 28
       # Diagnostics
    
    66 29
       - mount
    
    67 30
       - df -h
    
    68 31
     
    
    32
    +  script:
    
    33
    +  - mkdir -p "${INTEGRATION_CACHE}"
    
    69 34
       - useradd -Um buildstream
    
    70 35
       - chown -R buildstream:buildstream .
    
    71 36
     
    
    72
    -  - export INTEGRATION_CACHE="$(pwd)/cache/integration-cache"
    
    73
    -
    
    74
    -  # Unpack and get into dist/buildstream
    
    75
    -  - cd dist && ./unpack.sh
    
    76
    -  - chown -R buildstream:buildstream buildstream
    
    77
    -  - cd buildstream
    
    78
    -
    
    79
    -  # Run the tests from the source distribution, We run as a simple
    
    80
    -  # user to test for permission issues
    
    81
    -  - su buildstream -c 'python3 setup.py test --index-url invalid://uri --addopts --integration'
    
    37
    +  # Run the tests as a simple user to test for permission issues
    
    38
    +  - su buildstream -c "${TEST_COMMAND}"
    
    82 39
     
    
    83
    -  # Go back to the toplevel and collect our reports
    
    84
    -  - cd ../..
    
    85
    -  - mkdir -p coverage-linux/
    
    86
    -  - cp dist/buildstream/.coverage.* coverage-linux/coverage."${CI_JOB_NAME}"
    
    87 40
       except:
    
    88 41
       - schedules
    
    89 42
       artifacts:
    
    90 43
         paths:
    
    91
    -    - coverage-linux/
    
    44
    +    - .coverage-reports
    
    92 45
     
    
    93 46
     tests-debian-9:
    
    94
    -  image: buildstream/testsuite-debian:9-master-117-aa3a33b3
    
    95
    -  <<: *linux-tests
    
    47
    +  image: buildstream/testsuite-debian:9-5da27168-32c47d1c
    
    48
    +  <<: *tests
    
    96 49
     
    
    97 50
     tests-fedora-27:
    
    98
    -  image: buildstream/testsuite-fedora:27-master-117-aa3a33b3
    
    99
    -  <<: *linux-tests
    
    51
    +  image: buildstream/testsuite-fedora:27-5da27168-32c47d1c
    
    52
    +  <<: *tests
    
    100 53
     
    
    101 54
     tests-fedora-28:
    
    102
    -  image: buildstream/testsuite-fedora:28-master-117-aa3a33b3
    
    103
    -  <<: *linux-tests
    
    55
    +  image: buildstream/testsuite-fedora:28-5da27168-32c47d1c
    
    56
    +  <<: *tests
    
    104 57
     
    
    105 58
     tests-ubuntu-18.04:
    
    106
    -  image: buildstream/testsuite-ubuntu:18.04-master-117-aa3a33b3
    
    107
    -  <<: *linux-tests
    
    59
    +  image: buildstream/testsuite-ubuntu:18.04-5da27168-32c47d1c
    
    60
    +  <<: *tests
    
    108 61
     
    
    109 62
     tests-unix:
    
    110 63
       # Use fedora here, to a) run a test on fedora and b) ensure that we
    
    111 64
       # can get rid of ostree - this is not possible with debian-8
    
    112
    -  image: buildstream/testsuite-fedora:27-master-117-aa3a33b3
    
    113
    -  stage: test
    
    65
    +  image: buildstream/testsuite-fedora:27-5da27168-32c47d1c
    
    66
    +  <<: *tests
    
    114 67
       variables:
    
    115 68
         BST_FORCE_BACKEND: "unix"
    
    116
    -    PYTEST_ADDOPTS: "--color=yes"
    
    117
    -  script:
    
    118 69
     
    
    119
    -    - export INTEGRATION_CACHE="$(pwd)/cache/integration-cache"
    
    70
    +  script:
    
    120 71
     
    
    121 72
         # We remove the Bubblewrap and OSTree packages here so that we catch any
    
    122 73
         # codepaths that try to use them. Removing OSTree causes fuse-libs to
    
    ... ... @@ -124,39 +75,19 @@ tests-unix:
    124 75
         - dnf mark install fuse-libs
    
    125 76
         - dnf erase -y bubblewrap ostree
    
    126 77
     
    
    127
    -    # Unpack and get into dist/buildstream
    
    128
    -    - cd dist && ./unpack.sh && cd buildstream
    
    129
    -
    
    130 78
         # Since the unix platform is required to run as root, no user change required
    
    131
    -    - python3 setup.py test --index-url invalid://uri --addopts --integration
    
    132
    -
    
    133
    -    # Go back to the toplevel and collect our reports
    
    134
    -    - cd ../..
    
    135
    -    - mkdir -p coverage-unix/
    
    136
    -    - cp dist/buildstream/.coverage.* coverage-unix/coverage.unix
    
    137
    -  except:
    
    138
    -  - schedules
    
    139
    -  artifacts:
    
    140
    -    paths:
    
    141
    -    - coverage-unix/
    
    142
    -    - logs-unix/
    
    79
    +    - ${TEST_COMMAND}
    
    143 80
     
    
    144 81
     
    
    145 82
     # Automatically build documentation for every commit, we want to know
    
    146 83
     # if building documentation fails even if we're not deploying it.
    
    147
    -# Note: We still do not enforce a consistent installation of python3-sphinx,
    
    148
    -#       as it will significantly grow the backing image.
    
    149 84
     docs:
    
    150 85
       stage: test
    
    86
    +  variables:
    
    87
    +    BST_FORCE_SESSION_REBUILD: 1
    
    151 88
       script:
    
    152
    -  - export BST_SOURCE_CACHE="$(pwd)/cache/integration-cache/sources"
    
    153
    -  - pip3 install sphinx
    
    154
    -  - pip3 install sphinx-click
    
    155
    -  - pip3 install sphinx_rtd_theme
    
    156
    -  - cd dist && ./unpack.sh && cd buildstream
    
    157
    -  - make BST_FORCE_SESSION_REBUILD=1 -C doc
    
    158
    -  - cd ../..
    
    159
    -  - mv dist/buildstream/doc/build/html public
    
    89
    +  - env BST_SOURCE_CACHE="$(pwd)/cache/integration-cache/sources" tox -e docs
    
    90
    +  - mv doc/build/html public
    
    160 91
       except:
    
    161 92
       - schedules
    
    162 93
       artifacts:
    
    ... ... @@ -170,7 +101,8 @@ docs:
    170 101
         bst_ext_ref: 1d6ab71151b93c8cbc0a91a36ffe9270f3b835f1 # 0.5.1
    
    171 102
         fd_sdk_ref: 88d7c22c2281b987faa02edd57df80d430eecf1f # 18.08.12
    
    172 103
       before_script:
    
    173
    -  - (cd dist && ./unpack.sh && cd buildstream && pip3 install .)
    
    104
    +  - pip3 install -r requirements/requirements.txt -r requirements/plugin-requirements.txt
    
    105
    +  - pip3 install --no-index .
    
    174 106
       - pip3 install --user -e ${bst_ext_url}@${bst_ext_ref}#egg=bst_ext
    
    175 107
       - git clone https://gitlab.com/freedesktop-sdk/freedesktop-sdk.git
    
    176 108
       - git -C freedesktop-sdk checkout ${fd_sdk_ref}
    
    ... ... @@ -253,21 +185,15 @@ coverage:
    253 185
       stage: post
    
    254 186
       coverage: '/TOTAL +\d+ +\d+ +(\d+\.\d+)%/'
    
    255 187
       script:
    
    256
    -    - cd dist && ./unpack.sh && cd buildstream
    
    257
    -    - pip3 install --no-index .
    
    258
    -    - mkdir report
    
    259
    -    - cd report
    
    260
    -    - cp ../../../coverage-unix/coverage.unix .
    
    261
    -    - cp ../../../coverage-linux/coverage.* .
    
    262
    -    - ls coverage.*
    
    263
    -    - coverage combine --rcfile=../.coveragerc -a coverage.*
    
    264
    -    - coverage report --rcfile=../.coveragerc -m
    
    188
    +    - cp -a .coverage-reports/ ./coverage-sources
    
    189
    +    - tox -e coverage
    
    190
    +    - cp -a .coverage-reports/ ./coverage-report
    
    265 191
       dependencies:
    
    266 192
       - tests-debian-9
    
    267 193
       - tests-fedora-27
    
    268 194
       - tests-fedora-28
    
    195
    +  - tests-ubuntu-18.04
    
    269 196
       - tests-unix
    
    270
    -  - source_dist
    
    271 197
       except:
    
    272 198
       - schedules
    
    273 199
     
    
    ... ... @@ -276,7 +202,6 @@ coverage:
    276 202
     pages:
    
    277 203
       stage: post
    
    278 204
       dependencies:
    
    279
    -  - source_dist
    
    280 205
       - docs
    
    281 206
       script:
    
    282 207
       - find public/
    

  • MANIFEST.in
    ... ... @@ -23,4 +23,12 @@ recursive-include tests *.expected
    23 23
     recursive-include buildstream/_protos *.proto
    
    24 24
     
    
    25 25
     # Requirements files
    
    26
    -include dev-requirements.txt
    26
    +include requirements/requirements.in
    
    27
    +include requirements/requirements.txt
    
    28
    +include requirements/dev-requirements.in
    
    29
    +include requirements/dev-requirements.txt
    
    30
    +include requirements/plugin-requirements.in
    
    31
    +include requirements/plugin-requirements.txt
    
    32
    +
    
    33
    +# Versioneer
    
    34
    +include versioneer.py

  • Makefile
    1
    +# Makefile for updating BuildStream's requirements files.
    
    2
    +#
    
    3
    +
    
    4
    +REQUIREMENTS_IN := $(wildcard *.in)
    
    5
    +REQUIREMENTS_TXT := $(REQUIREMENTS_IN:.in=.txt)
    
    6
    +PYTHON := python3
    
    7
    +VENV := $(PYTHON) -m venv
    
    8
    +
    
    9
    +VENV_PIP = $(VENVDIR)/bin/pip
    
    10
    +
    
    11
    +
    
    12
    +.PHONY: all
    
    13
    +
    
    14
    +all: $(REQUIREMENTS_TXT)
    
    15
    +
    
    16
    +%.txt: %.in
    
    17
    +	$(eval VENVDIR := $(shell mktemp -d $(CURDIR)/.bst-venv.XXXXXX))
    
    18
    +	$(VENV) $(VENVDIR)
    
    19
    +	$(VENV_PIP) install -r $^
    
    20
    +	$(VENV_PIP) freeze -r $^ > $@
    
    21
    +	rm -rf $(VENVDIR)

  • conftest.py
    ... ... @@ -30,7 +30,7 @@ def pytest_addoption(parser):
    30 30
     
    
    31 31
     
    
    32 32
     def pytest_runtest_setup(item):
    
    33
    -    if item.get_marker('integration') and not item.config.getvalue('integration'):
    
    33
    +    if item.get_closest_marker('integration') and not item.config.getvalue('integration'):
    
    34 34
             pytest.skip('skipping integration test')
    
    35 35
     
    
    36 36
     
    

  • doc/bst2html.py
    ... ... @@ -440,7 +440,7 @@ def run_session(description, tempdir, source_cache, palette, config_file, force)
    440 440
     @click.option('--palette', '-p', default='tango',
    
    441 441
                   type=click.Choice(['solarized', 'solarized-xterm', 'tango', 'xterm', 'console']),
    
    442 442
                   help="Selects a palette for the output style")
    
    443
    -@click.argument('description', click.Path(file_okay=True, dir_okay=False, readable=True))
    
    443
    +@click.argument('description', type=click.Path(file_okay=True, dir_okay=False, readable=True))
    
    444 444
     def run_bst(directory, force, source_cache, description, palette):
    
    445 445
         """Run a bst command and capture stdout/stderr in html
    
    446 446
     
    

  • dev-requirements.txtrequirements/dev-requirements.in

  • requirements/dev-requirements.txt
    1
    +coverage==4.4
    
    2
    +pep8==1.7.1
    
    3
    +pylint==2.1.1
    
    4
    +pytest==4.1.1
    
    5
    +pytest-cov==2.6.1
    
    6
    +pytest-datafiles==2.0
    
    7
    +pytest-env==0.6.2
    
    8
    +pytest-pep8==1.0.6
    
    9
    +pytest-pylint==0.14.0
    
    10
    +pytest-xdist==1.26.0
    
    11
    +pytest-timeout==1.3.3
    
    12
    +## The following requirements were added by pip freeze:
    
    13
    +apipkg==1.5
    
    14
    +astroid==2.1.0
    
    15
    +atomicwrites==1.2.1
    
    16
    +attrs==18.2.0
    
    17
    +execnet==1.5.0
    
    18
    +isort==4.3.4
    
    19
    +lazy-object-proxy==1.3.1
    
    20
    +mccabe==0.6.1
    
    21
    +more-itertools==5.0.0
    
    22
    +pluggy==0.8.1
    
    23
    +py==1.7.0
    
    24
    +pytest-cache==1.0
    
    25
    +pytest-forked==1.0.1
    
    26
    +six==1.12.0
    
    27
    +wrapt==1.11.0

  • requirements/plugin-requirements.in
    1
    +arpy
    
    2
    +PyGObject

  • requirements/plugin-requirements.txt
    1
    +arpy==1.1.1
    
    2
    +PyGObject==3.30.4
    
    3
    +## The following requirements were added by pip freeze:
    
    4
    +pycairo==1.18.0

  • requirements/requirements.in
    1
    +Click
    
    2
    +grpcio >= 1.10
    
    3
    +jinja2 >= 2.10
    
    4
    +pluginbase
    
    5
    +protobuf >= 3.5
    
    6
    +psutil
    
    7
    +ruamel.yaml < 0.15.52
    
    8
    +setuptools

  • requirements/requirements.txt
    1
    +Click==7.0
    
    2
    +grpcio==1.18.0
    
    3
    +pluginbase==0.7
    
    4
    +protobuf==3.6.1
    
    5
    +psutil==5.4.8
    
    6
    +ruamel.yaml==0.15.51
    
    7
    +setuptools==40.6.2
    
    8
    +## The following requirements were added by pip freeze:
    
    9
    +Jinja2==2.10
    
    10
    +MarkupSafe==1.1.0
    
    11
    +six==1.12.0

  • setup.py
    ... ... @@ -228,9 +228,12 @@ def get_cmdclass():
    228 228
     #####################################################
    
    229 229
     #               Gather requirements                 #
    
    230 230
     #####################################################
    
    231
    -with open('dev-requirements.txt') as dev_reqs:
    
    231
    +with open('requirements/dev-requirements.in') as dev_reqs:
    
    232 232
         dev_requires = dev_reqs.read().splitlines()
    
    233 233
     
    
    234
    +with open('requirements/requirements.in') as install_reqs:
    
    235
    +    install_requires = install_reqs.read().splitlines()
    
    236
    +
    
    234 237
     #####################################################
    
    235 238
     #     Prepare package description from README       #
    
    236 239
     #####################################################
    
    ... ... @@ -291,16 +294,7 @@ setup(name='BuildStream',
    291 294
                   os.path.join('buildstream', 'data', 'bst')
    
    292 295
               ])
    
    293 296
           ],
    
    294
    -      install_requires=[
    
    295
    -          'setuptools',
    
    296
    -          'psutil',
    
    297
    -          'ruamel.yaml < 0.15.52',
    
    298
    -          'pluginbase',
    
    299
    -          'Click',
    
    300
    -          'jinja2 >= 2.10',
    
    301
    -          'protobuf >= 3.5',
    
    302
    -          'grpcio >= 1.10',
    
    303
    -      ],
    
    297
    +      install_requires=install_requires,
    
    304 298
           entry_points=bst_install_entry_points,
    
    305 299
           setup_requires=['pytest-runner'],
    
    306 300
           tests_require=dev_requires,
    

  • tox.ini
    1
    +#
    
    2
    +# Tox global configuration
    
    3
    +#
    
    4
    +[tox]
    
    5
    +envlist = py35,py36,py37
    
    6
    +skip_missing_interpreters = true
    
    7
    +
    
    8
    +#
    
    9
    +# Defaults for all environments
    
    10
    +#
    
    11
    +# Anything specified here is iherited by the sections
    
    12
    +#
    
    13
    +[testenv]
    
    14
    +commands =
    
    15
    +    pytest --basetemp {envtmpdir} {posargs}
    
    16
    +    mkdir -p .coverage-reports
    
    17
    +    mv {envtmpdir}/.coverage {toxinidir}/.coverage-reports/.coverage.{env:COVERAGE_PREFIX:}{envname}
    
    18
    +deps =
    
    19
    +    -rrequirements/requirements.txt
    
    20
    +    -rrequirements/dev-requirements.txt
    
    21
    +    -rrequirements/plugin-requirements.txt
    
    22
    +passenv =
    
    23
    +    BST_FORCE_BACKEND
    
    24
    +    GI_TYPELIB_PATH
    
    25
    +    INTEGRATION_CACHE
    
    26
    +
    
    27
    +#
    
    28
    +# These keys are not inherited by any other sections
    
    29
    +#
    
    30
    +setenv =
    
    31
    +    py{35,36,37}: COVERAGE_FILE = {envtmpdir}/.coverage
    
    32
    +whitelist_externals =
    
    33
    +    py{35,36,37}:
    
    34
    +        mv
    
    35
    +        mkdir
    
    36
    +
    
    37
    +#
    
    38
    +# Coverage reporting
    
    39
    +#
    
    40
    +[testenv:coverage]
    
    41
    +commands =
    
    42
    +    - coverage combine --rcfile={toxinidir}/.coveragerc {toxinidir}/.coverage-reports/
    
    43
    +    coverage report --rcfile={toxinidir}/.coveragerc -m
    
    44
    +deps =
    
    45
    +    -rrequirements/requirements.txt
    
    46
    +    -rrequirements/dev-requirements.txt
    
    47
    +setenv =
    
    48
    +    COVERAGE_FILE = {toxinidir}/.coverage-reports/.coverage
    
    49
    +
    
    50
    +#
    
    51
    +# Building documentation
    
    52
    +#
    
    53
    +[testenv:docs]
    
    54
    +commands =
    
    55
    +    make -C doc
    
    56
    +# sphinx_rtd_theme < 0.4.2 breaks search functionality for Sphinx >= 1.8
    
    57
    +deps =
    
    58
    +    sphinx
    
    59
    +    sphinx-click
    
    60
    +    sphinx_rtd_theme >= 0.4.2
    
    61
    +    -rrequirements/requirements.txt
    
    62
    +    -rrequirements/plugin-requirements.txt
    
    63
    +passenv =
    
    64
    +    BST_FORCE_SESSION_REBUILD
    
    65
    +    BST_SOURCE_CACHE
    
    66
    +    HOME
    
    67
    +    LANG
    
    68
    +    LC_ALL
    
    69
    +whitelist_externals =
    
    70
    +    make



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