Skip to content

Commit

Permalink
added dockerfile and github workflow pytest (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
SerhiiStets authored Jan 30, 2024
1 parent 1ca5097 commit 004a4f2
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Set PYTHONPATH
run: export PYTHONPATH=${PYTHONPATH}:$(pwd)
- name: Print Python Path
run: python -c "import sys; print(sys.path)"
- name: Test with pytest
run: |
coverage run -m --source=skylab,tests pytest
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3.9

WORKDIR ./app

COPY . .

RUN pip install -r requirements.txt
RUN pip install -e .

CMD [ "skylab" ]
39 changes: 39 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
aiohttp==3.8.4 ; python_version >= "3.9" and python_version < "4.0"
aiosignal==1.3.1 ; python_version >= "3.9" and python_version < "4.0"
async-timeout==4.0.2 ; python_version >= "3.9" and python_version < "4.0"
attrs==23.1.0 ; python_version >= "3.9" and python_version < "4.0"
certifi==2022.12.7 ; python_version >= "3.9" and python_version < "4"
charset-normalizer==3.1.0 ; python_version >= "3.9" and python_version < "4"
click==8.1.3 ; python_version >= "3.9" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.9" and python_version < "4.0" and (sys_platform == "win32" or platform_system == "Windows")
coverage[toml]==7.2.3 ; python_version >= "3.9" and python_version < "4.0"
exceptiongroup==1.1.1 ; python_version >= "3.9" and python_version < "3.11"
frozenlist==1.3.3 ; python_version >= "3.9" and python_version < "4.0"
idna==3.4 ; python_version >= "3.9" and python_version < "4"
importlib-metadata==4.13.0 ; python_version >= "3.9" and python_version < "4.0"
iniconfig==2.0.0 ; python_version >= "3.9" and python_version < "4.0"
linkify-it-py==2.0.2 ; python_version >= "3.9" and python_version < "4.0"
markdown-it-py==2.2.0 ; python_version >= "3.9" and python_version < "4.0"
markdown-it-py[linkify,plugins]==2.2.0 ; python_version >= "3.9" and python_version < "4.0"
mdit-py-plugins==0.3.5 ; python_version >= "3.9" and python_version < "4.0"
mdurl==0.1.2 ; python_version >= "3.9" and python_version < "4.0"
msgpack==1.0.5 ; python_version >= "3.9" and python_version < "4.0"
multidict==6.0.4 ; python_version >= "3.9" and python_version < "4.0"
packaging==23.1 ; python_version >= "3.9" and python_version < "4.0"
pluggy==1.0.0 ; python_version >= "3.9" and python_version < "4.0"
pydantic==1.10.7 ; python_version >= "3.9" and python_version < "4.0"
pygments==2.15.0 ; python_version >= "3.9" and python_version < "4.0"
pytest-cov==4.0.0 ; python_version >= "3.9" and python_version < "4.0"
pytest==7.3.1 ; python_version >= "3.9" and python_version < "4.0"
pytz-deprecation-shim==0.1.0.post0 ; python_version >= "3.9" and python_version < "4.0"
requests==2.28.2 ; python_version >= "3.9" and python_version < "4"
rich==13.3.4 ; python_version >= "3.9" and python_version < "4.0"
textual[dev]==0.19.1 ; python_version >= "3.9" and python_version < "4.0"
tomli==2.0.1 ; python_version >= "3.9" and python_full_version <= "3.11.0a6"
typing-extensions==4.5.0 ; python_version >= "3.9" and python_version < "4.0"
tzdata==2023.3 ; python_version >= "3.9" and python_version < "4.0"
tzlocal==4.3 ; python_version >= "3.9" and python_version < "4.0"
uc-micro-py==1.0.2 ; python_version >= "3.9" and python_version < "4.0"
urllib3==1.26.15 ; python_version >= "3.9" and python_version < "4"
yarl==1.8.2 ; python_version >= "3.9" and python_version < "4.0"
zipp==3.15.0 ; python_version >= "3.9" and python_version < "4.0"

0 comments on commit 004a4f2

Please sign in to comment.