Skip to content

Commit 0a4ba07

Browse files
authored
Merge branch 'main' into dev
2 parents 9be8921 + d6a8027 commit 0a4ba07

File tree

4 files changed

+65
-35
lines changed

4 files changed

+65
-35
lines changed

.github/workflows/pep8-push.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: PEP8 check (push)
2+
3+
on: [push]
4+
5+
jobs:
6+
run:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: 'Run PEP8'
11+
uses: quentinguidee/pep8-action@v1
12+
id: run_pep8
13+
with:
14+
arguments: '--max-line-length=79'
15+
continue-on-error: false

.github/workflows/pep8.yml

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# By @quentinguidee, licenced under the MIT license.
2-
31
name: PEP8 check
42

53
on: [pull_request_target]
@@ -9,46 +7,32 @@ jobs:
97
runs-on: ubuntu-latest
108
steps:
119
- uses: actions/checkout@master
12-
- name: Setup Python
13-
uses: actions/setup-python@master
1410
with:
15-
version: 3.8
16-
- name: Download pycodestyle
17-
run: |
18-
pip install pycodestyle
19-
- name: Run pycodestyle
20-
id: run_pycodestyle
21-
run: |
22-
echo "::set-output name=pycodestyle::$(pycodestyle .)"
23-
pycodestyle .
24-
continue-on-error: true
25-
- if: steps.run_pycodestyle.outcome == 'failure'
26-
name: Comment (failure)
27-
uses: actions/github-script@v3
28-
env:
29-
OUTPUT: ${{ steps.run_pycodestyle.outputs.pycodestyle }}
11+
ref: ${{ github.event.pull_request.head.sha }}
12+
- name: 'Run PEP8'
13+
uses: quentinguidee/pep8-action@v1
14+
id: run_pep8
3015
with:
31-
github-token: ${{ secrets.GITHUB_TOKEN }}
32-
script: |
33-
const title = "Beep Beep! I found some formatting errors in this PR: \n"
34-
35-
github.issues.createComment({
36-
issue_number: context.issue.number,
37-
owner: context.repo.owner,
38-
repo: context.repo.repo,
39-
body: title + ' \n``` \n' + process.env.OUTPUT + ' \n```'
40-
})
41-
- if: steps.run_pycodestyle.outcome == 'success'
42-
name: Comment (success)
16+
arguments: '--max-line-length=79'
17+
continue-on-error: true
18+
- name: 'Comment'
4319
uses: actions/github-script@v3
4420
env:
45-
OUTPUT: ${{ steps.run_pycodestyle.outputs.pycodestyle }}
21+
EXIT_CODE: ${{ steps.run_pep8.outputs.exit-code }}
22+
OUTPUT: ${{ steps.run_pep8.outputs.output }}
4623
with:
4724
github-token: ${{ secrets.GITHUB_TOKEN }}
4825
script: |
26+
var message;
27+
if (process.env.EXIT_CODE === '0') {
28+
message = 'Beep Beep! No formatting errors detected! :partying_face:'
29+
} else {
30+
message = 'Beep Beep! I found some formatting errors in this PR: \n'
31+
message += ' \n``` \n' + process.env.OUTPUT + ' \n```'
32+
}
4933
github.issues.createComment({
5034
issue_number: context.issue.number,
5135
owner: context.repo.owner,
5236
repo: context.repo.repo,
53-
body: 'Beep Beep! No formatting errors detected! :partying_face:'
54-
})
37+
body: message,
38+
})
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
name: Upload Python Package
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
deploy:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: '3.x'
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install setuptools wheel twine
25+
- name: Build and publish
26+
env:
27+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
28+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
29+
run: |
30+
python setup.py sdist bdist_wheel
31+
twine upload dist/*

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
author=__author__,
1212
author_email="[email protected]",
1313
description=__doc__,
14-
long_description=open("README.md").read(),
14+
long_description=open("README.md", encoding="utf-8").read(),
1515
install_requires=["windows-curses; platform_system=='Windows'"],
1616
extras_require={"doc": ["sphinx", "sphinx-rtd-theme"]},
1717
include_package_data=True,

0 commit comments

Comments
 (0)