Skip to content

Commit 4a9bfa9

Browse files
committed
Moved the metadata out of setup.py into setup.cfg.
Added `pyproject.toml`. Replaced importing the version variable with reading it from the file using `read_version`. If we drop `python3 ./setup.py test`, then `setup.py` can be removed completely since now (to build one should use `python3 -m build -nwx`).
1 parent 5d6203b commit 4a9bfa9

File tree

3 files changed

+34
-32
lines changed

3 files changed

+34
-32
lines changed

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[build-system]
2+
requires = ["setuptools>=44", "wheel", "read_version"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.read_version]
6+
version = "wordsegment.__init__:__version__"

setup.cfg

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[metadata]
2+
name = wordsegment
3+
author = Grant Jenks
4+
author_email = [email protected]
5+
license = Apache 2.0
6+
description = English word segmentation.
7+
url = http://www.grantjenks.com/docs/wordsegment/
8+
long_description = file: README.rst
9+
classifiers =
10+
Development Status :: 4 - Beta
11+
Intended Audience :: Developers
12+
License :: OSI Approved :: Apache Software License
13+
Natural Language :: English
14+
Programming Language :: Python
15+
Programming Language :: Python :: 2
16+
Programming Language :: Python :: 2.6
17+
Programming Language :: Python :: 2.7
18+
Programming Language :: Python :: 3
19+
Programming Language :: Python :: 3.2
20+
Programming Language :: Python :: 3.3
21+
Programming Language :: Python :: 3.4
22+
Programming Language :: Python :: 3.5
23+
Programming Language :: Python :: 3.6
24+
25+
[options]
26+
include_package_data = True
27+
tests_require = tox
28+
packages = wordsegment

setup.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
from setuptools.command.test import test as TestCommand
44
import sys
55

6-
import wordsegment
7-
86
class Tox(TestCommand):
97
def finalize_options(self):
108
TestCommand.finalize_options(self)
@@ -15,36 +13,6 @@ def run_tests(self):
1513
errno = tox.cmdline(self.test_args)
1614
sys.exit(errno)
1715

18-
with io.open('README.rst', encoding='UTF-8') as reader:
19-
readme = reader.read()
20-
2116
setup(
22-
name='wordsegment',
23-
version=wordsegment.__version__,
24-
description='English word segmentation.',
25-
long_description=readme,
26-
author='Grant Jenks',
27-
author_email='[email protected]',
28-
url='http://www.grantjenks.com/docs/wordsegment/',
29-
packages=['wordsegment'],
30-
include_package_data=True,
31-
tests_require=['tox'],
3217
cmdclass={'test': Tox},
33-
license='Apache 2.0',
34-
classifiers=[
35-
'Development Status :: 4 - Beta',
36-
'Intended Audience :: Developers',
37-
'License :: OSI Approved :: Apache Software License',
38-
'Natural Language :: English',
39-
'Programming Language :: Python',
40-
'Programming Language :: Python :: 2',
41-
'Programming Language :: Python :: 2.6',
42-
'Programming Language :: Python :: 2.7',
43-
'Programming Language :: Python :: 3',
44-
'Programming Language :: Python :: 3.2',
45-
'Programming Language :: Python :: 3.3',
46-
'Programming Language :: Python :: 3.4',
47-
'Programming Language :: Python :: 3.5',
48-
'Programming Language :: Python :: 3.6',
49-
],
5018
)

0 commit comments

Comments
 (0)