Skip to content

Commit cc2529e

Browse files
authored
Fix tox lint command (#623)
* Fix tox lint command - Move apt-get install command to github actions to run on an ubuntu system only. This keeps tox.ini cross-platform and enabled to run on non-ubuntu systems locally. - Add `-y` flag to apt-get install command so it does not wait for configuration on CI. * Downgrade pylint to 2.9.x * Add pip cache to github actions cache
1 parent d9c0116 commit cc2529e

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

.github/workflows/test.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ jobs:
4444
# Preserves .tox directory between runs for faster installs
4545
uses: actions/cache@v2
4646
with:
47-
path: .tox
48-
key: v2-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
47+
path: |
48+
.tox
49+
~/.cache/pip
50+
key: v4-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
4951
- name: run tox
5052
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json
5153
- name: Find and merge benchmarks
@@ -94,12 +96,17 @@ jobs:
9496
python-version: 3.9
9597
- name: Install tox
9698
run: pip install -U tox
99+
- name: Install libsnappy-dev
100+
if: ${{ matrix.tox-environment == 'lint' }}
101+
run: sudo apt-get install -y libsnappy-dev
97102
- name: Cache tox environment
98103
# Preserves .tox directory between runs for faster installs
99104
uses: actions/cache@v2
100105
with:
101-
path: .tox
102-
key: v2-misc-tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini', 'dev-requirements.txt', 'gen-requirements.txt', 'docs-requirements.txt') }}
106+
path: |
107+
.tox
108+
~/.cache/pip
109+
key: v4-misc-tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini', 'dev-requirements.txt', 'gen-requirements.txt', 'docs-requirements.txt') }}
103110
- name: run tox
104111
run: tox -e ${{ matrix.tox-environment }}
105112
- name: Ensure generated code is up to date

.python-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.9.5

dev-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pylint~=2.6
1+
pylint<2.10
22
flake8~=3.7
33
isort~=5.6
44
black>=19.3b0,==19.*

tox.ini

-1
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,6 @@ deps =
345345
httpretty
346346

347347
commands_pre =
348-
sudo apt-get install libsnappy-dev
349348
python -m pip install {toxinidir}/opentelemetry-python-core/opentelemetry-api
350349
python -m pip install {toxinidir}/opentelemetry-python-core/opentelemetry-semantic-conventions
351350
python -m pip install {toxinidir}/opentelemetry-python-core/opentelemetry-instrumentation[test]

0 commit comments

Comments
 (0)