Skip to content

Commit f7840ee

Browse files
Merge pull request #25 from brainelectronics/feature/big-update
Big update session
2 parents b074de4 + f91cb3f commit f7840ee

18 files changed

Lines changed: 161 additions & 61 deletions

.flake8

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
# D400: First line should end with a period
1515
# W504: line break after binary operator -> Cannot break line with a long pathlib Path
1616
# D204: 1 blank line required after class docstring
17-
ignore = D107, D400, W504, D204
17+
# T201: print found
18+
ignore = D107, D400, W504, D204, T201
1819

1920
# Specify a list of mappings of files and the codes that should be ignored for the entirety of the file.
2021
per-file-ignores =
@@ -25,7 +26,7 @@ exclude =
2526
# No need to traverse our git directory
2627
.git,
2728
# Python virtual environments
28-
.venv,
29+
.venv*,
2930
# tox virtual environments
3031
.tox,
3132
# There's no value in checking cache directories

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
name: Upload Python Package
77

8-
on:
8+
on: # yamllint disable-line rule:truthy
99
push:
1010
branches:
1111
- main
@@ -18,12 +18,12 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@v6
2222
with:
2323
# all history is needed to crawl it properly
2424
fetch-depth: 0
2525
- name: Set up Python
26-
uses: actions/setup-python@v5
26+
uses: actions/setup-python@v6
2727
with:
2828
python-version: '3.11'
2929
- name: Install build dependencies
@@ -46,14 +46,14 @@ jobs:
4646
rm dist/*.orig
4747
# sdist call create non conform twine files *.orig, remove them
4848
- name: Publish package
49-
uses: pypa/gh-action-pypi-publish@release/v1.5
49+
uses: pypa/gh-action-pypi-publish@release/v1.13
5050
with:
5151
password: ${{ secrets.PYPI_API_TOKEN }}
5252
skip_existing: true
5353
verbose: true
5454
print_hash: true
5555
- name: 'Create changelog based release'
56-
uses: brainelectronics/changelog-based-release@v1
56+
uses: brainelectronics/changelog-based-release@v1.1.0
5757
with:
5858
# note you'll typically need to create a personal access token
5959
# with permissions to create releases in the other repo

.github/workflows/test-release.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
name: Upload Python Package to test.pypi.org
77

8-
on: [pull_request]
8+
on: [pull_request] # yamllint disable-line rule:truthy
99

1010
permissions:
1111
contents: write
@@ -15,12 +15,12 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@v6
1919
with:
2020
# all history is needed to crawl it properly
2121
fetch-depth: 0
2222
- name: Set up Python
23-
uses: actions/setup-python@v5
23+
uses: actions/setup-python@v6
2424
with:
2525
python-version: '3.11'
2626
- name: Install build dependencies
@@ -47,7 +47,7 @@ jobs:
4747
rm dist/*.orig
4848
twine check dist/*.tar.gz
4949
- name: Archive build package artifact
50-
uses: actions/upload-artifact@v3
50+
uses: actions/upload-artifact@v7
5151
with:
5252
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
5353
# ${{ github.repository }} and ${{ github.ref_name }} can't be used
@@ -56,15 +56,15 @@ jobs:
5656
path: dist/*.tar.gz
5757
retention-days: 14
5858
- name: Publish package
59-
uses: pypa/gh-action-pypi-publish@release/v1.5
59+
uses: pypa/gh-action-pypi-publish@release/v1.13
6060
with:
6161
repository_url: https://test.pypi.org/legacy/
6262
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
6363
skip_existing: true
6464
verbose: true
6565
print_hash: true
6666
- name: 'Create changelog based prerelease'
67-
uses: brainelectronics/changelog-based-release@v1
67+
uses: brainelectronics/changelog-based-release@v1.1.0
6868
with:
6969
# note you'll typically need to create a personal access token
7070
# with permissions to create releases in the other repo

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
name: Test Python package
99

10-
on:
10+
on: # yamllint disable-line rule:truthy
1111
push:
1212
# branches: [ $default-branch ]
1313
branches-ignore:
@@ -26,12 +26,12 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- name: Checkout
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@v6
3030
with:
3131
# all history is needed to crawl it properly
3232
fetch-depth: 0
3333
- name: Set up Python
34-
uses: actions/setup-python@v5
34+
uses: actions/setup-python@v6
3535
with:
3636
python-version: '3.11'
3737
- name: Install test dependencies

.github/workflows/unittest.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
name: Unittest Python Package
77

8-
on: [push, pull_request]
8+
on: [push, pull_request] # yamllint disable-line rule:truthy
99

1010
permissions:
1111
contents: read
@@ -14,8 +14,8 @@ jobs:
1414
test-and-coverage:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v4
18-
- uses: actions/setup-python@v5
17+
- uses: actions/checkout@v6
18+
- uses: actions/setup-python@v6
1919
with:
2020
python-version: '3.11'
2121
- name: Execute tests
@@ -27,7 +27,7 @@ jobs:
2727
run: |
2828
coverage xml
2929
- name: Upload coverage to Codecov
30-
uses: codecov/codecov-action@v3
30+
uses: codecov/codecov-action@v6
3131
with:
3232
token: ${{ secrets.CODECOV_TOKEN }}
3333
files: ./reports/coverage/coverage.xml

.gitignore

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ pymakr.conf
99
config/config*.py
1010
thinking/
1111
*.bin
12-
.idea
1312
*.bak
1413
*.o
1514
.vagrant/
@@ -36,6 +35,7 @@ parts/
3635
sdist/
3736
var/
3837
wheels/
38+
pip-wheel-metadata/
3939
share/python-wheels/
4040
*.egg-info/
4141
.installed.cfg
@@ -102,7 +102,7 @@ ipython_config.py
102102
# pyenv
103103
# For a library or package, you might want to ignore these files since the code is
104104
# intended to run in multiple environments; otherwise, check them in:
105-
# .python-version
105+
.python-version
106106

107107
# pipenv
108108
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
@@ -138,7 +138,7 @@ celerybeat.pid
138138

139139
# Environments
140140
.env
141-
.venv
141+
.venv*
142142
env/
143143
venv/
144144
ENV/
@@ -174,4 +174,4 @@ cython_debug/
174174
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
175175
# and can be added to the global gitignore or merged into this file. For a more nuclear
176176
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
177-
#.idea/
177+
.idea/

.pre-commit-config.yaml

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,44 @@
44
# pip3 install pre-commit
55
# pre-commit install
66
#
7-
default_stages:
8-
- commit
9-
- push
10-
- manual
7+
# Run the hooks on all files with
8+
# 'pre-commit run --all'
9+
#
1110

1211
repos:
13-
- repo: https://github.com/pre-commit/pre-commit-hooks
14-
rev: v2.3.0
15-
hooks:
16-
- id: check-yaml
17-
- id: trailing-whitespace
18-
args: [--markdown-linebreak-ext=md]
1912
- repo: https://github.com/PyCQA/flake8
20-
rev: 5.0.4
13+
rev: 7.3.0
2114
hooks:
2215
- id: flake8
23-
- repo: https://github.com/brainelectronics/micropython-package-validation
24-
rev: 0.5.0
16+
- repo: https://github.com/adrienverge/yamllint.git
17+
rev: v1.38.0
2518
hooks:
26-
- id: upy-package
19+
- id: yamllint
20+
args: [--strict, -c=.yamllint]
21+
- repo: https://github.com/brainelectronics/snippets2changelog
22+
rev: 1.7.0
23+
hooks:
24+
- id: snippets2changelog
2725
args:
28-
- "--setup_file=setup.py"
29-
- "--package_changelog_file=changelog.md"
30-
- "--package_file=package.json"
31-
- "--validate"
26+
- "changelog"
27+
- "changelog.md"
28+
- "--snippets=.snippets"
29+
- "--no-internal"
3230
- repo: https://github.com/brainelectronics/changelog2version
33-
rev: 0.10.0
31+
rev: 0.12.1
3432
hooks:
3533
- id: changelog2version
3634
args:
37-
- "--changelog_file=changelog.md"
35+
- "--changelog_file=changelog.md.new"
3836
- "--version_file=be_upy_blink/version.py"
37+
- "--version_file_type=py"
38+
- "--validate"
39+
- repo: https://github.com/brainelectronics/micropython-package-validation
40+
rev: 0.5.0
41+
hooks:
42+
- id: upy-package
43+
args:
44+
- "--setup_file=setup.py"
45+
- "--package_changelog_file=changelog.md.new"
46+
- "--package_file=package.json"
3947
- "--validate"

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11

.snippets/24.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Update tools, packages and actions
2+
<!--
3+
type: feature
4+
scope: all
5+
affected: all
6+
-->
7+
8+
This change updates all tools, python packages and GitHub actions to their latest version.
9+
10+
The `sdist_upip.py` script does no longer remove the `PKG-INFO` and `LICENSE.txt` files from the root of the created `tar.gz` file to meet the [requirements of PyPI](https://packaging.python.org/en/latest/discussions/package-formats/)
11+
12+
This closes [#24](https://github.com/brainelectronics/micropython-package-template/issues/24)

be_upy_blink/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
22
# -*- coding: UTF-8 -*-
33

4-
__version_info__ = ("0", "10", "0")
4+
__version_info__ = ("0", "11", "0")
55
__version__ = '.'.join(__version_info__)

0 commit comments

Comments
 (0)