diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d2c2e7e..bda1dea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,39 +24,16 @@ jobs: - name: Install dependencies shell: bash -l {0} run: | - conda install graphviz python=3.11 - pip install pytest pyyaml graphviz coverage - - name: Setup numba_rvsdg + make conda-install + - name: Lint code with pre-commit shell: bash -l {0} run: | - pip install -e . - - name: Run pytest and Generate Report + make lint + - name: Install numba_rvsdg with pip shell: bash -l {0} run: | - coverage run -m pytest numba_rvsdg/tests/ - - name: Display Coverage + make build + - name: Run pytest and print coverage Report shell: bash -l {0} run: | - coverage report - - pre-commit-hook: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup Miniconda - uses: conda-incubator/setup-miniconda@v2 - with: - auto-update-conda: true - auto-activate-base: false - - - name: Install dependencies - shell: bash -l {0} - run: | - conda install python=3.11 pre-commit pyyaml graphviz - - - name: Run pre-commit - shell: bash -l {0} - run: | - pre-commit run -a + make test diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5685c38..76bc860 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: args: ["--py38-plus"] # Black - repo: https://github.com/psf/black - rev: 24.4.0 + rev: 24.4.2 hooks: - id: black language_version: python3 @@ -35,7 +35,7 @@ repos: - id: flake8 # Static Type checking: MyPy - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.9.0 + rev: v1.10.0 hooks: - id: mypy additional_dependencies: diff --git a/makefile b/makefile index 6433fdb..8e0b239 100644 --- a/makefile +++ b/makefile @@ -1,11 +1,17 @@ -.PHONY: build test docs env +.PHONY: build test docs env all +all: + make lint && make build && make test build: python -m pip install -vv -e . test: - pytest --pyargs numba_rvsdg + coverage run -m pytest --pyargs numba_rvsdg + coverage report lint: - pre-commit run --all-files + pre-commit run --verbose --all-files docs: cd docs && make html conda-env: - conda create -n numba-rvsdg python=3.12 python-graphviz pyyaml pytest sphinx sphinx_rtd_theme + conda create -n numba-rvsdg +conda-install: + conda install python=3.12 python-graphviz pyyaml pytest sphinx sphinx_rtd_theme coverage pre-commit + pip install -U virtualenv # needed newer virtualenv not avail. from anaconda.org at time of writing