diff options
| author | Mirek Kratochvil <exa.exa@gmail.com> | 2025-10-13 17:54:54 +0200 |
|---|---|---|
| committer | Mirek Kratochvil <exa.exa@gmail.com> | 2025-10-13 17:54:54 +0200 |
| commit | f256ed31ca0cf6ad1cbee8e1e1224d26de7b152a (patch) | |
| tree | f84a491bdc78087f2a9d13d04ea9ffc85ff1f5d6 | |
| parent | 3b1c98e1a52c5d4b27f51fb7016452948ff797a0 (diff) | |
| download | patchodon-f256ed31ca0cf6ad1cbee8e1e1224d26de7b152a.tar.gz patchodon-f256ed31ca0cf6ad1cbee8e1e1224d26de7b152a.tar.bz2 | |
convert to setuptools pkg
| -rw-r--r-- | setup.py | 29 | ||||
| -rw-r--r--[-rwxr-xr-x] | src/patchodon/__init__.py (renamed from patchodon) | 12 | ||||
| -rw-r--r-- | src/patchodon/__main__.py | 4 |
3 files changed, 36 insertions, 9 deletions
diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..5da755b --- /dev/null +++ b/setup.py @@ -0,0 +1,29 @@ +from setuptools import setup + +setup( + name="patchodon", + version="0.1.0", + description="Send and receive git patchsets via Mastodon", + url="https://gitlab.com/exaexa/patchodon", + author="Mirek Kratochvil", + author_email="exa.exa@gmail.com", + license="GPLv3+", + packages=["patchodon"], + install_requires=[ + "requests>=2.25", + "html2text>=2025", + ], + classifiers=[ + "Development Status :: 4 - BetaIntended Audience :: Science/Research", + ( + "License :: OSI Approved :: GNU General Public License v3 or later" + " (GPLv3+)" + ), + "Operating System :: POSIX", + "Operating System :: Unix", + "Programming Language :: Python :: 3", + "Topic :: Communications", + "Topic :: Software Development :: Version Control :: Git", + "Topic :: Utilities", + ], +) diff --git a/patchodon b/src/patchodon/__init__.py index bd668fa..894c071 100755..100644 --- a/patchodon +++ b/src/patchodon/__init__.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +__version__ = "0.1.0" import argparse import hashlib @@ -15,8 +15,6 @@ from pathlib import Path # should specify next hash to provide some kind of a filter # visibility public+unlisted, all unlisted, all private, all direct -VERSION = "0.1.0" - DPASTE_URL = "https://dpaste.com" # TODO any good way to parametrize this? STATUS_LENGTH_LIMIT = 400 # TODO obtain from instance @@ -84,7 +82,7 @@ def do_pastebin_file(file): "title": os.path.basename(file), "expiry_days": 1, # TODO remove after testing }, - headers={"User-agent": f"patchodon v{VERSION}"}, + headers={"User-agent": f"patchodon v{__version__}"}, ) time.sleep(1.1) if r.status_code != 201: @@ -275,7 +273,7 @@ def do_get(args): def main(): ap = argparse.ArgumentParser( prog=sys.argv[0], - epilog="patchodon.py version " + VERSION + " is a free software.", + epilog="patchodon.py version " + __version__ + " is a free software.", description="Publicly send and receive git patch series via Mastodon.", ) @@ -381,7 +379,3 @@ def main(): do_get(args) else: raise ("fatal: args borked") - - -if __name__ == "__main__": - main() diff --git a/src/patchodon/__main__.py b/src/patchodon/__main__.py new file mode 100644 index 0000000..9cba653 --- /dev/null +++ b/src/patchodon/__main__.py @@ -0,0 +1,4 @@ +if __name__ == "__main__": + from .patchodon import main + + main() |
