Skip to content

Commit

Permalink
Merge pull request #1142 from IntelPython/main
Browse files Browse the repository at this point in the history
Merge main into GOLD
  • Loading branch information
ZzEeKkAa authored Sep 25, 2023
2 parents c27e704 + af26784 commit 4990ffa
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 5 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Coverity
on:
push:
branches:
- main
workflow_dispatch:

jobs:
Coverity:

runs-on: ubuntu-latest

env:
CHECKERS: --concurrency --security --rule --enable-constraint-fpp --enable-fnptr --enable-virtual --webapp-security --enable-audit-checkers --enable-default

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 11

- name: URL encode project name
run: echo "COV_PROJECT=${{ github.repository }}" | sed -e 's:/:%2F:g' -e 's/ /%20/g' >> $GITHUB_ENV

- name: Coverity Download
run: |
mkdir -p /tmp/cov-analysis
wget https://scan.coverity.com/download/linux64 --post-data "token=${{secrets.COV_TOKEN}}&project=${{env.COV_PROJECT}}" -O cov-analysis.tgz
tar -xzf cov-analysis.tgz --strip 1 -C /tmp/cov-analysis
rm cov-analysis.tgz
- name: Coverity Full Scan
if: ${{ github.event_name != 'pull_request' }}
run: |
export PATH=$PATH:/tmp/cov-analysis/bin
set -x
cov-build --dir cov-int --fs-capture-search $GITHUB_WORKSPACE --no-command
# Not available in package, maybe will be once approved?
# cov-analyze --dir cov-int --ticker-mode none --strip-path $GITHUB_WORKSPACE $CHECKERS
tar czvf numba-dpex.tgz cov-int
rm -rf cov-int
curl --form token=${{ secrets.COV_TOKEN }} \
--form email=${{ secrets.COV_EMAIL }} \
--form [email protected] \
--form version="${{ github.sha }}" \
--form description="Coverity Scan ${{ github.repository }} / ${{ github.ref }}" \
https://scan.coverity.com/builds?project=${{env.COV_PROJECT}}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dist/
.mypy_cache/
.ipynb_checkpoints/
__pycache__/
_skbuild

docs/source/developer/autogen*

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[![Coverage Status](https://coveralls.io/repos/github/IntelPython/numba-dpex/badge.svg?branch=main)](https://coveralls.io/github/IntelPython/numba-dpex?branch=main)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![Join the chat at https://matrix.to/#/#Data-Parallel-Python_community:gitter.im](https://badges.gitter.im/Join%20Chat.svg)](https://app.gitter.im/#/room/#Data-Parallel-Python_community:gitter.im)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/29068/badge.svg)](https://scan.coverity.com/projects/intelpython-numba-dpex)
<img align="left" src="https://spec.oneapi.io/oneapi-logo-white-scaled.jpg" alt="oneAPI logo" width="75"/>
<br/>
<br/>
Expand Down
16 changes: 11 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# SPDX-License-Identifier: Apache-2.0


import re
import sys

from setuptools import find_packages
Expand Down Expand Up @@ -35,12 +36,17 @@
"""


def to_cmake_format(version):
def to_cmake_format(version: str):
"""Convert pep440 version string into a cmake compatible string."""
version = version.strip()
parts = version.split("+")
tag, dist = parts[0], parts[1].split(".")[0]
return tag + "." + dist
# cmake version just support up to 4 numbers separated by dot.
# https://peps.python.org/pep-0440/
# https://cmake.org/cmake/help/latest/command/project.html

match = re.search(r"^\d+(?:\.\d+(?:\.\d+(?:\.\d+)?)?)?", version)
if not match:
raise Exception("Unsupported version")

return match.group(0)


# Set is_install and is_develop flags
Expand Down

0 comments on commit 4990ffa

Please sign in to comment.