From c1d1a175995d1c78290ddc8e589e61937cd64ffc Mon Sep 17 00:00:00 2001 From: drewcassidy Date: Thu, 13 May 2021 01:55:22 -0700 Subject: [PATCH] use setuptools_scm for versioning --- pillow_mbm/__init__.py | 2 -- pillow_mbm/__main__.py | 5 +++-- pillow_mbm/version.py | 1 - setup.py | 41 ----------------------------------------- 4 files changed, 3 insertions(+), 46 deletions(-) delete mode 100644 pillow_mbm/version.py delete mode 100644 setup.py diff --git a/pillow_mbm/__init__.py b/pillow_mbm/__init__.py index b65c368..70bfd57 100644 --- a/pillow_mbm/__init__.py +++ b/pillow_mbm/__init__.py @@ -1,5 +1,3 @@ -from pillow_mbm.version import __version__ - import struct from PIL import Image, ImageFile diff --git a/pillow_mbm/__main__.py b/pillow_mbm/__main__.py index 0851897..6546b2c 100644 --- a/pillow_mbm/__main__.py +++ b/pillow_mbm/__main__.py @@ -48,7 +48,8 @@ def path_pairs(inputs, output, suffix, extension): raise click.BadOptionUsage('output', 'Output is a single file, but multiple input files were provided.') if outpath.suffix not in decoded_extensions: raise click.BadOptionUsage('output', - f'File has incorrect extension for decoded file. Valid extensions are:\n{decoded_extensions}') + f'File has incorrect extension for decoded file. Valid extensions are:\n' + f'{decoded_extensions}') return [(inpath, outpath) for inpath in inpaths] else: @@ -72,7 +73,7 @@ def path_pairs(inputs, output, suffix, extension): "By default, files are decoded in place.") @click.option('-v', '--verbose', is_flag=True, help="print more information") @click.argument('filenames', nargs=-1, type=click.Path(exists=True, readable=True, dir_okay=False)) -@click.version_option(version=pillow_mbm.__version__) +@click.version_option() def convert_mbm(flip, remove, suffix, extension, output, verbose, filenames): """Decode Kerbal Space Program MBM files""" diff --git a/pillow_mbm/version.py b/pillow_mbm/version.py deleted file mode 100644 index 10939f0..0000000 --- a/pillow_mbm/version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = '0.1.2' diff --git a/setup.py b/setup.py deleted file mode 100644 index e51268a..0000000 --- a/setup.py +++ /dev/null @@ -1,41 +0,0 @@ -import os.path -from setuptools import setup - -project_path = os.path.dirname(os.path.realpath(__file__)) - -with open(os.path.join(project_path, 'pillow_mbm', 'version.py')) as f: - exec(f.read()) - -with open(os.path.join(project_path, 'README.md')) as f: - readme = f.read() - -setup( - name='pillow-mbm', - description="A pillow plugin that adds support for KSP's MBM textures", - version=__version__, - url='https://github.com/drewcassidy/Pillow-mbm', - author='Andrew Cassidy', - long_description=readme, - long_description_content_type='text/markdown', - python_requires=">=3.7", - install_requires=['Pillow', 'click'], - entry_points={ - 'console_scripts': ['convert-mbm = pillow_mbm.__main__:convert_mbm'] - }, - package_dir={'': '.'}, - packages=['pillow_mbm'], - classifiers=[ - 'Development Status :: 4 - Beta', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: GNU Affero General Public License v3', - 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3 :: Only', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Topic :: Games/Entertainment :: Simulation', - "Topic :: Multimedia :: Graphics", - "Topic :: Multimedia :: Graphics :: Graphics Conversion", - ], -)