Skip to content

Commit c31ca97

Browse files
authored
Merge pull request #24 from KOLANICH/setup.cfg
Now we store the metadata in setup.cfg.
2 parents 89b73db + 6b0a3b1 commit c31ca97

File tree

2 files changed

+42
-44
lines changed

2 files changed

+42
-44
lines changed

setup.cfg

+34
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
1+
[metadata]
2+
name = kaitaistruct
3+
version = attr: kaitaistruct.__version__
4+
author = Kaitai Project
5+
author_email = [email protected]
6+
url = http://kaitai.io
7+
description = Kaitai Struct declarative parser generator for binary data: runtime library for Python
8+
long_description = file: README.rst
9+
license = MIT
10+
keywords = kaitai, struct, construct, ksy, declarative, data structure, data format, file format, packet format, binary, parser, parsing, unpack, development
11+
classifiers =
12+
Development Status :: 4 - Beta
13+
Intended Audience :: Developers
14+
Topic :: Software Development :: Build Tools
15+
License :: OSI Approved :: MIT License
16+
Programming Language :: Python :: 2
17+
Programming Language :: Python :: 2.7
18+
Programming Language :: Python :: 3
19+
Programming Language :: Python :: 3.3
20+
Programming Language :: Python :: 3.4
21+
Programming Language :: Python :: 3.5
22+
Programming Language :: Python :: 3.6
23+
Programming Language :: Python :: 3.7
24+
Programming Language :: Python :: Implementation :: CPython
25+
Programming Language :: Python :: Implementation :: PyPy
26+
27+
[options]
28+
zip_safe = True
29+
include_package_data = True
30+
py_modules = kaitaistruct
31+
132
[bdist_wheel]
233
# This flag says that the code is written to work on both Python 2 and Python
334
# 3. If at all possible, it is good practice to do this. If you cannot, you
435
# will need to generate wheels for each Python version that you support.
536
universal=1
37+
38+
[build-system]
39+
requires = ["setuptools", "wheel"]

setup.py

+8-44
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,11 @@
1+
import os
12
from setuptools import setup
2-
from io import open
3-
from kaitaistruct import __version__
3+
from setuptools.config import read_configuration
44

5-
with open('README.rst', encoding='utf-8') as f:
6-
long_description = f.read()
5+
this_dir = os.path.dirname(__file__)
6+
cfg = read_configuration(os.path.join(this_dir, 'setup.cfg'))
7+
#print(cfg)
8+
cfg["options"].update(cfg["metadata"])
9+
cfg = cfg["options"]
710

8-
setup(
9-
name='kaitaistruct',
10-
version=__version__,
11-
description='Kaitai Struct declarative parser generator for binary data: runtime library for Python',
12-
long_description=long_description,
13-
url='http://kaitai.io',
14-
author='Kaitai Project',
15-
author_email='[email protected]',
16-
license='MIT',
17-
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
18-
classifiers=[
19-
# How mature is this project? Common values are
20-
# 3 - Alpha
21-
# 4 - Beta
22-
# 5 - Production/Stable
23-
'Development Status :: 4 - Beta',
24-
25-
# Indicate who your project is intended for
26-
'Intended Audience :: Developers',
27-
'Topic :: Software Development :: Build Tools',
28-
29-
# Pick your license as you wish (should match "license" above)
30-
'License :: OSI Approved :: MIT License',
31-
32-
# Specify the Python versions you support here. In particular, ensure
33-
# that you indicate whether you support Python 2, Python 3 or both.
34-
'Programming Language :: Python :: 2',
35-
'Programming Language :: Python :: 2.7',
36-
'Programming Language :: Python :: 3',
37-
'Programming Language :: Python :: 3.3',
38-
'Programming Language :: Python :: 3.4',
39-
'Programming Language :: Python :: 3.5',
40-
'Programming Language :: Python :: 3.6',
41-
"Programming Language :: Python :: 3.7",
42-
"Programming Language :: Python :: Implementation :: CPython",
43-
"Programming Language :: Python :: Implementation :: PyPy",
44-
],
45-
keywords='kaitai,struct,construct,ksy,declarative,data structure,data format,file format,packet format,binary,parser,parsing,unpack,development',
46-
py_modules=["kaitaistruct"],
47-
)
11+
setup(**cfg)

0 commit comments

Comments
 (0)