diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 51ac29395..cea71dc23 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -11,35 +11,29 @@ jobs:
python-version: ["3.12"]
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Set up Python
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages
run: |
- pip install build numpy wheel setuptools
- pip install -r requirements_exe_build.txt
- python setup.py bdist_wheel
- pip install -e . --no-deps
- pip install cmerg
+ pip install -r requirements_exe_build.txt
+ python -m build --wheel
- name: Build an executable
shell: bash
if: ${{ matrix.python-version == '3.12' }}
run: |
- pip install build numpy wheel setuptools
- pip install -r requirements_exe_build.txt
- python setup.py bdist_wheel
- pip install -e . --no-deps
- pip install cmerg
- pyinstaller asammdf.spec --distpath dist/${RUNNER_OS} --noconfirm --clean
+ pip install -r requirements_exe_build.txt
+ python -m build --wheel
+ pyinstaller asammdf.spec --distpath dist/${RUNNER_OS} --noconfirm --clean
# see: https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
- name: Archive dist artifacts
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
with:
name: dist
path: dist/**
diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml
index 0face9f41..89dc5255d 100644
--- a/.github/workflows/build_linux.yml
+++ b/.github/workflows/build_linux.yml
@@ -11,32 +11,29 @@ jobs:
python-version: ["3.10"]
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Set up Python
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages
run: |
- pip install build numpy wheel
- pip install -r requirements_exe_build.txt
- python setup.py bdist_wheel
- pip install -e . --no-deps
- pip install cmerg
+ pip install -r requirements_exe_build.txt
+ python -m build --wheel
- name: Build an executable
shell: bash
if: ${{ matrix.python-version == '3.10' }}
run: |
- sudo apt update
- sudo apt install libegl1 libopengl0
- pyinstaller asammdf.spec --distpath dist/${RUNNER_OS} --noconfirm --clean
+ sudo apt update
+ sudo apt install libegl1 libopengl0
+ pyinstaller asammdf.spec --distpath dist/${RUNNER_OS} --noconfirm --clean
# see: https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
- name: Archive dist artifacts
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
with:
name: dist
path: dist/**
diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml
index 8589ddf57..3e608810f 100644
--- a/.github/workflows/build_windows.yml
+++ b/.github/workflows/build_windows.yml
@@ -11,35 +11,29 @@ jobs:
python-version: ["3.12"]
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Set up Python
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install packages
run: |
- pip install build numpy wheel setuptools
- pip install -r requirements_exe_build.txt
- python setup.py bdist_wheel
- pip install -e . --no-deps
- pip install cmerg
+ pip install -r requirements_exe_build.txt
+ python -m build --wheel
- name: Build an executable
shell: bash
if: ${{ matrix.python-version == '3.12' }}
run: |
- pip install build numpy wheel setuptools
- pip install -r requirements_exe_build.txt
- python setup.py bdist_wheel
- pip install -e . --no-deps
- pip install cmerg
- pyinstaller asammdf.spec --distpath dist/${RUNNER_OS} --noconfirm --clean
+ pip install -r requirements_exe_build.txt
+ python -m build --wheel
+ pyinstaller asammdf.spec --distpath dist/${RUNNER_OS} --noconfirm --clean
# see: https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
- name: Archive dist artifacts
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@v4
with:
name: dist
path: dist/**
diff --git a/.github/workflows/coveralls.yml b/.github/workflows/coveralls.yml
index cf90dac68..a65d2a41c 100644
--- a/.github/workflows/coveralls.yml
+++ b/.github/workflows/coveralls.yml
@@ -11,10 +11,10 @@ jobs:
runs-on: windows-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Set up Python
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: "3.12"
@@ -22,14 +22,14 @@ jobs:
shell: bash
run: |
pip install tox coveralls
- if [ "$RUNNER_OS" == "Linux" ]; then
- sudo apt update
- sudo apt-get install libegl1 libopengl0
- sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
- sudo apt-get install libxcb-xinerama0
- sudo apt-get install libxkbcommon-x11-0
- sudo apt-get install xorg
- sudo apt-get install -y xvfb
+ if [ "$RUNNER_OS" = "Linux" ]; then
+ sudo apt update
+ sudo apt-get install libegl1 libopengl0
+ sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
+ sudo apt-get install libxcb-xinerama0
+ sudo apt-get install libxkbcommon-x11-0
+ sudo apt-get install xorg
+ sudo apt-get install -y xvfb
fi
- name: Start Xvfb
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 4ddad2b54..48b1c8570 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -4,22 +4,22 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
-on: [ push, pull_request ]
+on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
- os: [ windows-latest, ubuntu-22.04, macos-latest ]
- python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
+ os: [windows-latest, ubuntu-22.04, macos-latest]
+ python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
fail-fast: false
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- name: Set up Python
- uses: actions/setup-python@v4
+ uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
@@ -28,14 +28,14 @@ jobs:
shell: bash
run: |
pip install tox tox-gh-actions
- if [ "$RUNNER_OS" == "Linux" ]; then
- sudo apt update
- sudo apt-get install libegl1 libopengl0
- sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
- sudo apt-get install libxcb-xinerama0
- sudo apt-get install libxkbcommon-x11-0
- sudo apt-get install xorg
- sudo apt-get install -y xvfb
+ if [ "$RUNNER_OS" = "Linux" ]; then
+ sudo apt update
+ sudo apt-get install libegl1 libopengl0
+ sudo apt-get install '^libxcb.*-dev' libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev libxkbcommon-dev libxkbcommon-x11-dev
+ sudo apt-get install libxcb-xinerama0
+ sudo apt-get install libxkbcommon-x11-0
+ sudo apt-get install xorg
+ sudo apt-get install -y xvfb
fi
- name: Start Xvfb
@@ -53,9 +53,9 @@ jobs:
run: tox
- uses: actions/upload-artifact@v4
- if: failure() && matrix.os == 'windows-latest' # 'ubuntu-22.04' or 'windows-latest'
+ if: failure() && matrix.os == 'windows-latest' # 'ubuntu-22.04' or 'windows-latest'
with:
- path: '**/screenshots/**'
+ path: "**/screenshots/**"
name: ${{ matrix.python-version }}
- name: Stop Xvfb
@@ -72,4 +72,3 @@ jobs:
run: |
pip install junitparser
python -c "from ci import report_tests; report_tests(header='## Unit-tests Report:')"
-
diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml
index 7e3b15925..bc48423b5 100644
--- a/.github/workflows/wheels.yml
+++ b/.github/workflows/wheels.yml
@@ -12,10 +12,10 @@ jobs:
fail-fast: false
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
# Used to host cibuildwheel
- - uses: actions/setup-python@v4
+ - uses: actions/setup-python@v5
with:
python-version: "3.10"
@@ -27,29 +27,30 @@ jobs:
env:
CIBW_TEST_COMMAND: "pytest {project}/test --ignore={project}/test/asammdf/gui"
run: |
- if [ "$RUNNER_OS" == "Linux" ]; then
- sudo apt update
- sudo apt-get install libegl1 libopengl0 libxml2 libxml2-dev libxslt1-dev libxslt1.1
+ if [ "$RUNNER_OS" = "Linux" ]; then
+ sudo apt update
+ sudo apt-get install libegl1 libopengl0 libxml2 libxml2-dev libxslt1-dev libxslt1.1
fi
python -m cibuildwheel --output-dir wheelhouse
- - uses: actions/upload-artifact@v3
+ - uses: actions/upload-artifact@v4
with:
+ name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
- - uses: actions/setup-python@v4
+ - uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Build sdist
run: pipx run build --sdist
- - uses: actions/upload-artifact@v3
+ - uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index d88213da6..82e749045 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1,10 +1,10 @@
repos:
- - repo: https://github.com/ambv/black
- rev: 24.1.1
+ - repo: https://github.com/psf/black-pre-commit-mirror
+ rev: 24.10.0
hooks:
- id: black
- - repo: https://github.com/charliermarsh/ruff-pre-commit
- # Ruff version.
- rev: v0.2.0
+ - repo: https://github.com/astral-sh/ruff-pre-commit
+ rev: v0.7.4
hooks:
- - id: ruff
\ No newline at end of file
+ - id: ruff
+ args: [--fix]
diff --git a/.readthedocs.yml b/.readthedocs.yml
index 014b21909..ea06d6d14 100644
--- a/.readthedocs.yml
+++ b/.readthedocs.yml
@@ -19,8 +19,7 @@ formats:
# Optionally set the version of Python and requirements required to build your docs
python:
- version: 3.8
install:
- method: pip
path: .
- - requirements: doc/requirements.txt
\ No newline at end of file
+ - requirements: doc/requirements.txt
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
new file mode 100644
index 000000000..f954697f5
--- /dev/null
+++ b/.vscode/extensions.json
@@ -0,0 +1,20 @@
+{
+ "recommendations": [
+ "benspaulding.python-manifest-template",
+ "charliermarsh.ruff",
+ "esbenp.prettier-vscode",
+ "fill-labs.dependi",
+ "github.vscode-github-actions",
+ "lextudio.restructuredtext",
+ "ms-python.black-formatter",
+ "ms-python.debugpy",
+ "ms-python.python",
+ "ms-python.vscode-pylance",
+ "njpwerner.autodocstring",
+ "redhat.vscode-yaml",
+ "swyddfa.esbonio",
+ "tamasfe.even-better-toml",
+ "trond-snekvik.simple-rst",
+ "twixes.pypi-assistant"
+ ]
+}
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 898031cd7..a7c870b07 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,9 +1,11 @@
-# The basics
+# Contributing
+
+## The basics
Your help is appreciated and welcome!
-The _master_ branch is meant to hold the release code. At any time this should be
-identical to the code available on PyPI.
+The _master_ branch is meant to hold the release code. At any time this should be
+identical to the code available on PyPI.
PR's will be pushed on the _development_ branch if the actual package code is changed. When the time comes this branch
will be merged to the _master_ branch and a new release will be issued.
@@ -11,10 +13,23 @@ will be merged to the _master_ branch and a new release will be issued.
PR's that deal with documentation, and other adjacent files (README for example) can be pushed to the _master_ branch.
When submitting PR's please take into account:
-* the project's goals
-* PEP8 and the style guide below
-# Testing
+- the project's goals
+- PEP8 and the style guide below
+
+## Developer Instructions
+
+Clone the repository, then install the development dependencies (we recommend using a virtual environment):
+
+```bash
+python -m venv .venv # create virtual environment in .venv
+source .venv/bin/activate # activate virtual environment
+pip install --requirement requirements.txt # install development dependencies (includes asammdf in editable mode)
+```
+
+Now you can start developing. If you are using VSCode, the virtual environment should be detected automatically. If not, open the command panel `Ctrl + Shift + P` and search for `Python: Select Interpreter`.
+
+## Testing
You can use tox to run tests locally. Example for the unit tests with Python version 3.10:
@@ -24,8 +39,8 @@ tox -e py310
Otherwise, you can just push and the tests will be run by GitHub Actions.
-# Style guide
+## Style guide
-Just run [*black*](https://black.readthedocs.io) on modified files before sending the PR. There is no need to reinvent the wheel here!
+Just run [_black_](https://black.readthedocs.io) on modified files before sending the PR. There is no need to reinvent the wheel here!
-**Tip**: Add a pre-commit hook with `pip install pre-commit && pre-commit install`
+**Tip**: install Git hooks using pre-commit `pre-commit install --install-hooks`
diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md
index 339640f00..f4f6da30d 100644
--- a/ISSUE_TEMPLATE.md
+++ b/ISSUE_TEMPLATE.md
@@ -1,5 +1,7 @@
# Python version
+
_Please run the following snippet and write the output here_
+
```python
import platform
import sys
@@ -20,20 +22,24 @@ try:
except ImportError:
pass
```
-# Code
- ## MDF version
- _please write here the file version (you can run ``print(MDF(file).version)``)
+# Code
+
+## MDF version
+
+_please write here the file version (you can run `print(MDF(file).version)`)_
+
+## Code snippet
+
+_please write here the code snippet that triggers the error_
+
+## Traceback
+
+_please write here the error traceback_
- ## Code snippet
- _please write here the code snippet that triggers the error_
-
- ## Traceback
- _please write here the error traceback_
-
# Description
-The fastest way to debug is to have the original file. For data protection you can use the static
+The fastest way to debug is to have the original file. For data protection you can use the static
method _scramble_ to scramble all text blocks, and send the scrambled file by e-mail.
_Please describe the issue here._
diff --git a/MANIFEST.in b/MANIFEST.in
index 454d446fa..ae0b7d69a 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,5 +1,4 @@
include LICENSE
-include requirements.txt
recursive-include src/asammdf *.ui
recursive-include src/asammdf *.c
-recursive-include src/asammdf *.qrc
\ No newline at end of file
+recursive-include src/asammdf *.qrc
diff --git a/README.md b/README.md
index 6c139ca17..8d79e5ac5 100644
--- a/README.md
+++ b/README.md
@@ -1,19 +1,26 @@
+#
-
+
-
+_asammdf_ is a fast parser and editor for ASAM (Association for Standardization of Automation and Measuring Systems) MDF (Measurement Data Format) files.
-*asammdf* is a fast parser and editor for ASAM (Association for Standardization of Automation and Measuring Systems) MDF (Measurement Data Format) files.
+_asammdf_ supports MDF versions 2 (.dat), 3 (.mdf) and 4 (.mf4).
-*asammdf* supports MDF versions 2 (.dat), 3 (.mdf) and 4 (.mf4).
+_asammdf_ works on Python >= 3.9
-*asammdf* works on Python >= 3.8
+![PyPI - Downloads](https://img.shields.io/pypi/dm/asammdf)
+![PyPI - License](https://img.shields.io/pypi/l/asammdf)
+![PyPI - Python Version](https://img.shields.io/pypi/pyversions/asammdf)
+![PyPI - Version](https://img.shields.io/pypi/v/asammdf)
+[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
+[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
+[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
-