Skip to content

Linux: Handeling multithreading and better terminal settup #82

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

Closed
wants to merge 20 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[run]
omit = */tests*
omit = tests/*
11 changes: 10 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
[flake8]
max-line-length=119
exclude =
__pycache__/
.git/
.venv/
.pytest_cache/
show-source = true
statistics = true
count = true
max-complexity = 12
max-line-length = 88
18 changes: 0 additions & 18 deletions .github/workflows/pre-commit.yml

This file was deleted.

20 changes: 12 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
# This workflow will upload a Python Package using Twine when a release is
# created
# This workflow will upload a Python Package using Twine
# For more information see:
# https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [created]
push:
tags:
- 'v*.*.*'

jobs:
deploy:

deploy:
runs-on: ubuntu-latest

steps:
Expand All @@ -23,12 +23,16 @@ jobs:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
- name: Write Version
run: |
sed -i "s/__version__ = .*/__version__ = '${GITHUB_REF#refs/*/v}'/" readchar/__init__.py
- name: Build sdist and bdist_wheel
run: |
python setup.py sdist bdist_wheel
- name: publish to PyPi
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
64 changes: 52 additions & 12 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,45 @@
# For more information see:
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package
name: Tests

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


jobs:
build:

pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: |
pip install setuptools wheel
- run: |
python setup.py sdist bdist_wheel

pytest:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
python-version:
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -36,8 +51,33 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-test.txt
pip install -r requirements.txt
pip install coveralls
pip install -e .
- name: Test with pytest
run: |
pytest
- name: Coverage upload
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: ${{ join(matrix.*, ',') }}
run: |
coveralls --service=github

finish-coveralls:
needs: pytest
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install coveralls
- name: Coverage finish
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
run: |
coveralls --service=github --finish
18 changes: 13 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
*~
\#*
\.\#*

# Python Files
/.venv/
__pychache__/
*.pyc

# Build files:
/build/
/dist/
*.egg-info/
build/
dist/
venv/
.coverage
coverage.xml
.eggs
*.egg

# Testing files:
/.pytest_cache/
.coverage
coverage.xml
27 changes: 13 additions & 14 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
---
repos:
- repo: https://github.com/adrienverge/yamllint
rev: v1.26.3
hooks:
- name: check YAML format
id: yamllint

- repo: https://github.com/psf/black
rev: 22.1.0
rev: 22.6.0
hooks:
- name: re-format with black
id: black
language_version: python3

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.3.0
hooks:
- name: remove whitespaces
id: trailing-whitespace
- name: add newline to end of files
id: end-of-file-fixer

- repo: https://gitlab.com/pycqa/flake8
rev: 21d3c70d676007470908d39b73f0521d39b3b997
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- name: check-format with flake8
id: flake8
args:
- --show-source
- --statistics
- --count
- --max-complexity=12

- repo: https://github.com/adrienverge/yamllint
rev: v1.26.3
hooks:
- name: check YAML format
id: yamllint
8 changes: 5 additions & 3 deletions .yamllint.yaml → .yamllint.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
extends: default

ignore: |
.venv/*

rules:
truthy:
ignore: |
.github/workflows/*
indentation:
spaces: 2
line-length:
max: 120
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
all: precommit test
all: test precommit pack

test:
python setup.py test
@pytest

precommit::
pre-commit run -a
precommit:
@pre-commit run -a

publish:
@python setup.py bdist_wheel upload
pack:
@python setup.py sdist bdist_wheel
Loading