From 8a9541c4f6288ee3c7d6ff60e84d4e01f87a71c4 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Thu, 22 Aug 2024 20:30:32 +0200 Subject: [PATCH] Changed packaging tooling to hatch. Fixing issues with python build. --- Dockerfile | 2 +- pyproject.toml | 54 ++++++++++++++++++++++++++++++++ setup.py | 29 ----------------- {loaih => src/loaih}/__init__.py | 0 {loaih => src/loaih}/build.py | 0 {loaih => src/loaih}/script.py | 2 ++ src/loaih/version.py | 4 +++ 7 files changed, 61 insertions(+), 30 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.py rename {loaih => src/loaih}/__init__.py (100%) rename {loaih => src/loaih}/build.py (100%) rename {loaih => src/loaih}/script.py (99%) create mode 100644 src/loaih/version.py diff --git a/Dockerfile b/Dockerfile index 176f12e..96dfbe1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9-slim +FROM python:3.9-slim-bullseye RUN pip install loaih ENTRYPOINT [ "/usr/local/bin/loaih" ] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8adcd73 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,54 @@ +# vim:sts=4:sw=4 +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "loaih" +dynamic = ["version"] +authors = [ + { name = "Emiliano Vavassori", email = "syntaxerrormmm@gmail.com" }, +] +description = "LOAIH - LibreOffice AppImage Helpers, help build a LibreOffice AppImage" +readme = "README.md" +license = "MIT" +requires-python = ">= 3.6" +dependencies = [ + "click", + "lxml", + "pyyaml", + "requests", +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.6", + "Environment :: Console", + "Intended Audience :: Developers", + "Intended Audience :: End Users/Desktop", + "Intended Audience :: System Administrators", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Operating System :: POSIX :: Linux", + "Topic :: Office/Business", + "Topic :: Software Development :: Build Tools", + "Topic :: Software Development :: Quality Assurance", + "Topic :: Software Development :: Testing", + "Topic :: Software Development :: User Interfaces" +] + +[project.scripts] +loaih = "loaih.script:cli" + +[project.urls] +Homepage = "https://git.libreitalia.org/LibreItalia/loaih/" + +[tool.hatch.version] +path = "src/loaih/version.py" + +[tool.hatch.build.targets.sdist] +include = [ + "src/loaih", +] diff --git a/setup.py b/setup.py deleted file mode 100644 index 78384ef..0000000 --- a/setup.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python -# encoding: utf-8 -# vim:sts=4:sw=4 -"""Helps building and automatizing building LibreOffice AppImages.""" - -from pathlib import Path -from setuptools import setup, find_packages - -this_directory = Path(__file__).parent -long_description = (this_directory / "README.md").read_text() - -setup( - name="loaih", - version="1.3.3", - description="LOAIH - LibreOffice AppImage Helpers, help build a LibreOffice AppImage", - long_description=long_description, - long_description_content_type='text/markdown', - author="Emiliano Vavassori", - author_email="syntaxerrormmm@libreoffice.org", - packages=find_packages(exclude=['contrib', 'docs', 'tests']), - entry_points={ - 'console_scripts': [ - 'loaih = loaih.script:cli', - ], - }, - install_requires=['click', 'lxml', 'packaging', 'pyyaml', 'requests'], - license='MIT', - url='https://git.libreitalia.org/LibreItalia/loaih/', -) diff --git a/loaih/__init__.py b/src/loaih/__init__.py similarity index 100% rename from loaih/__init__.py rename to src/loaih/__init__.py diff --git a/loaih/build.py b/src/loaih/build.py similarity index 100% rename from loaih/build.py rename to src/loaih/build.py diff --git a/loaih/script.py b/src/loaih/script.py similarity index 99% rename from loaih/script.py rename to src/loaih/script.py index d08a531..536bf90 100644 --- a/loaih/script.py +++ b/src/loaih/script.py @@ -9,10 +9,12 @@ import json import click import yaml import loaih +import loaih.version import loaih.build @click.group() +@click.version_option(loaih.version.version) def cli(): """Helps with command line commands.""" diff --git a/src/loaih/version.py b/src/loaih/version.py new file mode 100644 index 0000000..271bf7c --- /dev/null +++ b/src/loaih/version.py @@ -0,0 +1,4 @@ +#!/usr/bin/env python3 +# encoding: utf-8 + +version = "1.3.3"