Skip to content

Commit

Permalink
Merge pull request #843 from xRowe/Improve_Actions
Browse files Browse the repository at this point in the history
Improve Action to Build and PyPi Release
  • Loading branch information
ebroecker authored Feb 18, 2025
2 parents 19adda1 + eed8df8 commit dfe0018
Show file tree
Hide file tree
Showing 14 changed files with 226 additions and 2,535 deletions.
33 changes: 19 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ jobs:
continue-on-error: ${{ matrix.experimental }} # See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
# os: [ubuntu-latest]
# os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest, windows-latest, macos-latest]
experimental: [false]
# python-version: ["2.7","3.4","3.5","3.6","3.7","3.8","3.9","3.10","3.11","3.12"]
python-version: ["3.8","3.9","3.10","3.11","3.12"]
python-version: ["3.8","3.9","3.10","3.11","3.12","3.13"]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down Expand Up @@ -117,36 +117,41 @@ jobs:
# retention-days: 5

build:
name: Packaging
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Build wheel and sdist
run: pipx run build
- name: Check build artifacts
run: pipx run twine check --strict dist/*
- name: Save artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: python-can-dist
name: canmatrix-dist
path: ./dist

upload_pypi:
needs: [build]
name: Release to PyPi
runs-on: ubuntu-latest
permissions:
id-token: write
attestations: write

# upload to PyPI only on release
if: github.event.release && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v4
with:
name: python-can-dist
path: dist
merge-multiple: true

- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
5 changes: 2 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
include versioneer.py
include canmatrix/_version.py
include LICENSE
include LICENSE
recursive-include tests *.py
28 changes: 0 additions & 28 deletions README.md

This file was deleted.

109 changes: 109 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
Canmatrix is a python package to read and write several CAN (Controller Area Network) database formats.
-------------------------------------------------------------------------------------------------------

|pypi| |pypi_version| |codecov| |issues|

.. |pypi| image:: https://img.shields.io/pypi/v/python-can.svg
:target: https://pypi.python.org/pypi/python-can
:alt: Latest Version on PyPi

.. |pypi_version| image:: https://img.shields.io/pypi/pyversions/canmatrix.svg
:target: https://pypi.org/project/canmatrix
:alt: Support Version on PyPi

.. |codecov| image:: https://img.shields.io/codecov/c/github/ebroecker/canmatrix/development.svg
:target: https://codecov.io/gh/ebroecker/canmatrix
:alt: Test coverage reports on Codecov

.. |issues| image:: https://img.shields.io/github/issues-raw/ebroecker/canmatrix.svg
:target: https://github.com/ebroecker/canmatrix/issue
:alt: Current Github Issues

About
-----

**Canmatrix** implements a "Python Can Matrix Object" which describes the can-communication and the needed objects (Boardunits, Frames, Signals, Values, ...)
**Canmatrix** also includes two **Tools** (canconvert and cancompare) for converting and comparing **CAN** databases.

- Multiple formats automotive related communication matrix file parsing.
- CAN message encoding and decoding.

**Supported file formats for import:**

.dbc candb / Vector

.dbf Busmaster (open source!)

.kcd kayak (open source!)

.arxml autosar system description

.yaml dump of the python object

.xls(x) excel xls-import, works with .xls-file generated by this lib

.sym peak pcan can description

.xml (fibex or CANopen eds)

.ldf (lin bus)

.odx (diagnostic file)

.eds


**Supported file formats for export:**

.dbc

.dbf

.kcd

.xls(x)

.json Canard (open source!)

.arxml (very basic implementation)

.yaml (dump of the python object)

.sym

.xml (fibex)

.lua (wireshark script)

.scapy

Project Homepage: https://github.com/ebroecker/canmatrix

Documentation: https://canmatrix.readthedocs.io

Installation
------------

https://canmatrix.readthedocs.io/en/latest/installation.html

`Chinese Translation / 中文安装方法解释及注意事项 <https://github.com/ebroecker/canmatrix/wiki/%E5%AE%89%E8%A3%85%E4%B8%AD%E6%96%87%E6%96%B9%E6%B3%95%E8%A7%A3%E9%87%8A%E5%8F%8A%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9>`_

Contributing
------------

Source Code, Documentation, Examples, Report issues and Any other contributions are **extremely appreciated**.

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request


======

Have Fun,

feel free to contact me for any suggestions

Eduard
6 changes: 0 additions & 6 deletions get_version.py

This file was deleted.

91 changes: 91 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
[build-system]
requires = ["setuptools >= 40.8.0"]
build-backend = "setuptools.build_meta"

[project]
name = "canmatrix"
dynamic = ["readme", "version"]
description = "Automotive Communication Matrix"
authors = [{ name="Eduard Bröcker", email = "[email protected]" }]
maintainers = [{ name = "canmatrix contributors" }]
dependencies = [
"attrs>=19.2.0",
"click",
"importlib-metadata; python_version < '3.8'",
"typing; python_version < '3.5'",
]
requires-python = ">=3.8"
keywords = [
"CAN",
"canbus",
"dbc",
"arxml",
"kcd",
"dbf",
"sym",
"fibex",
"eds",
"automotive",
]
license = { text = "BSD-2-Clause" }
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Information Technology",
"Intended Audience :: Manufacturing",
"Intended Audience :: Telecommunications Industry",
"License :: OSI Approved :: BSD License",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Embedded Systems :: Controller Area Network (CAN)",
"Topic :: System :: Networking",
"Topic :: Utilities",
]

[project.scripts]
cancompare = "canmatrix.cli.compare:cli_compare"
canconvert = "canmatrix.cli.convert:cli_convert"

[project.urls]
homepage = "https://github.com/ebroecker/canmatrix"
documentation = "https://canmatrix.readthedocs.io"
repository = "https://github.com/ebroecker/canmatrix"

[project.optional-dependencies]
arxml = ["lxml"]
csv = []
dbc = []
dbf = []
fibex = ["lxml"]
json = []
kcd = ["lxml"]
ldf = ["ldfparser"]
odx = ["lxml"]
scapy = []
sym = []
test = ["pathlib2; python_version < '3.4'", "pytest"]
wireshark = []
xls = ["xlrd==1.2.0", "xlwt"]
xlsx = ["openpyxl"]
yaml = ["pyyaml"]
eds = ["canopen"]

[tool.setuptools.dynamic]
readme = { file = "README.rst" }
version = {attr = "canmatrix.__version__"}

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-data]
canmatrix = ["j1939.dbc", "py.typed"]
6 changes: 0 additions & 6 deletions setup.cfg

This file was deleted.

Loading

0 comments on commit dfe0018

Please sign in to comment.