Skip to content

Commit be88c2a

Browse files
committed
Add pre-commit hooks
And also fix found issues
1 parent 42f6f06 commit be88c2a

14 files changed

+413
-283
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# offer a reasonable automatic best-guess
77

88
# catch-all rule (this only gets matched if no rules below match)
9-
* @dolfinus
9+
* @dolfinus

.github/lock.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ daysUntilLock: 60
88
skipCreatedBefore: false
99

1010
# Issues and pull requests with these labels will be ignored. Set to `[]` to disable
11-
exemptLabels: ['enhancement', 'help wanted']
11+
exemptLabels: [enhancement, help wanted]
1212

1313
# Label to add before locking, such as `outdated`. Set to `false` to disable
14-
lockLabel: ['outdated']
14+
lockLabel: [outdated]
1515

1616
# Comment to post before locking. Set to `false` to disable
1717
lockComment: false
@@ -29,4 +29,4 @@ setLockReason: true
2929
# lockLabel: outdated
3030

3131
# pulls:
32-
# daysUntilLock: 30
32+
# daysUntilLock: 30

.github/no-response.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ daysUntilClose: 30
66
responseRequiredLabel: awaiting response
77
# Comment to post when closing an Issue for lack of response. Set to `false` to disable
88
closeComment: >
9-
This issue has been automatically closed because it has been awaiting a response for too long.
10-
When you have time to to work with the maintainers to resolve this issue, please post a new comment and it will be re-opened.
11-
If the issue has been locked for editing by the time you return to it, please open a new issue and reference this one. Thank you for taking the time to improve setuptools-git-versioning!
9+
This issue has been automatically closed because it has been awaiting a response for too long.
10+
When you have time to to work with the maintainers to resolve this issue, please post a new comment and it will be re-opened.
11+
If the issue has been locked for editing by the time you return to it, please open a new issue and reference this one. Thank you for taking the time to improve setuptools-git-versioning!

.github/workflows/release.yml

+62-62
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Releases
33
on:
44
push:
55
tags:
6-
- v*
6+
- v*
77

88
jobs:
99

@@ -12,17 +12,17 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: fountainhead/[email protected]
16-
id: wait-for-tests
17-
with:
18-
token: ${{ secrets.GITHUB_TOKEN }}
19-
checkName: Tests done
20-
ref: ${{ github.sha }}
21-
timeoutSeconds: 3600
22-
23-
- name: Fail the Build
24-
uses: cutenode/action-always-fail@v1
25-
if: steps.wait-for-tests.outputs.conclusion != 'success'
15+
- uses: fountainhead/[email protected]
16+
id: wait-for-tests
17+
with:
18+
token: ${{ secrets.GITHUB_TOKEN }}
19+
checkName: Tests done
20+
ref: ${{ github.sha }}
21+
timeoutSeconds: 3600
22+
23+
- name: Fail the Build
24+
uses: cutenode/action-always-fail@v1
25+
if: steps.wait-for-tests.outputs.conclusion != 'success'
2626

2727
build:
2828
name: Build package
@@ -33,60 +33,60 @@ jobs:
3333
python-version: ['2.7', '3.6']
3434

