Skip to content

Commit

Permalink
Pypi workflow added
Browse files Browse the repository at this point in the history
  • Loading branch information
Ultrawipf committed Jul 14, 2024
1 parent df5e652 commit 66f1fd0
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 3 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Publish to PyPI
on: push


jobs:
build:
name: Build distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

publish-to-testpypi:
name: Publish Python to TestPyPI
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/ba63usb

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
5 changes: 3 additions & 2 deletions Example.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ def test():
dev.set_cursor(1,1)
dev.print("Test °äöü€#*\n\rCount")

dev._device.read(32)

for i in range(255):
dev.set_cursor(2,7)
dev.print(f"{i}".ljust(3))
dev.print_at(f"{i}".ljust(3),2,7)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion ba63usb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def set_cursor(self,row : int,col : int):
msg = bytes([0x1B,0x5B,row | 0x30,0x3B,col | 0x30,0x48])
self.transmit(msg)

def print(self,msg : str,row : int,col : int):
def print_at(self,msg : str,row : int,col : int):
"""Prints a message at the specified cursor position (Count starts at 1)"""
self.set_cursor(row,col)
self.print(msg)
Expand Down
23 changes: 23 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"


[project]
name = "ba63usb"
version = "0.1"
authors = [
{ name="Yannick Richter" },
]
description = "Python interface for Nixdorf BA63 USB HID display"
readme = "README.md"
requires-python = ">=3.8"
dependencies = [ "hidapi" ]
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]

[project.urls]
Homepage = "https://github.com/Ultrawipf/ba63usb"

0 comments on commit 66f1fd0

Please sign in to comment.