Skip to content

Commit 5cf0748

Browse files
committed
make adjustments to pass pre-commit
1 parent 21491c4 commit 5cf0748

50 files changed

Lines changed: 246 additions & 221 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/conda-package.yml

Lines changed: 100 additions & 96 deletions
Large diffs are not rendered by default.

.github/workflows/generate-coverage.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,17 @@ jobs:
111111
shell: bash -l {0}
112112
run: |
113113
echo "Processing c-api-coverage"
114-
export DPCTL_LCOV_FN=$(find _skbuild -name dpctl.lcov)
115-
grep "/tmp" $DPCTL_LCOV_FN
114+
DPCTL_LCOV_FN=$(find _skbuild -name dpctl.lcov)
115+
export DPCTL_LCOV_FN
116+
grep "/tmp" "$DPCTL_LCOV_FN"
116117
coveralls-lcov -v -n \
117-
$DPCTL_LCOV_FN > dpctl-c-api-coverage.json
118+
"$DPCTL_LCOV_FN" > dpctl-c-api-coverage.json
118119
echo "Processing pytest-coverage"
119-
export DPCTL_PYTEST_LCOV=$(find . -name dpctl_pytest.lcov)
120-
grep "/tmp" $DPCTL_PYTEST_LCOV
120+
DPCTL_PYTEST_LCOV=$(find . -name dpctl_pytest.lcov)
121+
export DPCTL_PYTEST_LCOV
122+
grep "/tmp" "$DPCTL_PYTEST_LCOV"
121123
coveralls-lcov -v -n \
122-
$DPCTL_PYTEST_LCOV > pytest-dpctl-c-api-coverage.json
124+
"$DPCTL_PYTEST_LCOV" > pytest-dpctl-c-api-coverage.json
123125
echo "Merging JSON files"
124126
python -c "import json; \
125127
fh1 = open('dpctl-c-api-coverage.json', 'r'); \
@@ -132,7 +134,7 @@ jobs:
132134
# merge combined file with coverage data and upload
133135
ls -lh dpctl-c-api-coverage.json pytest-dpctl-c-api-coverage.json \
134136
combined-dpctl-c-api-coverage.json \
135-
$(find _skbuild -name dpctl.lcov) $(find . -name dpctl_pytest.lcov)
137+
"$DPCTL_LCOV_FN" "$DPCTL_PYTEST_LCOV"
136138
echo "Merging combined files with coverage data"
137139
coveralls --service=github --merge=combined-dpctl-c-api-coverage.json
138140
env:

