Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
rizsotto committed May 11, 2021
2 parents e9d82b0 + 7eac7d8 commit 02f8313
Show file tree
Hide file tree
Showing 11 changed files with 131 additions and 242 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Python package

on:
push:
branches: [ master, devel ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]
exclude:
- os: macos-latest
python-version: 3.8
- os: macos-latest
python-version: 3.9

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Clang (on Windows)
if: runner.os == 'Windows'
run: |
choco install llvm
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 nose lit
python -m pip install -r requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with nose
run: |
nosetests tests/unit --verbose
- name: Test with lit
if: runner.os != 'Windows'
run: |
lit -v tests
- name: Test with lit (on Windows)
if: runner.os == 'Windows'
run: |
pip install . --use-feature=in-tree-build
lit -DUSE_INSTALLED=true -v tests
28 changes: 28 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
101 changes: 0 additions & 101 deletions .travis.yml

This file was deleted.

11 changes: 1 addition & 10 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
.. image:: https://travis-ci.org/rizsotto/scan-build.svg?branch=master
:target: https://travis-ci.org/rizsotto/scan-build

.. image:: https://ci.appveyor.com/api/projects/status/k5fi1xy90xieqxir/branch/master?svg=true
:target: https://ci.appveyor.com/project/rizsotto/scan-build/branch/master

.. image:: https://coveralls.io/repos/github/rizsotto/scan-build/badge.svg?branch=master
:target: https://coveralls.io/github/rizsotto/scan-build?branch=master

.. image:: https://img.shields.io/pypi/v/scan-build.svg
:target: https://pypi.python.org/pypi/scan-build

Expand Down Expand Up @@ -53,7 +44,7 @@ Prerequisites
-------------

1. **clang compiler**, to compile the sources and have the static analyzer.
2. **python** interpreter (version 2.7, 3.4, 3.5, 3.6, 3.7).
2. **python** interpreter (version 3.6, 3.7, 3.8, 3.9).


How to use
Expand Down
76 changes: 0 additions & 76 deletions appveyor.yml

This file was deleted.

29 changes: 15 additions & 14 deletions libscanbuild/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,20 +399,21 @@ def parse_bug_plist(filename):
# type: (str) -> Generator[Bug, None, None]
""" Returns the generator of bugs from a single .plist file. """

content = plistlib.readPlist(filename)
files = content.get('files', [])
for bug in content.get('diagnostics', []):
if len(files) <= int(bug['location']['file']):
logging.warning('Parsing bug from "%s" failed', filename)
continue

yield Bug(filename, {
'bug_type': bug['type'],
'bug_category': bug['category'],
'bug_line': bug['location']['line'],
'bug_path_length': bug['location']['col'],
'bug_file': files[int(bug['location']['file'])]
})
with open(filename, 'rb') as handle:
content = plistlib.load(handle)
files = content.get('files', [])
for bug in content.get('diagnostics', []):
if len(files) <= int(bug['location']['file']):
logging.warning('Parsing bug from "%s" failed', filename)
continue

yield Bug(filename, {
'bug_type': bug['type'],
'bug_category': bug['category'],
'bug_line': bug['location']['line'],
'bug_path_length': bug['location']['col'],
'bug_file': files[int(bug['location']['file'])]
})


def parse_bug_html(filename):
Expand Down
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@
"Environment :: Console", "Operating System :: POSIX",
"Operating System :: MacOS :: MacOS X",
"Intended Audience :: Developers", "Programming Language :: C",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Software Development :: Compilers",
"Topic :: Software Development :: Quality Assurance"
])
Loading

0 comments on commit 02f8313

Please sign in to comment.