-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include CHANGELOG LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import re | ||
import shutil | ||
import sys | ||
|
||
from setuptools import setup, find_packages | ||
|
||
shutil.copyfile('imgp', 'imgp.py') | ||
|
||
with open('imgp.py', encoding='utf-8') as f: | ||
version = re.search('_VERSION_ = \'([^\']+)\'', f.read()).group(1) | ||
|
||
with open('README.md', encoding='utf-8') as f: | ||
long_description = f.read() | ||
|
||
setup( | ||
name='imgp', | ||
version=version, | ||
description='High-performance CLI batch image resizer & rotator', | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
author='Arun Prakash Jana', | ||
author_email='[email protected]', | ||
url='https://github.com/jarun/imgp', | ||
license='GPLv3', | ||
python_requires='>=3.5', # requires pip>=9.0.0 | ||
platforms=['any'], | ||
py_modules=['imgp'], | ||
install_requires=['Pillow'], | ||
include_package_data=True, | ||
entry_points={ | ||
'console_scripts': ['imgp=imgp:main'] | ||
}, | ||
extras_require={ | ||
'packaging': ['twine'] | ||
}, | ||
keywords='image processing resize rotate optimize', | ||
classifiers=[ | ||
'Development Status :: 5 - Production/Stable', | ||
'Environment :: Console', | ||
'Intended Audience :: Developers', | ||
'Intended Audience :: End Users/Desktop', | ||
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', | ||
'Natural Language :: English', | ||
'Operating System :: OS Independent', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3 :: Only', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
'Topic :: Utilities' | ||
] | ||
) |
1fc674a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zmwangx or @rachmadaniHaryono I have added the manifest and setup files for PyPI. Please check once. What do I do next to upload to PyPI?
1fc674a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
twine upload --repository-url https://upload.pypi.org/legacy/ dist/imgp*.tar.gz
change the path to actual created file
1fc674a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1fc674a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw I recommend using 2FA and project-scoped API tokens with PyPI (support added earlier this year).
https://pyfound.blogspot.com/2019/07/pypi-now-supports-uploading-via-api.html
1fc674a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ToDo. Let me get away with this first. ;)
1fc674a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to mention: automatically publishing to PyPI with GitHub Actions is pretty nice. https://github.com/pypa/gh-action-pypi-publish
PyPA has an easy-to-follow guide: https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
Here's a recent example in production from yours truly: https://github.com/zmwangx/miller-rabin/blob/master/.github/workflows/build-and-publish-distributions.yml (Way more complicated than what you need, since I'm building a statically-linked C extension there, whereas yours is just pure Python.)
1fc674a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is cool but our build service breaks and once a tag gets uploaded it gets messy. As this is only 1 package and may have a new version in 2021 I am ok to publish manually.
1fc674a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, but if you find yourself maintaining a dozen packages one day with a more rapid release cycle this file and forget (especially for pure Python packages) would come in handy ;)
1fc674a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added to Buku straight from the address bar. ;)
1fc674a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1fc674a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All done! Thanks for the help guys!
1fc674a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rachmadaniHaryono I've added you as second owner on PyPI.