Skip to content

Commit 7799cdd

Browse files
Merge pull request #13 from brainelectronics/feature/add-further-linter-files
Add further linter files
2 parents 8f3cb91 + 56a9975 commit 7799cdd

11 files changed

+246
-178
lines changed

.editorconfig

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
indent_style = space
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
# 4 space indentation
15+
[*.py]
16+
indent_size = 4
17+
18+
[*.yml]
19+
indent_size = 2
20+
21+
[*.{md,rst}]
22+
indent_size = 4
23+
trim_trailing_whitespace = false

.github/workflows/release.yml

+43-41
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# this file is *not* meant to cover or endorse the use of GitHub Actions, but rather to
2-
# help make automated releases for this project
1+
---
2+
3+
# this file is *not* meant to cover or endorse the use of GitHub Actions, but
4+
# rather to help make automated releases for this project
35

46
name: Upload Python Package
57

@@ -15,42 +17,42 @@ jobs:
1517
deploy:
1618
runs-on: ubuntu-latest
1719
steps:
18-
- name: Checkout
19-
uses: actions/checkout@v3
20-
- name: Set up Python
21-
uses: actions/setup-python@v3
22-
with:
23-
python-version: '3.9'
24-
- name: Install build dependencies
25-
run: |
26-
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
27-
- name: Build package
28-
run: |
29-
changelog2version \
30-
--changelog_file changelog.md \
31-
--version_file be_upy_blink/version.py \
32-
--version_file_type py \
33-
--debug
34-
python setup.py sdist
35-
rm dist/*.orig
36-
# sdist call create non conform twine files *.orig, remove them
37-
- name: Publish package
38-
uses: pypa/gh-action-pypi-publish@release/v1.5
39-
with:
40-
password: ${{ secrets.PYPI_API_TOKEN }}
41-
skip_existing: true
42-
verbose: true
43-
print_hash: true
44-
- name: 'Create changelog based release'
45-
uses: brainelectronics/changelog-based-release@v1
46-
with:
47-
# note you'll typically need to create a personal access token
48-
# with permissions to create releases in the other repo
49-
# or you set the "contents" permissions to "write" as in this example
50-
changelog-path: changelog.md
51-
tag-name-prefix: ''
52-
tag-name-extension: ''
53-
release-name-prefix: ''
54-
release-name-extension: ''
55-
draft-release: true
56-
prerelease: false
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
- name: Set up Python
23+
uses: actions/setup-python@v3
24+
with:
25+
python-version: '3.9'
26+
- name: Install build dependencies
27+
run: |
28+
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
29+
- name: Build package
30+
run: |
31+
changelog2version \
32+
--changelog_file changelog.md \
33+
--version_file be_upy_blink/version.py \
34+
--version_file_type py \
35+
--debug
36+
python setup.py sdist
37+
rm dist/*.orig
38+
# sdist call create non conform twine files *.orig, remove them
39+
- name: Publish package
40+
uses: pypa/gh-action-pypi-publish@release/v1.5
41+
with:
42+
password: ${{ secrets.PYPI_API_TOKEN }}
43+
skip_existing: true
44+
verbose: true
45+
print_hash: true
46+
- name: 'Create changelog based release'
47+
uses: brainelectronics/changelog-based-release@v1
48+
with:
49+
# note you'll typically need to create a personal access token
50+
# with permissions to create releases in the other repo
51+
# or you set the "contents" permissions to "write" as in this example
52+
changelog-path: changelog.md
53+
tag-name-prefix: ''
54+
tag-name-extension: ''
55+
release-name-prefix: ''
56+
release-name-extension: ''
57+
draft-release: true
58+
prerelease: false

.github/workflows/test-release.yaml

+57-54
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# this file is *not* meant to cover or endorse the use of GitHub Actions, but rather to
2-
# help make automated releases for this project
1+
---
2+
3+
# this file is *not* meant to cover or endorse the use of GitHub Actions, but
4+
# rather to help make automated test releases for this project
35

46
name: Upload Python Package to test.pypi.org
57

@@ -12,55 +14,56 @@ jobs:
1214
test-deploy:
1315
runs-on: ubuntu-latest
1416
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v3
17-
- name: Set up Python
18-
uses: actions/setup-python@v3
19-
with:
20-
python-version: '3.9'
21-
- name: Install build dependencies
22-
run: |
23-
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
24-
- name: Build package
25-
run: |
26-
changelog2version \
27-
--changelog_file changelog.md \
28-
--version_file be_upy_blink/version.py \
29-
--version_file_type py \
30-
--additional_version_info="-rc${{ github.run_number }}.dev${{ github.event.number }}" \
31-
--debug
32-
python setup.py sdist
33-
- name: Test built package
34-
# sdist call creates non twine conform "*.orig" files, remove them
35-
run: |
36-
rm dist/*.orig
37-
twine check dist/*.tar.gz
38-
- name: Archive build package artifact
39-
uses: actions/upload-artifact@v3
40-
with:
41-
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
42-
# ${{ github.repository }} and ${{ github.ref_name }} can't be used for artifact name due to unallowed '/'
43-
name: dist_repo.${{ github.event.repository.name }}_sha.${{ github.sha }}_build.${{ github.run_number }}
44-
path: dist/*.tar.gz
45-
retention-days: 14
46-
- name: Publish package
47-
uses: pypa/gh-action-pypi-publish@release/v1.5
48-
with:
49-
repository_url: https://test.pypi.org/legacy/
50-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
51-
skip_existing: true
52-
verbose: true
53-
print_hash: true
54-
- name: 'Create changelog based prerelease'
55-
uses: brainelectronics/changelog-based-release@v1
56-
with:
57-
# note you'll typically need to create a personal access token
58-
# with permissions to create releases in the other repo
59-
# or you set the "contents" permissions to "write" as in this example
60-
changelog-path: changelog.md
61-
tag-name-prefix: ''
62-
tag-name-extension: '-rc${{ github.run_number }}.dev${{ github.event.number }}'
63-
release-name-prefix: ''
64-
release-name-extension: '-rc${{ github.run_number }}.dev${{ github.event.number }}'
65-
draft-release: true
66-
prerelease: true
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
- name: Set up Python
20+
uses: actions/setup-python@v3
21+
with:
22+
python-version: '3.9'
23+
- name: Install build dependencies
24+
run: |
25+
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
26+
- name: Build package
27+
run: |
28+
changelog2version \
29+
--changelog_file changelog.md \
30+
--version_file be_upy_blink/version.py \
31+
--version_file_type py \
32+
--additional_version_info="-rc${{ github.run_number }}.dev${{ github.event.number }}" \
33+
--debug
34+
python setup.py sdist
35+
- name: Test built package
36+
# sdist call creates non twine conform "*.orig" files, remove them
37+
run: |
38+
rm dist/*.orig
39+
twine check dist/*.tar.gz
40+
- name: Archive build package artifact
41+
uses: actions/upload-artifact@v3
42+
with:
43+
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
44+
# ${{ github.repository }} and ${{ github.ref_name }} can't be used
45+
# for artifact name due to unallowed '/'
46+
name: dist_repo.${{ github.event.repository.name }}_sha.${{ github.sha }}_build.${{ github.run_number }}
47+
path: dist/*.tar.gz
48+
retention-days: 14
49+
- name: Publish package
50+
uses: pypa/gh-action-pypi-publish@release/v1.5
51+
with:
52+
repository_url: https://test.pypi.org/legacy/
53+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
54+
skip_existing: true
55+
verbose: true
56+
print_hash: true
57+
- name: 'Create changelog based prerelease'
58+
uses: brainelectronics/changelog-based-release@v1
59+
with:
60+
# note you'll typically need to create a personal access token
61+
# with permissions to create releases in the other repo
62+
# or you set the "contents" permissions to "write" as in this example
63+
changelog-path: changelog.md
64+
tag-name-prefix: ''
65+
tag-name-extension: '-rc${{ github.run_number }}.dev${{ github.event.number }}'
66+
release-name-prefix: ''
67+
release-name-extension: '-rc${{ github.run_number }}.dev${{ github.event.number }}'
68+
draft-release: true
69+
prerelease: true

.github/workflows/test.yml

+37-30
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
1+
---
2+
3+
# This workflow will install Python dependencies, run tests and lint with a
4+
# specific Python version
5+
# For more information see:
6+
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
37

48
name: Test Python package
59

@@ -17,31 +21,34 @@ jobs:
1721
build:
1822
runs-on: ubuntu-latest
1923
steps:
20-
- name: Checkout
21-
uses: actions/checkout@v3
22-
- name: Set up Python
23-
uses: actions/setup-python@v3
24-
with:
25-
python-version: '3.9'
26-
- name: Install test dependencies
27-
run: |
28-
pip install -r requirements-test.txt
29-
- name: Lint with flake8
30-
run: |
31-
flake8 .
32-
- name: Install deploy dependencies
33-
run: |
34-
python -m pip install --upgrade pip
35-
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
36-
- name: Build package
37-
run: |
38-
changelog2version \
39-
--changelog_file changelog.md \
40-
--version_file be_upy_blink/version.py \
41-
--version_file_type py \
42-
--debug
43-
python setup.py sdist
44-
rm dist/*.orig
45-
- name: Test built package
46-
run: |
47-
twine check dist/*
24+
- name: Checkout
25+
uses: actions/checkout@v3
26+
- name: Set up Python
27+
uses: actions/setup-python@v3
28+
with:
29+
python-version: '3.9'
30+
- name: Install test dependencies
31+
run: |
32+
pip install -r requirements-test.txt
33+
- name: Lint with flake8
34+
run: |
35+
flake8 .
36+
- name: Lint with yamllint
37+
run: |
38+
yamllint .
39+
- name: Install deploy dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
43+
- name: Build package
44+
run: |
45+
changelog2version \
46+
--changelog_file changelog.md \
47+
--version_file be_upy_blink/version.py \
48+
--version_file_type py \
49+
--debug
50+
python setup.py sdist
51+
rm dist/*.orig
52+
- name: Test built package
53+
run: |
54+
twine check dist/*

.github/workflows/unittest.yaml

+25-23
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# this file is *not* meant to cover or endorse the use of GitHub Actions, but rather to
2-
# help make automated releases for this project
1+
---
2+
3+
# this file is *not* meant to cover or endorse the use of GitHub Actions, but
4+
# rather to help run automated tests for this project
35

46
name: Unittest Python Package
57

@@ -12,24 +14,24 @@ jobs:
1214
test-and-coverage:
1315
runs-on: ubuntu-latest
1416
steps:
15-
- uses: actions/checkout@v3
16-
- uses: actions/setup-python@v3
17-
with:
18-
python-version: '3.9'
19-
- name: Execute tests
20-
run: |
21-
pip install -r requirements-test.txt
22-
python create_report_dirs.py
23-
nose2 --config tests/unittest.cfg
24-
- name: Create coverage report
25-
run: |
26-
coverage xml
27-
- name: Upload coverage to Codecov
28-
uses: codecov/codecov-action@v3
29-
with:
30-
token: ${{ secrets.CODECOV_TOKEN }}
31-
files: ./reports/coverage/coverage.xml
32-
flags: unittests
33-
fail_ci_if_error: true
34-
# path_to_write_report: ./reports/coverage/codecov_report.txt
35-
verbose: true
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-python@v3
19+
with:
20+
python-version: '3.9'
21+
- name: Execute tests
22+
run: |
23+
pip install -r requirements-test.txt
24+
python create_report_dirs.py
25+
nose2 --config tests/unittest.cfg
26+
- name: Create coverage report
27+
run: |
28+
coverage xml
29+
- name: Upload coverage to Codecov
30+
uses: codecov/codecov-action@v3
31+
with:
32+
token: ${{ secrets.CODECOV_TOKEN }}
33+
files: ./reports/coverage/coverage.xml
34+
flags: unittests
35+
fail_ci_if_error: true
36+
# path_to_write_report: ./reports/coverage/codecov_report.txt
37+
verbose: true

.gitignore

-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# created files based on README examples
2-
examples/*.c
3-
examples/*.h
4-
examples/*.py
5-
examples/version_info
6-
71
# custom, package specific ignores
82
.DS_Store
93
.DS_Store?
@@ -16,9 +10,6 @@ thinking/
1610
*.o
1711
.vagrant/
1812

19-
# meson files under development
20-
untitled.meson.build
21-
2213
# Byte-compiled / optimized / DLL files
2314
__pycache__/
2415
*.py[cod]

0 commit comments

Comments
 (0)