3535
steps:
36-
- name: Checkout code
37-
uses: actions/checkout@v2
38-
39-
- name: Inject slug/short variables
40-
uses: rlespinasse/[email protected]
41-
42-
- name: Set up Python ${{ matrix.python-version }}
43-
uses: actions/setup-python@v2
44-
with:
45-
python-version: ${{ matrix.python-version }}
46-
47-
- name: Cache pip
48-
uses: actions/cache@v2
49-
with:
50-
path: ~/.cache/pip
51-
key: ${{ runner.os }}-python-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}
52-
restore-keys: |
53-
${{ runner.os }}-python-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}
54-
${{ runner.os }}-python-${{ matrix.python-version }}-pip-
55-
${{ runner.os }}-python
56-
${{ runner.os }}-
57-
58-
- name: Upgrade pip
59-
run: python -m pip install --upgrade pip setuptools wheel twine
60-
61-
- name: Install dependencies
62-
run: pip install -r requirements.txt
63-
64-
- name: Build package
65-
run: python setup.py bdist_wheel sdist
66-
67-
- name: Check package
68-
run: twine check dist/*
69-
70-
- name: Publish package
71-
env:
72-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
73-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
74-
run: |
75-
twine upload --skip-existing dist/*
36+
- name: Checkout code
37+
uses: actions/checkout@v2
38+
39+
- name: Inject slug/short variables
40+
uses: rlespinasse/[email protected]
41+
42+
- name: Set up Python ${{ matrix.python-version }}
43+
uses: actions/setup-python@v2
44+
with:
45+
python-version: ${{ matrix.python-version }}
46+
47+
- name: Cache pip
48+
uses: actions/cache@v2
49+
with:
50+
path: ~/.cache/pip
51+
key: ${{ runner.os }}-python-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}
52+
restore-keys: |
53+
${{ runner.os }}-python-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}
54+
${{ runner.os }}-python-${{ matrix.python-version }}-pip-
55+
${{ runner.os }}-python
56+
${{ runner.os }}-
57+
58+
- name: Upgrade pip
59+
run: python -m pip install --upgrade pip setuptools wheel twine
60+
61+
- name: Install dependencies
62+
run: pip install -r requirements.txt
63+
64+
- name: Build package
65+
run: python setup.py bdist_wheel sdist
66+
67+
- name: Check package
68+
run: twine check dist/*
69+
70+
- name: Publish package
71+
env:
72+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
73+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
74+
run: |
75+
twine upload --skip-existing dist/*
7676
7777
release:
7878
name: Release version
7979
runs-on: ubuntu-latest
8080
needs: [wait, build]
8181

8282
steps:
83-
- name: Create release
84-
id: create_release
85-
uses: actions/create-release@v1
86-
env:
87-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88-
with:
89-
tag_name: ${{ github.ref }}
90-
release_name: ${{ github.ref }}
91-
draft: false
92-
prerelease: false
83+
- name: Create release
84+
id: create_release
85+
uses: actions/create-release@v1
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
with:
89+
tag_name: ${{ github.ref }}
90+
release_name: ${{ github.ref }}
91+
draft: false
92+
prerelease: false

.github/workflows/test.yml

+44-44
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ jobs:
1414
outputs:
1515
should_skip: ${{ steps.skip_check.outputs.should_skip }}
1616
steps:
17-
- id: skip_check
18-
uses: fkirc/skip-duplicate-actions@master
19-
with:
20-
concurrent_skipping: always
21-
cancel_others: true
22-
skip_after_successful_duplicate: false
23-
paths_ignore: '["**/README.md", "**/LICENSE"]'
24-
do_not_skip: '["pull_request"]'
17+
- id: skip_check
18+
uses: fkirc/skip-duplicate-actions@master
19+
with:
20+
concurrent_skipping: always
21+
cancel_others: true
22+
skip_after_successful_duplicate: false
23+
paths_ignore: '["**/README.md", "**/LICENSE"]'
24+
do_not_skip: '["pull_request"]'
2525

2626
tests:
2727
name: Run tests
@@ -32,55 +32,55 @@ jobs:
3232
python-version: ['2.7', '3.3', '3.4', '3.5', '3.6', '3.7', '3.8', '3.9']
3333

3434
steps:
35-
- name: Checkout code
36-
uses: actions/checkout@v2
35+
- name: Checkout code
36+
uses: actions/checkout@v2
3737

38-
- name: Inject slug/short variables
39-
uses: rlespinasse/[email protected]
38+
- name: Inject slug/short variables
39+
uses: rlespinasse/[email protected]
4040

41-
- name: Set up Python ${{ matrix.python-version }}
42-
uses: actions/setup-python@v2
43-
with:
44-
python-version: ${{ matrix.python-version }}
41+
- name: Set up Python ${{ matrix.python-version }}
42+
uses: actions/setup-python@v2
43+
with:
44+
python-version: ${{ matrix.python-version }}
4545

