From 155257732055d4f291d656c6b1eeda157462dc9a Mon Sep 17 00:00:00 2001 From: Jonathan Tsai Date: Sat, 19 Aug 2023 19:02:46 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=96=20Version=202.0.0=20-=20Removes=20?= =?UTF-8?q?Python=202=20support=20-=20Packaging=20updates=20=20=20-=20Upda?= =?UTF-8?q?ted=20Makefile=20=20=20-=20Determine=20version=20automatically?= =?UTF-8?q?=20=20=20-=20Adds=20.editorconfig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .editorconfig | 23 +++++++++++++++++++++++ Makefile | 29 +++++++++++++++++++---------- htk/__version__.py | 2 +- setup.py | 11 ++++++----- 4 files changed, 49 insertions(+), 16 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..37737cd --- /dev/null +++ b/.editorconfig @@ -0,0 +1,23 @@ +# http://editorconfig.org +# Properties: https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties + +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true +end_of_line = lf + +# Docstrings and comments use max_line_length = 79 +[*.py] +max_line_length = 119 +indent_size = 4 + +[**.txt] +max_line_length = 79 + +[Makefile] +indent_style = tab diff --git a/Makefile b/Makefile index 87e329d..3a04589 100644 --- a/Makefile +++ b/Makefile @@ -1,27 +1,36 @@ +VERSION := $(shell grep __version__ htk/__version__.py | awk '{ print $$3 }' | tr -d "'") + ## help - Display help about make targets for this Makefile help: @cat Makefile | grep '^## ' --color=never | cut -c4- | sed -e "`printf 's/ - /\t- /;'`" | column -s "`printf '\t'`" -t -## clean - cleans build artifacts +## isort - isort Python files +isort: + isort -rc * + +## clean - Cleans build artifacts clean: rm -rf dist/* rm -rf build/* -## package - builds a package for dist +## version - Shows current version of package +version: + echo $(VERSION) + +## package - Builds a package for dist package: python setup.py sdist bdist_wheel -## repackage - alias of 'make clean package' +## repackage - Alias of 'make clean package' repackage: clean package -## install - install a built dist +## install - Install a built dist install: - sh -c "pip install -U dist/htk-`cat VERSION`.tar.gz" + sh -c "pip install -U dist/htk-$(VERSION).tar.gz" -## upload - uploads a package to PyPI +## upload - Uploads a package to PyPI upload: - sh -c "twine upload dist/htk-`cat VERSION`-py2.py3-none-any.whl" + sh -c "twine upload dist/htk-$(VERSION)-py2.py3-none-any.whl" -## isort - isort Python files -isort: - isort -rc * +## publish - Clean, package, and publish to PyPI +publish: repackage upload diff --git a/htk/__version__.py b/htk/__version__.py index d73721e..719a403 100644 --- a/htk/__version__.py +++ b/htk/__version__.py @@ -1,7 +1,7 @@ __title__ = 'htk' __description__ = 'A set of convenience utils for Python' __url__ = 'https://github.com/hacktoolkit/python-htk' -__version__ = '1.3.1' +__version__ = '2.0.0' __author__ = 'Hacktoolkit' __author_email__ = 'hello@hacktoolkit.com' __license__ = 'MIT' diff --git a/setup.py b/setup.py index 8950ecb..04c55b7 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,7 @@ See: https://packaging.python.org/en/latest/distributing.html +https://packaging.python.org/en/latest/tutorials/packaging-projects/ https://github.com/pypa/sampleproject """ @@ -68,12 +69,12 @@ # Specify the Python versions you support here. In particular, ensure # that you indicate whether you support Python 2, Python 3 or both. - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', + # 'Programming Language :: Python :: 2', + # 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - #'Programming Language :: Python :: 3.3', - #'Programming Language :: Python :: 3.4', - #'Programming Language :: Python :: 3.5', + # 'Programming Language :: Python :: 3.3', + # 'Programming Language :: Python :: 3.4', + # 'Programming Language :: Python :: 3.5', ], # What does your project relate to?