diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 0000000..3e4a877 --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,8 @@ +[bumpversion] +current_version = 0.0.0 +files = setup.py imagecast/__init__.py +commit = True +tag = True +tag_name = {new_version} +allow_dirty = True + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..104ac0c --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +.DS_Store +/.idea +/.venv* +/dist* +/build +*.pyc +*.egg-info +.pytest_cache +.pytest_results +.coverage +.tox diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e4fff1e --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +include util.mk + +# make release bump=minor (major,minor,patch) diff --git a/requirements-release.txt b/requirements-release.txt new file mode 100644 index 0000000..757b6a5 --- /dev/null +++ b/requirements-release.txt @@ -0,0 +1,3 @@ +bump2version==0.5.10 +twine==1.13.0 +keyring==19.0.2 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..6d6bd9a --- /dev/null +++ b/setup.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +import os +from setuptools import setup, find_packages + +here = os.path.abspath(os.path.dirname(__file__)) +README = open(os.path.join(here, 'README.rst')).read() + +setup(name='imagecast', + version='0.0.0', + description='Imagecast modifies images, optionally serving them via HTTP API', + long_description=README, + license="AGPL 3, EUPL 1.2", + classifiers=[ + "Programming Language :: Python", + "License :: OSI Approved :: GNU Affero General Public License v3", + "License :: OSI Approved :: European Union Public Licence 1.2 (EUPL 1.2)", + "Development Status :: 3 - Alpha", + "Environment :: Console", + "Environment :: Web Environment", + "Intended Audience :: Developers", + "Intended Audience :: Education", + "Intended Audience :: Information Technology", + "Intended Audience :: Manufacturing", + "Intended Audience :: Science/Research", + "Intended Audience :: System Administrators", + "Intended Audience :: Telecommunications Industry", + "Topic :: Communications", + "Topic :: Internet", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Scientific/Engineering :: Human Machine Interfaces", + "Topic :: Scientific/Engineering :: Information Analysis", + "Topic :: Scientific/Engineering :: Interface Engine/Protocol Translator", + "Topic :: Software Development :: Embedded Systems", + "Topic :: Software Development :: Libraries", + "Topic :: System :: Archiving", + "Topic :: Utilities", + "Operating System :: POSIX", + "Operating System :: Unix", + "Operating System :: MacOS" + ], + author='Andreas Motl', + author_email='andreas.motl@panodata.org', + url='https://github.com/panodata/imagecast', + keywords='image conversion http api proxy', + packages=find_packages(), + include_package_data=True, + package_data={ + }, + zip_safe=False, + install_requires=[ + 'docopt==0.6.2', + 'munch==2.3.2', + 'Pillow==7.1.2', + 'requests==2.23.0', + ], + extras_require={ + 'service': [ + 'fastapi==0.55.1', + 'uvicorn==0.11.5', + ], + }, + entry_points={ + 'console_scripts': [ + 'imagecast = imagecast.cli:run', + ], + }, +) diff --git a/util.mk b/util.mk new file mode 100644 index 0000000..772eb67 --- /dev/null +++ b/util.mk @@ -0,0 +1,47 @@ +# ============ +# Main targets +# ============ + + +# ------------- +# Configuration +# ------------- + +$(eval venvpath := .venv_util) +$(eval pip := $(venvpath)/bin/pip) +$(eval python := $(venvpath)/bin/python) +$(eval bumpversion := $(venvpath)/bin/bumpversion) +$(eval twine := $(venvpath)/bin/twine) + +# Setup Python virtualenv +setup-virtualenv: + @test -e $(python) || `command -v virtualenv` --python=python3 --no-site-packages $(venvpath) + + +# ------- +# Release +# ------- + +# Release this piece of software +# Synopsis: +# make release bump=minor (major,minor,patch) +release: bumpversion push sdist pypi-upload + + +# =============== +# Utility targets +# =============== +bumpversion: install-releasetools + @$(bumpversion) $(bump) + +push: + git push && git push --tags + +sdist: + @$(python) setup.py sdist + +pypi-upload: install-releasetools + twine upload --skip-existing --verbose dist/*.tar.gz + +install-releasetools: setup-virtualenv + @$(pip) install --quiet --requirement requirements-release.txt --upgrade