.github/workflows/generate-docs.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
source /opt/intel/oneapi/setvars.sh
7676
wget https://github.com/vovkos/doxyrest/releases/download/doxyrest-2.1.2/doxyrest-2.1.2-linux-amd64.tar.xz
7777
tar xf doxyrest-2.1.2-linux-amd64.tar.xz
78-
python scripts/gen_docs.py --doxyrest-root=`pwd`/doxyrest-2.1.2-linux-amd64 --verbose --multiversion --clean || exit 1
78+
python scripts/gen_docs.py --doxyrest-root="$(pwd)/doxyrest-2.1.2-linux-amd64" --verbose --multiversion --clean || exit 1
7979
python -c "import dpctl; print(dpctl.__version__)" || exit 1
8080
mv "$(find _skbuild -type d -path "*/cmake-install/docs/docs" | head -n 1)" ~/docs
8181
git clean -dfx
@@ -87,9 +87,9 @@ jobs:
8787
git remote add tokened_docs https://IntelPython:${{ secrets.GITHUB_TOKEN }}@github.com/IntelPython/dpctl.git
8888
git fetch tokened_docs
8989
git checkout --track tokened_docs/gh-pages
90-
echo `pwd`
90+
pwd
9191
cd master
92-
git rm -rf *
92+
git rm -rf ./*
9393
mv ~/docs/* . || exit 1
9494
git add .
9595
git config --global user.name 'github-actions[doc-deploy-bot]'
@@ -112,10 +112,10 @@ jobs:
112112
git remote add tokened_docs https://IntelPython:${{ secrets.GITHUB_TOKEN }}@github.com/IntelPython/dpctl.git
113113
git fetch tokened_docs
114114
git checkout --track tokened_docs/gh-pages
115-
echo `pwd`
116-
[ -d pulls/${PR_NUM} ] && git rm -rf pulls/${PR_NUM}
117-
mkdir -p pulls/${PR_NUM}
118-
cd pulls/${PR_NUM}
115+
pwd
116+
[ -d "pulls/${PR_NUM}" ] && git rm -rf "pulls/${PR_NUM}"
117+
mkdir -p "pulls/${PR_NUM}"
118+
cd "pulls/${PR_NUM}"
119119
mv ~/docs/* .
120120
git add .
121121
git config --global user.name 'github-actions[doc-deploy-bot]'
@@ -131,10 +131,10 @@ jobs:
131131
git remote add tokened_docs https://IntelPython:${{ secrets.GITHUB_TOKEN }}@github.com/IntelPython/dpctl.git
132132
git fetch tokened_docs
133133
git checkout --track tokened_docs/gh-pages
134-
echo `pwd`
134+
pwd
135135
ls
136136
[ -d pulls ] && ls pulls && echo "This is pull/${PR_NUM}"
137-
[ -d pulls/${PR_NUM} ] && git rm -rf pulls/${PR_NUM}
137+
[ -d "pulls/${PR_NUM}" ] && git rm -rf "pulls/${PR_NUM}"
138138
git config --global user.name 'github-actions[doc-deploy-bot]'
139139
git config --global user.email 'github-actions[doc-deploy-bot]@users.noreply.github.com'
140140
git commit -m "Removing docs for closed pull request ${PR_NUM}"

.github/workflows/os-llvm-sycl-build.yml

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,28 +59,35 @@ jobs:
5959
cd sycl_bundle
6060
if [[ "${USE_LATEST_SYCLOS:-0}" -eq "1" ]]; then
6161
# get list of shas and tags from remote, filter nightly tags and reverse order
62-
export LLVM_TAGS=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' https://github.com/intel/llvm.git | \
62+
LLVM_TAGS=$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' https://github.com/intel/llvm.git | \
6363
grep 'refs/tags/nightly-' | awk '{a[i++]=$0} END {for (j=i-1; j>=0;) print a[j--] }')
64+
export LLVM_TAGS
6465
# initialize
6566
unset DEPLOY_NIGHTLY_TAG
6667
unset DEPLOY_NIGHTLY_TAG_SHA
6768
6869
# go through tags and find the most recent one where nighly build binary is available
6970
while IFS= read -r NEXT_LLVM_TAG; do
70-
export NEXT_LLVM_TAG_SHA=$(echo ${NEXT_LLVM_TAG} | awk '{print $1}')
71-
export NEXT_NIGHTLY_TAG=$(python3 -c "import sys, urllib.parse as ul; print (ul.quote_plus(sys.argv[1]))" \
72-
$(echo ${NEXT_LLVM_TAG} | awk '{gsub(/^refs\/tags\//, "", $2)} {print $2}'))
73-
if [[ `wget -S --spider ${DOWNLOAD_URL_PREFIX}/${NEXT_NIGHTLY_TAG}/${ARTIFACT_NAME}.tar.gz 2>&1 | grep 'HTTP/1.1 200 OK'` ]];
71+
NEXT_LLVM_TAG_SHA=$(echo "${NEXT_LLVM_TAG}" | awk '{print $1}')
72+
export NEXT_LLVM_TAG_SHA
73+
NEXT_NIGHTLY_TAG=$(python3 -c "import sys, urllib.parse as ul; print(ul.quote_plus(sys.argv[1]))" \
74+
"$(echo "${NEXT_LLVM_TAG}" | awk '{gsub(/^refs\/tags\//, "", $2)} {print $2}')")
75+
export NEXT_NIGHTLY_TAG
76+
if wget -S --spider "${DOWNLOAD_URL_PREFIX}/${NEXT_NIGHTLY_TAG}/${ARTIFACT_NAME}.tar.gz" 2>&1 | grep -q 'HTTP/1.1 200 OK';
7477
then
75-
export DEPLOY_NIGHTLY_TAG=${NEXT_NIGHTLY_TAG}
76-
export DEPLOY_LLVM_TAG_SHA=${NEXT_LLVM_TAG_SHA}
78+
DEPLOY_NIGHTLY_TAG="${NEXT_NIGHTLY_TAG}"
79+
export DEPLOY_NIGHTLY_TAG
80+
DEPLOY_LLVM_TAG_SHA="${NEXT_LLVM_TAG_SHA}"
81+
export DEPLOY_LLVM_TAG_SHA
7782
break
7883
fi
7984
done <<< "${LLVM_TAGS}"
8085
else
8186
# Use latest known to work tag instead
82-
export DEPLOY_NIGHTLY_TAG="sycl-nightly%2F20230606"
83-
export DEPLOY_LLVM_TAG_SHA=f44d0133d4b0077298f034697a1f3818ff1d6134
87+
DEPLOY_NIGHTLY_TAG="sycl-nightly%2F20230606"
88+
export DEPLOY_NIGHTLY_TAG
89+
DEPLOY_LLVM_TAG_SHA=f44d0133d4b0077298f034697a1f3818ff1d6134
90+
export DEPLOY_LLVM_TAG_SHA
8491
fi
8592
8693
[[ -n "${DEPLOY_NIGHTLY_TAG}" ]] || exit 1
@@ -90,16 +97,20 @@ jobs:
9097
if [[ -f bundle_id.txt && ( "$(cat bundle_id.txt)" == "${DEPLOY_LLVM_TAG_SHA}" ) ]]; then
9198
echo "Using cached download of ${DEPLOY_LLVM_TAG_SHA}"
9299
else
93-
rm -rf ${ARTIFACT_NAME}.tar.gz
94-
wget ${DOWNLOAD_URL_PREFIX}/${DEPLOY_NIGHTLY_TAG}/${ARTIFACT_NAME}.tar.gz && echo ${DEPLOY_LLVM_TAG_SHA} > bundle_id.txt || rm -rf bundle_id.txt
95-
[ -f ${OCLCPUEXP_FN} ] || wget ${DOWNLOAD_URL_PREFIX}/${DRIVER_PATH}/${OCLCPUEXP_FN} || rm -rf bundle_id.txt
96-
[ -f ${TBB_FN} ] || wget ${TBB_URL}/${TBB_FN} || rm -rf bundle_id.txt
100+
rm -rf "${ARTIFACT_NAME}.tar.gz"
101+
if wget "${DOWNLOAD_URL_PREFIX}/${DEPLOY_NIGHTLY_TAG}/${ARTIFACT_NAME}.tar.gz"; then
102+
echo "${DEPLOY_LLVM_TAG_SHA}" > bundle_id.txt
103+
else
104+
rm -rf bundle_id.txt
105+
fi
106+
[ -f "${OCLCPUEXP_FN}" ] || wget "${DOWNLOAD_URL_PREFIX}/${DRIVER_PATH}/${OCLCPUEXP_FN}" || rm -rf bundle_id.txt
107+
[ -f "${TBB_FN}" ] || wget "${TBB_URL}/${TBB_FN}" || rm -rf bundle_id.txt
97108
rm -rf dpcpp_compiler
98109
mkdir -p dpcpp_compiler
99-
tar xf ${ARTIFACT_NAME}.tar.gz -C dpcpp_compiler
110+
tar xf "${ARTIFACT_NAME}.tar.gz" -C dpcpp_compiler
100111
mkdir -p oclcpuexp
101-
[ -d oclcpuexp/x64 ] || tar xf ${OCLCPUEXP_FN} -C oclcpuexp
102-
[ -d ${TBB_INSTALL_DIR}/lib ] || tar xf ${TBB_FN}
112+
[ -d oclcpuexp/x64 ] || tar xf "${OCLCPUEXP_FN}" -C oclcpuexp
113+
[ -d "${TBB_INSTALL_DIR}/lib" ] || tar xf "${TBB_FN}"
103114
cp oclcpuexp/x64/libOpenCL.so* dpcpp_compiler/lib/
104115
fi
105116
@@ -152,7 +163,7 @@ jobs:
152163
run: |
153164
source set_allvars.sh
154165
python scripts/build_locally.py --c-compiler=clang --cxx-compiler=clang++ \
155-
--compiler-root=${SYCL_BUNDLE_FOLDER}/dpcpp_compiler/bin || exit 1
166+
--compiler-root="${SYCL_BUNDLE_FOLDER}/dpcpp_compiler/bin" || exit 1
156167
157168
- name: Run lsplatforms
158169
shell: bash -l {0}

.github/workflows/run-tests-from-dppy-bits.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,39 +35,39 @@ jobs:
3535
steps:
3636
- name: Construct channels line
3737
run: |
38-
echo "CHANNELS=-c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> $GITHUB_ENV
38+
echo "CHANNELS=-c ${{ env.INTEL_CHANNEL }} -c conda-forge --override-channels" >> "$GITHUB_ENV"
3939
4040
- name: Display channels line
4141
run: |
42-
echo ${{ env.CHANNELS }}
42+
echo "${{ env.CHANNELS }}"
4343
4444
- name: Set pkgs_dirs
4545
run: |
4646
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
4747
4848
- name: Install dpctl
4949
run: |
50-
conda create -n ${{ env.TEST_ENV_NAME }} -c dppy/label/dev ${{ env.CHANNELS }} dpctl pytest pytest-cov cython setuptools c-compiler cxx-compiler
50+
conda create -n "${{ env.TEST_ENV_NAME }}" -c dppy/label/dev "${{ env.CHANNELS }}" dpctl pytest pytest-cov cython setuptools c-compiler cxx-compiler
5151
5252
- name: Smoke test
5353
run: |
54-
. $CONDA/etc/profile.d/conda.sh
55-
conda activate ${{ env.TEST_ENV_NAME }}
54+
. "$CONDA/etc/profile.d/conda.sh"
55+
conda activate "${{ env.TEST_ENV_NAME }}"
5656
python -m dpctl -f
5757
5858
- name: Create test temp dir
5959
# create temporary empty folder to runs tests from
6060
# https://github.com/pytest-dev/pytest/issues/11904
61-
run: mkdir -p ${GITHUB_WORKSPACE}/test_tmp
61+
run: mkdir -p "${GITHUB_WORKSPACE}/test_tmp"
6262

6363
- name: Run tests
6464
working-directory: ${{ github.workspace }}/test_tmp
6565
env:
6666
SYCL_CACHE_PERSISTENT: 1
6767
run: |
68-
. $CONDA/etc/profile.d/conda.sh
69-
conda activate ${{ env.TEST_ENV_NAME }}
70-
python -m pytest -v --pyargs $MODULE_NAME
68+
. "$CONDA/etc/profile.d/conda.sh"
69+
conda activate "${{ env.TEST_ENV_NAME }}"
70+
python -m pytest -v --pyargs "${{ env.MODULE_NAME }}"
7171
7272
7373
test_windows:
@@ -94,7 +94,7 @@ jobs:
9494
9595
- name: Display channels line
9696
run: |
97-
echo ${{ env.CHANNELS }}
97+
echo "${{ env.CHANNELS }}"
9898
9999
- uses: conda-incubator/setup-miniconda@fc2d68f6413eb2d87b895e92f8584b5b94a10167 # v3.3.0
100100
with:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ To get the library from the latest oneAPI release, follow the
5757
instructions from Intel(R) [oneAPI installation
5858
guide](https://www.intel.com/content/www/us/en/developer/articles/guide/installation-guide-for-oneapi-toolkits.html).
5959

60-
> **NOTE:** You need to install the Intel(R) oneAPI AI Analytics Tookit to get
60+
> **NOTE:** You need to install the Intel(R) oneAPI AI Analytics Toolkit to get
6161
>IDP and `dpctl`.
6262
6363

cmake/IntelSYCLConfig.cmake

100755100644
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
IntelSYCLConfig
1919
-------
2020
21-
Library to verify SYCL compatability of CMAKE_CXX_COMPILER
21+
Library to verify SYCL compatibility of CMAKE_CXX_COMPILER
2222
and passes relevant compiler flags.
2323
2424
Result Variables
@@ -290,7 +290,7 @@ if(nosycllang)
290290
set(IntelSYCL_NOT_FOUND_MESSAGE "${SYCL_REASON_FAILURE}")
291291
endif()
292292

293-
# Placeholder for identifying various implemenations of SYCL compilers.
293+
# Placeholder for identifying various implementations of SYCL compilers.
294294
# for now, set to the CMAKE_CXX_COMPILER_ID
295295
set(SYCL_IMPLEMENTATION_ID "${CMAKE_CXX_COMPILER_ID}")
296296

conda-recipe/build.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ export LIBRARY_PATH="$LIBRARY_PATH:${BUILD_PREFIX}/lib"
55

66
# Intel LLVM must cooperate with compiler and sysroot from conda
77
echo "--gcc-toolchain=${BUILD_PREFIX} --sysroot=${BUILD_PREFIX}/${HOST}/sysroot -target ${HOST}" > icpx_for_conda.cfg
8-
export ICPXCFG="$(pwd)/icpx_for_conda.cfg"
9-
export ICXCFG="$(pwd)/icpx_for_conda.cfg"
8+
ICPXCFG="$(pwd)/icpx_for_conda.cfg"
9+
export ICPXCFG
10+
ICXCFG="$(pwd)/icpx_for_conda.cfg"
11+
export ICXCFG
1012

1113
read -r GLIBC_MAJOR GLIBC_MINOR <<<"$(conda list '^sysroot_linux-64$' \
1214
| tail -n 1 | awk '{print $2}' | grep -oP '\d+' | head -n 2 | tr '\n' ' ')"

docs/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ option(DPCTL_ENABLE_DOXYREST
44
OFF
55
)
66

7-
# Option to add verion links to the side bar. This option is primarily
7+
# Option to add version links to the side bar. This option is primarily
88
# intended to generate dpctl's docs for our github.io page.
99
option(DPCTL_USE_MULTIVERSION_TEMPLATE
10-
"Enable adding verion links to side bar"
10+
"Enable adding version links to side bar"
1111
OFF
1212
)
1313

docs/_legacy/docfiles/user_guides/QuickStart.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ library.
262262
pushd build || exit 1
263263
264264
INSTALL_PREFIX=$(pwd)/../install
265-
rm -rf ${INSTALL_PREFIX}
265+
rm -rf "${INSTALL_PREFIX}"
266266
export ONEAPI_ROOT=/opt/intel/oneapi
267267
DPCPP_ROOT=${ONEAPI_ROOT}/compiler/latest/linux
268268

0 commit comments

Comments
 (0)