Skip to content

Commit 83b2c4c

Browse files
authored
Merge pull request #5 from mason3k/mason3k-github-actions
Create python-package.yml
2 parents 53a6b65 + 8bcdd3b commit 83b2c4c

File tree

2 files changed

+53
-13
lines changed

2 files changed

+53
-13
lines changed

.github/workflows/python-package.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python package
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version: ["3.10", "3.11"]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v3
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
python -m pip install flake8
31+
python -m pip install ".[test]"
32+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
33+
- name: Lint with flake8
34+
run: |
35+
# stop the build if there are Python syntax errors or undefined names
36+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
37+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
38+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
39+
- name: Test with pytest
40+
run: |
41+
pytest

requirements.txt

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,29 @@
22
# This file is autogenerated by pip-compile with Python 3.12
33
# by the following command:
44
#
5-
# pip-compile --output-file=requirements.txt pyproject.toml
5+
# pip-compile --output-file=requirements.txt
66
#
7-
annotated-types==0.6.0
7+
annotated-types==0.7.0
88
# via pydantic
9-
anyio==3.7.1
10-
# via
11-
# fastapi
12-
# starlette
13-
fastapi==0.105.0
9+
anyio==4.7.0
10+
# via starlette
11+
fastapi==0.115.6
1412
# via fastapi-demo (pyproject.toml)
15-
idna==3.6
13+
idna==3.10
1614
# via anyio
17-
pydantic==2.5.2
15+
pydantic==2.10.4
1816
# via
1917
# fastapi
2018
# fastapi-demo (pyproject.toml)
21-
pydantic-core==2.14.5
19+
pydantic-core==2.27.2
2220
# via pydantic
23-
sniffio==1.3.0
21+
sniffio==1.3.1
2422
# via anyio
25-
starlette==0.27.0
23+
starlette==0.41.3
2624
# via fastapi
27-
typing-extensions==4.9.0
25+
typing-extensions==4.12.2
2826
# via
27+
# anyio
2928
# fastapi
3029
# pydantic
3130
# pydantic-core

0 commit comments

Comments
 (0)