46-
- name: Cache pip
47-
uses: actions/cache@v2
48-
with:
49-
path: ~/.cache/pip
50-
key: ${{ runner.os }}-python-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}
51-
restore-keys: |
52-
${{ runner.os }}-python-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}
53-
${{ runner.os }}-python-${{ matrix.python-version }}-pip-
54-
${{ runner.os }}-python
55-
${{ runner.os }}-
46+
- name: Cache pip
47+
uses: actions/cache@v2
48+
with:
49+
path: ~/.cache/pip
50+
key: ${{ runner.os }}-python-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}
51+
restore-keys: |
52+
${{ runner.os }}-python-${{ matrix.python-version }}-pip-${{ hashFiles('requirements.txt') }}
53+
${{ runner.os }}-python-${{ matrix.python-version }}-pip-
54+
${{ runner.os }}-python
55+
${{ runner.os }}-
5656
57-
- name: Upgrade pip
58-
run: python -m pip install --upgrade pip setuptools wheel
57+
- name: Upgrade pip
58+
run: python -m pip install --upgrade pip setuptools wheel
5959

60-
- name: Install dependencies
61-
run: pip install -I "flake8<=2.6" -r requirements.txt
62-
if: matrix.python-version == '3.3' || matrix.python-version == '3.4'
60+
- name: Install dependencies
61+
run: pip install -I "flake8<=2.6" -r requirements.txt
62+
if: matrix.python-version == '3.3' || matrix.python-version == '3.4'
6363

64-
- name: Install dependencies
65-
run: pip install "flake8>=3.8" -r requirements.txt
66-
if: matrix.python-version != '3.3' && matrix.python-version != '3.4'
64+
- name: Install dependencies
65+
run: pip install "flake8>=3.8" -r requirements.txt
66+
if: matrix.python-version != '3.3' && matrix.python-version != '3.4'
6767

68-
- name: Run flake8
69-
run: flake8 --count --ignore=F401 --max-line-length=120 .
70-
if: matrix.python-version == '3.3' || matrix.python-version == '3.4'
68+
- name: Run flake8
69+
run: flake8 --count --ignore=F401 --max-line-length=120 .
70+
if: matrix.python-version == '3.3' || matrix.python-version == '3.4'
7171

72-
- name: Run flake8
73-
run: flake8 --count --max-line-length=120 .
74-
if: matrix.python-version != '3.3' && matrix.python-version != '3.4'
72+
- name: Run flake8
73+
run: flake8 --count --max-line-length=120 .
74+
if: matrix.python-version != '3.3' && matrix.python-version != '3.4'
7575

76-
- name: Build package
77-
run: python setup.py bdist_wheel sdist
76+
- name: Build package
77+
run: python setup.py bdist_wheel sdist
7878

7979
all_done:
8080
name: Tests done
8181
runs-on: ubuntu-latest
8282
needs: [tests]
8383

8484
steps:
85-
- name: All done
86-
run: echo 1
85+
- name: All done
86+
run: echo 1

.gitignore

+17-18
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
1-
# VSCode
2-
.vscode/*
1+
!.vscode/extensions.json
2+
!.vscode/launch.json
33
!.vscode/settings.json
44
!.vscode/tasks.json
5-
!.vscode/launch.json
6-
!.vscode/extensions.json
7-
8-
# Python
95
# Byte-compiled / optimized / DLL files
10-
__pycache__/
11-
*.py[cod]
12-
*$py.class
136
# Distribution / packaging
7+
# JetBrains
8+
# Python
9+
# VSCode
10+
*$py.class
11+
*.egg
12+
*.egg-info/
13+
*.py[cod]
1414
.Python
15+
.eggs/
16+
.idea/
17+
.installed.cfg
18+
.vscode/*
19+
MANIFEST
20+
__pycache__/
1521
build/
1622
develop-eggs/
1723
dist/
1824
downloads/
1925
eggs/
20-
.eggs/
2126
lib/
2227
lib64/
2328
parts/
29+
pip-wheel-metadata/
2430
sdist/
31+
share/python-wheels/
2532
var/
2633
wheels/
27-
pip-wheel-metadata/
28-
share/python-wheels/
29-
*.egg-info/
30-
.installed.cfg
31-
*.egg
32-
MANIFEST
33-
# JetBrains
34-
.idea/

0 commit comments

Comments
 (0)