Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Use setuptools
  • Loading branch information
methane committed Mar 2, 2022
commit 9223022ac777e35123e770ad183ff09e9232cd1d
5 changes: 4 additions & 1 deletion msgpack/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# coding: utf-8
from ._version import version
from .exceptions import *
from .ext import ExtType, Timestamp

import os
import sys


version = (1, 0, 4, 'dev')
__version__ = "1.0.4dev"


if os.environ.get("MSGPACK_PUREPYTHON") or sys.version_info[0] == 2:
from .fallback import Packer, unpackb, Unpacker
else:
Expand Down
1 change: 0 additions & 1 deletion msgpack/_version.py

This file was deleted.

32 changes: 32 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[metadata]
name = msgpack
#version = attr: msgpack.__version__
version = attr: msgpack.version
license = Apache 2.0
author = Inada Naoki
author_email = songofacandy@gmail.com
description = MessagePack serializer
long_description = file: README.md
long_description_content_type = text/markdown
url = https://msgpack.org/

project_urls =
Documentation = https://msgpack-python.readthedocs.io/
Source = https://github.com/msgpack/msgpack-python
Tracker = https://github.com/msgpack/msgpack-python/issues

classifiers =
Programming Language :: Python :: 3
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 :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
Intended Audience :: Developers
License :: OSI Approved :: Apache Software License

[flake8]
max_line_length = 100

42 changes: 2 additions & 40 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
import os
import sys
from glob import glob
from distutils.command.sdist import sdist
from setuptools import setup, Extension

from distutils.command.build_ext import build_ext
from setuptools.command.build_ext import build_ext
from setuptools.command.sdist import sdist


PYPY = hasattr(sys, "pypy_version_info")
Expand Down Expand Up @@ -65,12 +64,6 @@ def build_extension(self, ext):
print(e)


exec(open("msgpack/_version.py").read())

version_str = ".".join(str(x) for x in version[:3])
if len(version) > 3 and version[3] != "final":
version_str += version[3]

# Cython is required for sdist
class Sdist(sdist):
def __init__(self, *args, **kwargs):
Expand Down Expand Up @@ -99,39 +92,8 @@ def __init__(self, *args, **kwargs):
del libraries, macros


desc = "MessagePack (de)serializer."
with io.open("README.md", encoding="utf-8") as f:
long_desc = f.read()
del f

setup(
name="msgpack",
author="Inada Naoki",
author_email="songofacandy@gmail.com",
version=version_str,
cmdclass={"build_ext": BuildExt, "sdist": Sdist},
ext_modules=ext_modules,
packages=["msgpack"],
description=desc,
long_description=long_desc,
long_description_content_type="text/markdown",
url="https://msgpack.org/",
project_urls={
"Documentation": "https://msgpack-python.readthedocs.io/",
"Source": "https://github.com/msgpack/msgpack-python",
"Tracker": "https://github.com/msgpack/msgpack-python/issues",
},
license="Apache 2.0",
classifiers=[
"Programming Language :: Python :: 3",
"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 :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
],
)