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
This commit is contained in:
Owais Lone
2021-08-25 02:48:23 +05:30
committed by GitHub
parent d9c0116871
commit cc2529e2cd
4 changed files with 13 additions and 6 deletions

View File

@ -44,8 +44,10 @@ jobs:
# Preserves .tox directory between runs for faster installs
uses: actions/cache@v2
with:
path: .tox
key: v2-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
path: |
.tox
~/.cache/pip
key: v4-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
- name: run tox
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json
- name: Find and merge benchmarks
@ -94,12 +96,17 @@ jobs:
python-version: 3.9
- name: Install tox
run: pip install -U tox
- name: Install libsnappy-dev
if: ${{ matrix.tox-environment == 'lint' }}
run: sudo apt-get install -y libsnappy-dev
- name: Cache tox environment
# Preserves .tox directory between runs for faster installs
uses: actions/cache@v2
with:
path: .tox
key: v2-misc-tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini', 'dev-requirements.txt', 'gen-requirements.txt', 'docs-requirements.txt') }}
path: |
.tox
~/.cache/pip
key: v4-misc-tox-cache-${{ matrix.tox-environment }}-${{ hashFiles('tox.ini', 'dev-requirements.txt', 'gen-requirements.txt', 'docs-requirements.txt') }}
- name: run tox
run: tox -e ${{ matrix.tox-environment }}
- name: Ensure generated code is up to date

1
.python-version Normal file
View File

@ -0,0 +1 @@
3.9.5

View File

@ -1,4 +1,4 @@
pylint~=2.6
pylint<2.10
flake8~=3.7
isort~=5.6
black>=19.3b0,==19.*

View File

@ -345,7 +345,6 @@ deps =
httpretty
commands_pre =
sudo apt-get install libsnappy-dev
python -m pip install {toxinidir}/opentelemetry-python-core/opentelemetry-api
python -m pip install {toxinidir}/opentelemetry-python-core/opentelemetry-semantic-conventions
python -m pip install {toxinidir}/opentelemetry-python-core/opentelemetry-instrumentation[test]