From 6a1c0fc05f1eac50d5a47d83e988efa1f9a84cf7 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Fri, 29 Nov 2024 00:07:30 -0500 Subject: [PATCH 1/2] Revert ":fire: Delete MANIFEST file" This reverts commit 6b51403cf2213dc222c4532f1573c4326e63468e. The commit never made sense. It deleted MANIFEST, but a couple years later MANIFEST.in got added right back, which included the same files MANIFEST did. And the commit added a data_files argument to setup.py which was totally invalid -- it tried to install README.rst as /usr/README.rst which was clearly wrong. The original intention appears to have been to borrow the side effect of data_files, and have the files appear in the sdist so setup.py could read them, but it was the wrong way to do it. Fixes: https://github.com/ikegami-yukino/jaconv/issues/28 --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index dadfc97..1b6d8b3 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,6 @@ 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', 'Topic :: Text Processing' ], - data_files=[('', ['README.rst', 'CHANGES.rst'])], long_description='%s\n\n%s' % (open('README.rst', encoding='utf8').read(), open('CHANGES.rst', encoding='utf8').read()), From 5bea14f6553a30a661be53a7eadc18041f1350c0 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Fri, 29 Nov 2024 00:22:21 -0500 Subject: [PATCH 2/2] port setuptools to setup.cfg setup.cfg can be freely mixed with setup.py and settings from both are merged together. Using the cfg file, it is possible to encode most metadata statically, and use a few powerful new tools in the process -- in particular, it is no longer necessary to regex the `__init__.py` file for the version, since setuptools can natively extract the relevant property (and yes, it does so without importing the module). --- setup.cfg | 45 +++++++++++++++++++++++++++++++++++++++++++++ setup.py | 40 +--------------------------------------- 2 files changed, 46 insertions(+), 39 deletions(-) create mode 100644 setup.cfg diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..788ee61 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,45 @@ +[metadata] +name = jaconv +version = attr: jaconv.__version__ +license = MIT License +platforms = POSIX, Windows, Unix, MacOS +author = Yukino Ikegami +author_email = yknikgm@gmail.com +url = https://github.com/ikegami-yukino/jaconv +keywords = + Japanese converter + Japanese + text preprocessing + half-width kana + Hiragana + Katakana + Hankaku + Zenkaku + transliteration + Julius +classifiers = + Development Status :: 4 - Beta + Intended Audience :: Developers + Intended Audience :: Information Technology + License :: OSI Approved :: MIT License + Natural Language :: Japanese + Operating System :: MacOS + Operating System :: Microsoft + Operating System :: POSIX + Programming Language :: Python :: 2.7 + Programming Language :: Python :: 3.4 + Programming Language :: Python :: 3.5 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 + Topic :: Text Processing + +[options] +packages = jaconv + +[options.package_data] +jaconv = py.typed, *.pyi diff --git a/setup.py b/setup.py index 1b6d8b3..d333760 100644 --- a/setup.py +++ b/setup.py @@ -1,48 +1,10 @@ # -*- coding: utf-8 -*- from codecs import open -import os -import re from setuptools import setup -with open(os.path.join('jaconv', '__init__.py'), 'r', encoding='utf8') as f: - version = re.compile(r".*__version__ = '(.*?)'", - re.S).match(f.read()).group(1) - -setup(name='jaconv', - packages=['jaconv'], - package_data={ - "jaconv": ["py.typed", "*.pyi"], - }, - version=version, - license='MIT License', - platforms=['POSIX', 'Windows', 'Unix', 'MacOS'], +setup( description='Pure-Python Japanese character interconverter for ' 'Hiragana, Katakana, Hankaku, Zenkaku and more', - author='Yukino Ikegami', - author_email='yknikgm@gmail.com', - url='https://github.com/ikegami-yukino/jaconv', - keywords=[ - 'Japanese converter', 'Japanese', 'text preprocessing', - 'half-width kana', 'Hiragana', 'Katakana', 'Hankaku', 'Zenkaku', - 'transliteration', 'Julius' - ], - classifiers=[ - 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', - 'Intended Audience :: Information Technology', - 'License :: OSI Approved :: MIT License', - 'Natural Language :: Japanese', 'Operating System :: MacOS', - 'Operating System :: Microsoft', 'Operating System :: POSIX', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', 'Topic :: Text Processing' - ], long_description='%s\n\n%s' % (open('README.rst', encoding='utf8').read(), open('CHANGES.rst', encoding='utf8').read()),