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

v4.0.0 development #79

Closed
wants to merge 21 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
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

## Describe the bug

A clear and concise description of what the bug is.

## To Reproduce

Steps to reproduce the behaviour:

1. Use this code '...'
2. Do the following '....'
3. See error

## Expected behaviour

A clear and concise description of what you expected to happen.

## Screenshots

If applicable, add screenshots to help explain your problem.

## Environment (please complete the following information)

- OS: [e.g. Linux / Windows / macOS / etc.]
- python version: [get by running: `python --version`]
- readchar version: [get by running: `pip show readchar`]

## Additional context

Add any other context about the problem here.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

## Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

## Describe the solution you'd like

A clear and concise description of what you want to happen.

## Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

## Additional context

Add any other context or screenshots about the feature request here.
18 changes: 0 additions & 18 deletions .github/workflows/pre-commit.yml

This file was deleted.

29 changes: 18 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,41 @@
---
# 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:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.x
python-version: '3.x'
cache: pip
- 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/*
90 changes: 71 additions & 19 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,92 @@
# 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:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Run pre-commit
uses: pre-commit/[email protected]

build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
cache: pip
- 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"

- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: pip
- 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@v4
with:
python-version: '3.x'
- 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.27.1
hooks:
- name: check YAML format
id: yamllint
8 changes: 0 additions & 8 deletions .yamllint.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extends: default

ignore: |
.venv/*

rules:
indentation:
spaces: 2
line-length:
max: 120
new-lines:
type: platform
21 changes: 21 additions & 0 deletions LICENCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT Licence

Copyright (c) 2022 Miguel Angel Garcia

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicence, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
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