Skip to content

Commit 86c0bc4

Browse files
authored
bump version, merge pull request #13 from casperdcl/devel
2 parents 113b51e + 49a41a3 commit 86c0bc4

26 files changed

+455
-350
lines changed

.coveragerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
[run]
22
branch = True
3+
include = argopt/*
34
omit =
45
argopt/tests/*
56
argopt/_docopt.py
7+
relative_files = True
68
[report]
79
show_missing = True

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Require maintainer's :+1: for changes to the .github/ repo-config files
2+
# mainly due to https://github.com/probot/settings privilege escalation
3+
.github/* @github/pages

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: casperdcl
2+
custom: https://caspersci.uk.to/donate

.github/workflows/comment-bot.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Comment Bot
2+
on:
3+
issue_comment:
4+
types: [created]
5+
pull_request_review_comment:
6+
types: [created]
7+
jobs:
8+
tag: # /tag <tagname> <commit>
9+
if: startsWith(github.event.comment.body, '/tag ')
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: React Seen
14+
uses: actions/github-script@v2
15+
with:
16+
script: |
17+
const perm = await github.repos.getCollaboratorPermissionLevel({
18+
owner: context.repo.owner, repo: context.repo.repo,
19+
username: context.payload.comment.user.login})
20+
post = (context.eventName == "issue_comment"
21+
? github.reactions.createForIssueComment
22+
: github.reactions.createForPullRequestReviewComment)
23+
if (!["admin", "write"].includes(perm.data.permission)){
24+
post({
25+
owner: context.repo.owner, repo: context.repo.repo,
26+
comment_id: context.payload.comment.id, content: "laugh"})
27+
throw "Permission denied for user " + context.payload.comment.user.login
28+
}
29+
post({
30+
owner: context.repo.owner, repo: context.repo.repo,
31+
comment_id: context.payload.comment.id, content: "eyes"})
32+
- name: Tag Commit
33+
run: |
34+
git clone https://${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} repo
35+
git -C repo tag $(echo "$BODY" | awk '{print $2" "$3}')
36+
git -C repo push --tags
37+
rm -rf repo
38+
env:
39+
BODY: ${{ github.event.comment.body }}
40+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
41+
- name: React Success
42+
uses: actions/github-script@v2
43+
with:
44+
script: |
45+
post = (context.eventName == "issue_comment"
46+
? github.reactions.createForIssueComment
47+
: github.reactions.createForPullRequestReviewComment)
48+
post({
49+
owner: context.repo.owner, repo: context.repo.repo,
50+
comment_id: context.payload.comment.id, content: "rocket"})

.github/workflows/test.yml

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
name: Test
2+
on:
3+
push:
4+
pull_request:
5+
schedule:
6+
- cron: '3 2 1 * *' # M H d m w (monthly at 2:03)
7+
jobs:
8+
check:
9+
if: github.event_name != 'pull_request' || github.head_ref != 'devel'
10+
name: Check
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
- uses: actions/setup-python@v2
17+
with:
18+
python-version: '3.x'
19+
- name: set PYSHA
20+
run: echo "PYSHA=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
21+
- uses: actions/cache@v1
22+
with:
23+
path: ~/.cache/pre-commit
24+
key: pre-commit|${{ env.PYSHA }}|${{ hashFiles('.pre-commit-config.yaml') }}
25+
- name: Test
26+
run: |
27+
pip install -U tox
28+
tox -e setup.py
29+
- name: Self install
30+
run: pip install -U .[dev]
31+
- name: Build
32+
run: |
33+
python setup.py sdist bdist_wheel
34+
twine check dist/*
35+
- uses: reviewdog/action-setup@v1
36+
- if: github.event_name != 'schedule'
37+
name: flake8
38+
run: |
39+
pre-commit run -a flake8 | reviewdog -f=pep8 -name=Format -tee -reporter=github-check -filter-mode nofilter
40+
env:
41+
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
- name: Lint
43+
run: pre-commit run -a --show-diff-on-failure
44+
test:
45+
if: github.event_name != 'pull_request' || github.head_ref != 'devel'
46+
strategy:
47+
matrix:
48+
python: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, pypy3]
49+
name: Python ${{ matrix.python }}
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v2
53+
with:
54+
fetch-depth: 0
55+
- uses: actions/setup-python@v2
56+
with:
57+
python-version: ${{ matrix.python }}
58+
- name: Install
59+
run: pip install -U tox
60+
- name: Test
61+
run: |
62+
if [[ "$PYVER" == py* ]]; then
63+
tox -e $PYVER # basic:pypy
64+
else
65+
tox -e py${PYVER/./} # normal
66+
fi
67+
env:
68+
PYVER: ${{ matrix.python }}
69+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
70+
- name: Coveralls Parallel
71+
uses: AndreMiras/coveralls-python-action@develop
72+
with:
73+
parallel: true
74+
finish:
75+
if: github.event_name != 'pull_request' || github.head_ref != 'devel'
76+
name: Coverage
77+
continue-on-error: ${{ github.event_name != 'push' }}
78+
needs: test
79+
runs-on: ubuntu-latest
80+
steps:
81+
- name: Coveralls Finished
82+
uses: AndreMiras/coveralls-python-action@develop
83+
with:
84+
parallel-finished: true
85+
deploy:
86+
if: github.event_name != 'pull_request' || github.head_ref != 'devel'
87+
name: Deploy
88+
needs: [check, test]
89+
runs-on: ubuntu-latest
90+
steps:
91+
- uses: actions/checkout@v2
92+
with:
93+
fetch-depth: 0
94+
- if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
95+
uses: casperdcl/deploy-pypi@v1
96+
with:
97+
build: true
98+
gpg_key: ${{ secrets.GPG_KEY }}
99+
password: ${{ secrets.PYPI_TOKEN }}
100+
skip_existing: true
101+
- id: collect_assets
102+
name: Collect assets
103+
run: |
104+
echo "::set-output name=asset_path::$(ls dist/*.whl)"
105+
echo "::set-output name=asset_name::$(basename dist/*.whl)"
106+
echo "::set-output name=asset_path_sig::$(ls dist/*.whl.asc 2>/dev/null)"
107+
echo "::set-output name=asset_name_sig::$(basename dist/*.whl.asc 2>/dev/null)"
108+
git log --pretty='format:%d%n- %s%n%b---' $(git tag --sort=v:refname | tail -n2 | head -n1)..HEAD > _CHANGES.md
109+
- if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
110+
id: create_release
111+
uses: actions/create-release@v1
112+
env:
113+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
114+
with:
115+
tag_name: ${{ github.ref }}
116+
release_name: argopt ${{ github.ref }} stable
117+
body_path: _CHANGES.md
118+
draft: true
119+
- if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
120+
uses: actions/upload-release-asset@v1
121+
env:
122+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
123+
with:
124+
upload_url: ${{ steps.create_release.outputs.upload_url }}
125+
asset_path: ${{ steps.collect_assets.outputs.asset_path }}
126+
asset_name: ${{ steps.collect_assets.outputs.asset_name }}
127+
asset_content_type: application/zip
128+
- if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
129+
uses: actions/upload-release-asset@v1
130+
env:
131+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
132+
with:
133+
upload_url: ${{ steps.create_release.outputs.upload_url }}
134+
asset_path: ${{ steps.collect_assets.outputs.asset_path_sig }}
135+
asset_name: ${{ steps.collect_assets.outputs.asset_name_sig }}
136+
asset_content_type: text/plain

.gitignore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
*.py[co]
22
# build
3-
argopt.egg-info/
4-
build/
5-
dist/
3+
/argopt/_dist_ver.py
4+
/.eggs/
5+
/*.egg-info
6+
/build/
7+
/dist/
68
# test
79
.tox/
810
.coverage
9-
__pycache__
11+
__pycache__/

.pre-commit-config.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
default_language_version:
2+
python: python3
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v3.3.0
6+
hooks:
7+
- id: check-added-large-files
8+
- id: check-case-conflict
9+
- id: check-docstring-first
10+
- id: check-executables-have-shebangs
11+
- id: check-toml
12+
- id: check-yaml
13+
- id: end-of-file-fixer
14+
- id: mixed-line-ending
15+
- id: trailing-whitespace
16+
- hooks:
17+
- id: flake8
18+
additional_dependencies:
19+
- flake8-bugbear
20+
- flake8-comprehensions
21+
- flake8-debugger
22+
- flake8-string-format
23+
repo: https://gitlab.com/pycqa/flake8
24+
rev: 3.8.4
25+
- hooks:
26+
- id: isort
27+
repo: https://github.com/timothycrosley/isort
28+
rev: 5.6.4

.travis.yml

Lines changed: 0 additions & 89 deletions
This file was deleted.

MANIFEST.in

Lines changed: 0 additions & 13 deletions
This file was deleted.

Makefile

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
testtimer
2525
distclean
2626
coverclean
27-
pre-commit
2827
prebuildclean
2928
clean
3029
toxclean
@@ -71,15 +70,12 @@ distclean:
7170
@+make coverclean
7271
@+make prebuildclean
7372
@+make clean
74-
pre-commit:
75-
# quick sanity checks
76-
@make testsetup
77-
@flake8 -j 8 --count --statistics .
78-
@make testnose
7973
prebuildclean:
8074
@+python -c "import shutil; shutil.rmtree('build', True)"
8175
@+python -c "import shutil; shutil.rmtree('dist', True)"
8276
@+python -c "import shutil; shutil.rmtree('argopt.egg-info', True)"
77+
@+python -c "import shutil; shutil.rmtree('.eggs', True)"
78+
@+python -c "import os; os.remove('argopt/_dist_ver.py') if os.path.exists('argopt/_dist_ver.py') else None"
8379
coverclean:
8480
@+python -c "import os; os.remove('.coverage') if os.path.exists('.coverage') else None"
8581
@+python -c "import shutil; shutil.rmtree('argopt/__pycache__', True)"

0 commit comments

Comments
 (0)