Skip to content

Commit e4e1797

Browse files
authoredFeb 1, 2022
Fix LGTM C++ failure: always use Python3 for lgtm C/C++ (onnx#3981)
* use Python 3 Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
1 parent 7ab600b commit e4e1797

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
 

‎.lgtm.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# By default, C/C++ extraction from LGTM.com uses Python 2
2+
# Add this file to make it use Python 3
3+
# Build protobuf from source with -fPIC is required here to prevent protobuf symbol error
4+
extraction:
5+
cpp:
6+
before_index:
7+
# Always use Python 3
8+
- cp `which python3` $LGTM_WORKSPACE/python
9+
- PATH=$LGTM_WORKSPACE:$PATH
10+
# Build protobuf from source with -fPIC
11+
- git clone https://github.com/protocolbuffers/protobuf.git
12+
- cd protobuf
13+
- git checkout v3.16.0
14+
- git submodule update --init --recursive
15+
- mkdir build_source && cd build_source
16+
# Cannot use sudo so install locally at $HOME/protobuffers
17+
- cmake ../cmake -Dprotobuf_BUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=$HOME/protobuffers -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_POSITION_INDEPENDENT_CODE=ON -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release
18+
- make -j$(nproc)
19+
- make install
20+
- PATH=$HOME/protobuffers/bin:$PATH

‎setup.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ testpaths = onnx/test onnx/examples
99

1010
[metadata]
1111
license_files = LICENSE
12+
classifiers =
13+
Programming Language :: Python :: 3
1214

1315
[flake8]
1416
select = B,C,E,F,P,T4,W,B9

0 commit comments

Comments
 (0)