From 24d52912da3ed7721bae687451059e1019763b57 Mon Sep 17 00:00:00 2001 From: Diego Escalante Urrelo Date: Tue, 9 Mar 2021 20:48:42 -0500 Subject: [PATCH] setup: Add setuptools support Also update the README to explain the new installation option. --- README.md | 30 +++++++++++++++++++++++++++--- pyproject.toml | 6 ++++++ setup.cfg | 35 +++++++++++++++++++++++++++++++++++ setup.py | 3 +++ 4 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 pyproject.toml create mode 100644 setup.cfg create mode 100644 setup.py diff --git a/README.md b/README.md index 41bfe8c..7084385 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,21 @@ # packpath Automatically upload Signal stickers from a given path and YAML configuration + +## Install it + +The package is available in PyPI, through `pip`: +```sh + $ pip3 install packpath +``` + +But you can also simply checkout this repository and run it as a module: +```sh + $ git clone https://github.com/diegoe/packpath.git + $ cd packpath + $ python3 -m packpath (plus arguments, see below) +``` + ## How it works `packpath` reads a path and loads a `config.yaml` file from it to automatically @@ -9,13 +24,19 @@ fill a `signalstickers-client` client, and submit stickers. It subclasses `signalstickers_client.models.LocalStickerPack` to add a `load_path()` method. -The module is meant for command line invocation, but can easily be used -in code: +You need to provide your username and password, as well as the path to a +sticker directory containing a `config.yaml` file. See below for details +on both, or run `packpath --help`: ```sh - $ python3 -m packpath [path] --user [uuid_id] --password [password] + $ packpath --user [uuid_id] --password [password] [path_to_sticker_dir] + + # Most of this README and its instructions are available in the + # command's help: + $ packpath --help ``` + ## YAML format The YAML format is rather simple: @@ -39,6 +60,7 @@ list of filenames to use on your `config.yaml`: $ ls -1 >> config.yaml ``` + ## Signal credentials From https://github.com/signalstickers/signalstickers-client#uploading-a-pack: @@ -50,6 +72,7 @@ From https://github.com/signalstickers/signalstickers-client#uploading-a-pack: The above is also available in `python3 -m packpath --help`. + ## Credits This is a simple wrapper on top of the very handy @@ -57,6 +80,7 @@ This is a simple wrapper on top of the very handy Go check it out. + ## Disclaimer All boiler plate disclaimers apply. But also please be respectful of diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8d91941 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +[build-system] +requires = [ + "setuptools", + "wheel" +] +build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..e4977e8 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,35 @@ +[metadata] +name = packpath +version = attr: packpath.__version__ +description = Automatically upload Signal stickers from a given path and YAML configuration +license = AGPL-3.0-only +author = Diego Escalante Urrelo +author_email = diegoe@gnome.org + +long_description = file: README.md +long_description_content_type = text/markdown + +classifiers = + Development Status :: 4 - Beta + Environment :: Console + Intended Audience :: End Users/Desktop + License :: OSI Approved :: GNU Affero General Public License v3 + Programming Language :: Python :: 3.9 + Programming Language :: Python + Topic :: Communications :: Chat + Topic :: Utilities + +url = https://github.com/diegoe/packpath +project_urls = + GitHub = https://github.com/diegoe/packpath + +[options] +include_package_data = True +packages= find: +install_requires = + signalstickers-client>=3.1.0 + PyYAML>=5.4.1 + +[options.entry_points] +console_scripts = + packpath = packpath.__main__:main diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..6068493 --- /dev/null +++ b/setup.py @@ -0,0 +1,3 @@ +from setuptools import setup + +setup()