Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
# D400: First line should end with a period
# W504: line break after binary operator -> Cannot break line with a long pathlib Path
# D204: 1 blank line required after class docstring
ignore = D107, D400, W504, D204
# T201: print found
ignore = D107, D400, W504, D204, T201

# Specify a list of mappings of files and the codes that should be ignored for the entirety of the file.
per-file-ignores =
Expand All @@ -25,7 +26,7 @@ exclude =
# No need to traverse our git directory
.git,
# Python virtual environments
.venv,
.venv*,
# tox virtual environments
.tox,
# There's no value in checking cache directories
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

name: Upload Python Package

on:
on: # yamllint disable-line rule:truthy
push:
branches:
- main
Expand All @@ -18,12 +18,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
# all history is needed to crawl it properly
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install build dependencies
Expand All @@ -46,14 +46,14 @@ jobs:
rm dist/*.orig
# sdist call create non conform twine files *.orig, remove them
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1.5
uses: pypa/gh-action-pypi-publish@release/v1.13
with:
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
verbose: true
print_hash: true
- name: 'Create changelog based release'
uses: brainelectronics/changelog-based-release@v1
uses: brainelectronics/changelog-based-release@v1.1.0
with:
# note you'll typically need to create a personal access token
# with permissions to create releases in the other repo
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

name: Upload Python Package to test.pypi.org

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

permissions:
contents: write
Expand All @@ -15,12 +15,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
# all history is needed to crawl it properly
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install build dependencies
Expand All @@ -47,7 +47,7 @@ jobs:
rm dist/*.orig
twine check dist/*.tar.gz
- name: Archive build package artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v7
with:
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
# ${{ github.repository }} and ${{ github.ref_name }} can't be used
Expand All @@ -56,15 +56,15 @@ jobs:
path: dist/*.tar.gz
retention-days: 14
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1.5
uses: pypa/gh-action-pypi-publish@release/v1.13
with:
repository_url: https://test.pypi.org/legacy/
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
skip_existing: true
verbose: true
print_hash: true
- name: 'Create changelog based prerelease'
uses: brainelectronics/changelog-based-release@v1
uses: brainelectronics/changelog-based-release@v1.1.0
with:
# note you'll typically need to create a personal access token
# with permissions to create releases in the other repo
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

name: Test Python package

on:
on: # yamllint disable-line rule:truthy
push:
# branches: [ $default-branch ]
branches-ignore:
Expand All @@ -26,12 +26,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
# all history is needed to crawl it properly
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install test dependencies
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/unittest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

name: Unittest Python Package

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

permissions:
contents: read
Expand All @@ -14,8 +14,8 @@ jobs:
test-and-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Execute tests
Expand All @@ -27,7 +27,7 @@ jobs:
run: |
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./reports/coverage/coverage.xml
Expand Down
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ pymakr.conf
config/config*.py
thinking/
*.bin
.idea
*.bak
*.o
.vagrant/
Expand All @@ -36,6 +35,7 @@ parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
Expand Down Expand Up @@ -102,7 +102,7 @@ ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
.python-version

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

# Environments
.env
.venv
.venv*
env/
venv/
ENV/
Expand Down Expand Up @@ -174,4 +174,4 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/
48 changes: 28 additions & 20 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,44 @@
# pip3 install pre-commit
# pre-commit install
#
default_stages:
- commit
- push
- manual
# Run the hooks on all files with
# 'pre-commit run --all'
#

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
rev: 7.3.0
hooks:
- id: flake8
- repo: https://github.com/brainelectronics/micropython-package-validation
rev: 0.5.0
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.38.0
hooks:
- id: upy-package
- id: yamllint
args: [--strict, -c=.yamllint]
- repo: https://github.com/brainelectronics/snippets2changelog
rev: 1.7.0
hooks:
- id: snippets2changelog
args:
- "--setup_file=setup.py"
- "--package_changelog_file=changelog.md"
- "--package_file=package.json"
- "--validate"
- "changelog"
- "changelog.md"
- "--snippets=.snippets"
- "--no-internal"
- repo: https://github.com/brainelectronics/changelog2version
rev: 0.10.0
rev: 0.12.1
hooks:
- id: changelog2version
args:
- "--changelog_file=changelog.md"
- "--changelog_file=changelog.md.new"
- "--version_file=be_upy_blink/version.py"
- "--version_file_type=py"
- "--validate"
- repo: https://github.com/brainelectronics/micropython-package-validation
rev: 0.5.0
hooks:
- id: upy-package
args:
- "--setup_file=setup.py"
- "--package_changelog_file=changelog.md.new"
- "--package_file=package.json"
- "--validate"
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
12 changes: 12 additions & 0 deletions .snippets/24.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Update tools, packages and actions
<!--
type: feature
scope: all
affected: all
-->

This change updates all tools, python packages and GitHub actions to their latest version.

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/)

This closes [#24](https://github.com/brainelectronics/micropython-package-template/issues/24)
2 changes: 1 addition & 1 deletion be_upy_blink/version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-

__version_info__ = ("0", "10", "0")
__version_info__ = ("0", "11", "0")
__version__ = '.'.join(__version_info__)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
]
],
"deps": [],
"version": "0.10.0"
"version": "0.11.0"
}
39 changes: 39 additions & 0 deletions requirements-deploy-lock.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
backports.tarfile==1.2.0
certifi==2026.2.25
cffi==2.0.0
changelog2version==0.12.1
charset-normalizer==3.4.7
cryptography==46.0.6
docutils==0.22.4
gitdb==4.0.12
GitPython==3.1.46
id==1.6.1
idna==3.11
importlib_metadata==9.0.0
jaraco.classes==3.4.0
jaraco.context==6.1.2
jaraco.functools==4.4.0
jeepney==0.9.0
Jinja2==3.1.6
keyring==25.7.0
markdown-it-py==4.0.0
MarkupSafe==3.0.3
mdurl==0.1.2
more-itertools==11.0.1
nh3==0.3.4
packaging==26.0
pycparser==3.0
Pygments==2.20.0
PyYAML==6.0.3
readme_renderer==44.0
requests==2.33.1
requests-toolbelt==1.0.0
rfc3986==2.0.0
rich==14.3.3
SecretStorage==3.5.0
semver==2.13.0
smmap==5.0.3
snippets2changelog==1.7.0
twine==6.2.0
urllib3==2.6.3
zipp==3.23.0
6 changes: 3 additions & 3 deletions requirements-deploy.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# List external packages here
# Avoid fixed versions
# # to upload package to PyPi or other package hosts
twine>=5.1.1,<6
changelog2version>=0.5.0,<1
snippets2changelog>=1.1.0,<2
twine>=6.2.0,<7
changelog2version>=0.12.1,<1
snippets2changelog>=1.6.0,<2
5 changes: 5 additions & 0 deletions requirements-lock.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mpremote==1.28.0
platformdirs==4.9.4
pyserial==3.5
pyudev==0.24.4
rshell==0.0.36
30 changes: 30 additions & 0 deletions requirements-test-lock.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
cfgv==3.5.0
changelog2version==0.12.1
coverage==7.13.5
deepdiff==6.7.1
distlib==0.4.0
filelock==3.25.2
flake8==7.3.0
gitdb==4.0.12
GitPython==3.1.46
identify==2.6.18
Jinja2==3.1.6
MarkupSafe==3.0.3
mccabe==0.7.0
mock==4.0.3
nodeenv==1.10.0
nose2==0.16.0
ordered-set==4.1.0
pathspec==1.0.4
platformdirs==4.9.4
pre_commit==4.5.1
pycodestyle==2.14.0
pyflakes==3.4.0
python-discovery==1.2.1
PyYAML==6.0.3
semver==2.13.0
setup2upypackage==0.5.0
smmap==5.0.3
snippets2changelog==1.7.0
virtualenv==21.2.0
yamllint==1.38.0
Loading
Loading