From 9a0b8dc912d05a5d710d1956752e4cd46a6d4fe9 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Wed, 24 Aug 2022 23:43:37 +0200 Subject: [PATCH] Moved from setup.py to pyproject.toml and added github publishing action A cut-down version of https://github.com/matmair/brother_ql-inventree/pull/16 - add github publishing action - switch to pyproject.toml - remove unneeded depenencies --- .github/workflows/publish.yml | 31 ++++++++++++++++ pyproject.toml | 54 ++++++++++++++++++++++++++++ setup.py | 67 ----------------------------------- 3 files changed, 85 insertions(+), 67 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..04695cd --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,31 @@ +name: Release to PyPi + +on: + release: + types: [published] + +env: + python_version: 3.8 + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Setup Python ${{ env.python_version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ env.python_version }} + - name: Install Python build dependencies + run: | + pip install setuptools twine build + - name: Build binary + run: | + python3 -m build + - name: Publish tp PyPi + run: python3 -m twine upload dist/* + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + TWINE_REPOSITORY: pypi diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..56ac99f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,54 @@ +[project] +name = "brother_ql" +version = "0.10.0-alpha" +description = "Python package to talk to Brother QL label printers" +readme = "README.md" +authors = [ + { name = "Philipp Klaus", email = "philipp.l.klaus@web.de" } +] +license = { text = "GPL-3.0-only" } +dependencies = [ + "click", + "future", + "packbits", + "pillow>=3.3.0", + "pyusb", + "attrs", + "typing;python_version<'3.5'", + "enum34;python_version<'3.4'", +] +keywords = [ + "Brother", + "QL-500", + "QL-550", + "QL-560", + "QL-570", + "QL-700", + "QL-710W", + "QL-720NW", + "QL-800", + "QL-810W", + "QL-820NWB", + "QL-1050", + "QL-1060N" +] +classifiers = [ + "Development Status :: 4 - Beta", + "Operating System :: OS Independent", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Topic :: Scientific/Engineering :: Visualization", + "Topic :: System :: Hardware :: Hardware Drivers", +] + +[project.scripts] +brother_ql = "brother_ql.cli:cli" +brother_ql_analyse = "brother_ql.brother_ql_analyse:main" +brother_ql_create = "brother_ql.brother_ql_create:main" +brother_ql_print = "brother_ql.brother_ql_print:main" +brother_ql_debug = "brother_ql.brother_ql_debug:main" +brother_ql_info = "brother_ql.brother_ql_info:main" + +[project.urls] +repository = "https://github.com/pklaus/brother_ql" diff --git a/setup.py b/setup.py deleted file mode 100644 index 09be49e..0000000 --- a/setup.py +++ /dev/null @@ -1,67 +0,0 @@ -# -*- coding: utf-8 -*- - -try: - from setuptools import setup -except ImportError: - from distutils.core import setup - -try: - import pypandoc - LDESC = open('README.md', 'r').read() - LDESC = pypandoc.convert(LDESC, 'rst', format='md') -except (ImportError, IOError, RuntimeError) as e: - print("Could not create long description:") - print(str(e)) - LDESC = '' - -setup(name='brother_ql', - version = '0.9.dev0', - description = 'Python package to talk to Brother QL label printers', - long_description = LDESC, - author = 'Philipp Klaus', - author_email = 'philipp.l.klaus@web.de', - url = 'https://github.com/pklaus/brother_ql', - license = 'GPL', - packages = ['brother_ql', - 'brother_ql.backends'], - entry_points = { - 'console_scripts': [ - 'brother_ql = brother_ql.cli:cli', - 'brother_ql_analyse = brother_ql.brother_ql_analyse:main', - 'brother_ql_create = brother_ql.brother_ql_create:main', - 'brother_ql_print = brother_ql.brother_ql_print:main', - 'brother_ql_debug = brother_ql.brother_ql_debug:main', - 'brother_ql_info = brother_ql.brother_ql_info:main', - ], - }, - include_package_data = False, - zip_safe = True, - platforms = 'any', - install_requires = [ - "click", - "future", - "packbits", - "pillow>=3.3.0", - "pyusb", - 'attrs', - 'typing;python_version<"3.5"', - 'enum34;python_version<"3.4"', - ], - extras_require = { - #'brother_ql_analyse': ["matplotlib",], - #'brother_ql_create' : ["matplotlib",], - }, - keywords = 'Brother QL-500 QL-550 QL-560 QL-570 QL-700 QL-710W QL-720NW QL-800 QL-810W QL-820NWB QL-1050 QL-1060N', - classifiers = [ - 'Development Status :: 4 - Beta', - 'Operating System :: OS Independent', - 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Topic :: Scientific/Engineering :: Visualization', - 'Topic :: System :: Hardware :: Hardware Drivers', - ] -) - - -