Skip to content

Commit

Permalink
Minor repository updates
Browse files Browse the repository at this point in the history
* `.github/workflows/checks.yaml`:
  * Make `Checks` run for every branch and PR
  * Use glob in `hashFiles`, instead of hard-coded names
  * Use title-case naming for steps
* Rename `.github/workflows/run-tests.yaml` to `.github/workflows/tests.yaml` and `Tests` as title
* Add `-e file:.#egg=pylint-pytest` to `requirements/dev.in`
  * It seems that #33 / a410e15
    does not pick up `pylint`; resulting it being purged from the venv - and the tests failing subsequently
    (see https://github.com/pylint-dev/pylint-pytest/actions/runs/7298965817/job/19891092695?pr=33#step:6:30)
  * Remove the stale `pyproject.toml` + `pip install --no-deps -e .` references from `Makefile`

Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>
  • Loading branch information
stdedos committed Jan 28, 2024
1 parent 1ca1d86 commit b51c82f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ name: Checks

on:
push:
branches:
- master
pull_request:
branches:
- master

env:
CACHE_VERSION: 1
Expand Down Expand Up @@ -43,9 +39,7 @@ jobs:
id: generate-python-key
run: >-
echo "key=${{ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{
hashFiles('pyproject.toml', 'requirements_test.txt',
'requirements_test_min.txt', 'requirements_test_pre_commit.txt') }}" >>
$GITHUB_OUTPUT
hashFiles('pyproject.toml', 'requirements/**.txt') }}" >> $GITHUB_OUTPUT
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v4.0.0
Expand All @@ -66,7 +60,7 @@ jobs:
path: ${{ env.PRE_COMMIT_CACHE }}
key: >-
${{ runner.os }}-${{ steps.generate-pre-commit-key.outputs.key }}
- name: install dependencies
- name: Install Dependencies
if: steps.cache-venv.outputs.cache-hit != 'true'
run: make install

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Testing
name: Tests

on:
push:
Expand Down
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ requirements/dev.txt: .venv requirements/dev.in pyproject.toml
--quiet --generate-hashes --max-rounds=20 --strip-extras \
--resolver=backtracking \
--output-file requirements/dev.txt \
requirements/dev.in pyproject.toml
requirements/dev.in

# upgrades the dependencies to their latest/matching version
.PHONY: upgrade
Expand All @@ -26,14 +26,12 @@ upgrade: .venv
--upgrade \
--resolver=backtracking \
--output-file requirements/dev.txt \
requirements/dev.in pyproject.toml
requirements/dev.in


# creates the venv if not present then install the dependencies, the package and pre-commit
.PHONY: install
install: .venv
pip-sync requirements/dev.txt
# install pylint_pytest (deps are already handled by the line before)
pip install --no-deps -e .
# install pre-commit hooks
pre-commit install
4 changes: 4 additions & 0 deletions requirements/dev.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Install pylint-pytest and its dependencies.
# tl;dr: Install pylint
-e file:.#egg=pylint-pytest

# to handle dependencies
pip-tools
wheel
Expand Down

0 comments on commit b51c82f

Please sign in to comment.