Skip to content

Commit 899dd78

Browse files
authored
Merge pull request #223 from joe733/workshop
feat: type hints in utils.py, gh-actions
2 parents 4753db0 + b6255c4 commit 899dd78

File tree

4 files changed

+253
-108
lines changed

4 files changed

+253
-108
lines changed

.github/workflows/main.yml

Lines changed: 48 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,58 @@
1-
name: GH
1+
name: PyCodeQualityAnalysis
22

33
on:
4+
workflow_dispatch:
45
pull_request:
5-
branches: '*'
6+
branches: [master]
67
push:
7-
branches: 'master'
8-
tags: '*'
8+
branches: [master]
99

1010
jobs:
11-
CI:
11+
DevOps:
1212
runs-on: ubuntu-latest
1313
strategy:
14-
max-parallel: 8
14+
fail-fast: true
1515
matrix:
16-
python-version: [3.5, 3.6, 3.7, 3.8, 3.9, 3.10]
16+
python-version: ["3.9", "3.10", "3.11"]
1717
steps:
18-
- uses: actions/checkout@v2
19-
20-
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v2
22-
with:
23-
python-version: ${{ matrix.python-version }}
24-
25-
- name: Pip cache
26-
uses: actions/cache@v2
27-
with:
28-
path: ~/.cache/pip
29-
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements/*.txt') }}
30-
restore-keys: |
31-
${{ runner.os }}-pip-
32-
- name: Install dependencies
33-
run: pip install -e ".[test]"
34-
35-
- name: Lint
36-
run: |
37-
isort --recursive --diff validators tests && isort --recursive --check-only validators tests
38-
flake8 validators tests
39-
40-
- name: Test
41-
run: py.test --doctest-glob="*.rst" --doctest-modules --ignore=setup.py
18+
#----------------------------------------------
19+
# check-out repo and set-up python
20+
#----------------------------------------------
21+
- name: Checkout repository
22+
uses: actions/checkout@v3
23+
- name: Set up Python ${{ matrix.python-version }}
24+
# id: setup-python
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: ${{ matrix.python-version }}
28+
#----------------------------------------------
29+
# install & configure poetry
30+
#----------------------------------------------
31+
- name: Install Poetry
32+
uses: snok/install-poetry@v1
33+
with:
34+
version: 1.3.2
35+
virtualenvs-create: true
36+
virtualenvs-in-project: true
37+
#----------------------------------------------
38+
# load cached venv if cache exists
39+
#----------------------------------------------
40+
# - name: Load cached venv
41+
# id: cached-poetry-dependencies
42+
# uses: actions/cache@v3
43+
# with:
44+
# path: .venv
45+
# key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
46+
#----------------------------------------------
47+
# install dependencies if cache does not exist
48+
#----------------------------------------------
49+
- name: Install dependencies
50+
# if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
51+
run: poetry install --no-interaction --no-root
52+
#----------------------------------------------
53+
# run test suite
54+
#----------------------------------------------
55+
- name: Test
56+
run: |
57+
source .venv/bin/activate
58+
pytest tests/

poetry.lock

Lines changed: 159 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ classifiers = [
2626

2727
[tool.poetry.dependencies]
2828
python = "^3.9"
29-
decorator = "^5.1.1"
3029

3130
[tool.poetry.group.dev.dependencies]
31+
bandit = "^1.7.4"
3232
black = "^23.1.0"
3333
flake8 = "^6.0.0"
34+
pyright = "^1.1.293"
3435
pytest = "^7.2.1"
35-
setuptools = "^67.1.0"
36-
pyright = "^1.1.292"
36+
setuptools = "^67.2.0"
3737

3838
[build-system]
3939
requires = ["poetry-core"]

0 commit comments

Comments
 (0)