Skip to content

Commit

Permalink
Update pip configuration for Python 3
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Syms <[email protected]>
  • Loading branch information
MarkSymsCtx committed Mar 15, 2023
1 parent e1460bf commit 865514a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 36 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- name: Set up Python 2.7
uses: actions/setup-python@v2
- uses: actions/checkout@v3
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: '2.7'
python-version: '3.6'

- name: Install dependencies
run: |
Expand All @@ -20,6 +20,6 @@ jobs:
- name: Test
run: |
PYTHONPATH=./drivers pylint --rcfile=tests/pylintrc ./drivers/*.py
PYTHONPATH=./drivers/ coverage run --branch --source='./drivers,./tests' -m unittest discover -s tests -p "*.py" -v
coverage report --include='./*'
make precheck
PYTHONPATH="./tests/mocks:./drivers/" coverage3 run --branch --source='./drivers,./tests' -m unittest discover -s tests -p "*.py" -v
coverage3 report --include='./*'
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
PYLINT=$(shell command -v pylint-3 || echo pylint)

SM_DRIVERS := File
SM_DRIVERS += NFS
Expand Down Expand Up @@ -96,7 +97,7 @@ precommit: build
CHANGED=$$(git status --porcelain $(SM_PY_FILES) | awk '{print $$2}'); \
for i in $$CHANGED; do \
echo Checking $${i} ...; \
PYTHONPATH=./drivers:$$PYTHONPATH pylint-3 --rcfile=tests/pylintrc $${i}; \
PYTHONPATH=./drivers:$$PYTHONPATH $(PYLINT) --rcfile=tests/pylintrc $${i}; \
[ $$? -ne 0 ] && QUIT=1 ; \
done; \
if [ $$QUIT -ne 0 ]; then \
Expand All @@ -110,7 +111,7 @@ precheck: build
@ QUIT=0; \
for i in $(SM_PY_FILES); do \
echo Checking $${i} ...; \
PYTHONPATH=./drivers:$$PYTHONPATH pylint-3 --rcfile=tests/pylintrc $${i}; \
PYTHONPATH=./drivers:$$PYTHONPATH $(PYLINT) --rcfile=tests/pylintrc $${i}; \
[ $$? -ne 0 ] && QUIT=1 ; \
done; \
if [ $$QUIT -ne 0 ]; then \
Expand Down
7 changes: 2 additions & 5 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
mock==1.0.1
xenapi
coverage
astroid==1.4.9
pylint==1.5
astroid==2.3.3
pylint==2.4.4
bitarray
monotonic
2 changes: 1 addition & 1 deletion tests/run_python_unittests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SMROOT=$(cd "$(dirname "$0")" && cd .. && pwd)

TESTS=tests

COVERAGE="coverage3"
COVERAGE=$(command -v "coverage3" || :)

FILES="*.py"

Expand Down
20 changes: 0 additions & 20 deletions tests/setup_env_for_python_unittests.sh

This file was deleted.

0 comments on commit 865514a

Please sign in to comment.