Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poetry package management, basic github action, isort #9

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/qencode-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: qencode CI

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.x' ]
steps:
- uses: actions/checkout@v1
- name: Configure git
run: |
git config --global user.name 'travis-ci'
git config --global user.email '[email protected]'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade poetry
poetry install
- name: Lint with flake8
run: |
poetry run flake8
- name: Test with pytest
run: |
poetry run py.test --cov=./ --cov-report=xml
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
122 changes: 118 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,130 @@
.env
.DS_Store

*.log
*.sql
*.pyc

.cache/
.vscode/
.idea/
.vim/

.eggs/
build/
dist/
qencode.egg-info/
sample-code/drm/buydrm/keys/user_private_key.pem
sample-code/drm/buydrm/keys/user_public_cert.pem

LONG_DESCRIPTION.md

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# Pip
pip-wheel-metadata/
34 changes: 34 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
PY_FILES= find . -type f -not -path '*/\.*' | grep -i '.*[.]py$$' 2> /dev/null


entr_warn:
@echo "----------------------------------------------------------"
@echo " ! File watching functionality non-operational ! "
@echo " "
@echo "Install entr(1) to automatically run tasks on file change."
@echo "See http://entrproject.org/ "
@echo "----------------------------------------------------------"

isort:
isort `${PY_FILES}`

black:
black `${PY_FILES}` --skip-string-normalization

test:
py.test $(test)

watch_test:
if command -v entr > /dev/null; then ${PY_FILES} | entr -c $(MAKE) test; else $(MAKE) test entr_warn; fi

build_docs:
cd doc && $(MAKE) html

watch_docs:
cd doc && $(MAKE) watch_docs

flake8:
flake8 setup.py sample-code qencode tests

watch_flake8:
if command -v entr > /dev/null; then ${PY_FILES} | entr -c $(MAKE) flake8; else $(MAKE) flake8 entr_warn; fi
Loading