convert to setuptools pkg
This commit is contained in:
		
							parent
							
								
									3b1c98e1a5
								
							
						
					
					
						commit
						f256ed31ca
					
				
							
								
								
									
										29
									
								
								setup.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								setup.py
									
									
									
									
									
										Normal file
									
								
							|  | @ -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", | ||||||
|  |     ], | ||||||
|  | ) | ||||||
							
								
								
									
										12
									
								
								patchodon → src/patchodon/__init__.py
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										12
									
								
								patchodon → src/patchodon/__init__.py
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							|  | @ -1,4 +1,4 @@ | ||||||
| #!/usr/bin/env python3 | __version__ = "0.1.0" | ||||||
| 
 | 
 | ||||||
| import argparse | import argparse | ||||||
| import hashlib | import hashlib | ||||||
|  | @ -15,8 +15,6 @@ from pathlib import Path | ||||||
| # should specify next hash to provide some kind of a filter | # should specify next hash to provide some kind of a filter | ||||||
| # visibility public+unlisted, all unlisted, all private, all direct | # 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? | DPASTE_URL = "https://dpaste.com"  # TODO any good way to parametrize this? | ||||||
| 
 | 
 | ||||||
| STATUS_LENGTH_LIMIT = 400  # TODO obtain from instance | STATUS_LENGTH_LIMIT = 400  # TODO obtain from instance | ||||||
|  | @ -84,7 +82,7 @@ def do_pastebin_file(file): | ||||||
|             "title": os.path.basename(file), |             "title": os.path.basename(file), | ||||||
|             "expiry_days": 1,  # TODO remove after testing |             "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) |     time.sleep(1.1) | ||||||
|     if r.status_code != 201: |     if r.status_code != 201: | ||||||
|  | @ -275,7 +273,7 @@ def do_get(args): | ||||||
| def main(): | def main(): | ||||||
|     ap = argparse.ArgumentParser( |     ap = argparse.ArgumentParser( | ||||||
|         prog=sys.argv[0], |         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.", |         description="Publicly send and receive git patch series via Mastodon.", | ||||||
|     ) |     ) | ||||||
| 
 | 
 | ||||||
|  | @ -381,7 +379,3 @@ def main(): | ||||||
|         do_get(args) |         do_get(args) | ||||||
|     else: |     else: | ||||||
|         raise ("fatal: args borked") |         raise ("fatal: args borked") | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| if __name__ == "__main__": |  | ||||||
|     main() |  | ||||||
							
								
								
									
										4
									
								
								src/patchodon/__main__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								src/patchodon/__main__.py
									
									
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,4 @@ | ||||||
|  | if __name__ == "__main__": | ||||||
|  |     from .patchodon import main | ||||||
|  | 
 | ||||||
|  |     main() | ||||||
		Loading…
	
		Reference in a new issue