From 9baf51c77208c70bd63a6dc364ead07415cb9b9a Mon Sep 17 00:00:00 2001 From: Hyuma Date: Tue, 4 Feb 2020 11:40:21 +0700 Subject: [PATCH 1/2] Update setup.py file open function with encoding To support Windows --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index f578840..7c0a7eb 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ import setuptools -with open("README.md", "r") as fh: +with open("README.md", "r", encoding='utf-8') as fh: long_description = fh.read() pkg_req = [ @@ -34,4 +34,4 @@ python_requires='>=2.7', install_requires=pkg_req, tests_requires=test_req -) \ No newline at end of file +) From 4c7c2eddaaac0890a278f3a94f0a0e4c6535eea9 Mon Sep 17 00:00:00 2001 From: rizdaprasetya Date: Mon, 25 Oct 2021 14:51:21 +0700 Subject: [PATCH 2/2] update setup.py to follow pypa official sample - for better compatibility across OS (esp Windows) & latest official python version (Python 3) - may not work on Python 2 anymore --- setup.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index d179c89..2ff06e9 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,15 @@ -import setuptools +"""A setuptools based setup module. +Based on: https://github.com/pypa/sampleproject/blob/90d44abe361688aba5a189e661423863b34f5208/setup.py +""" -with open("README.md", "r", encoding='utf-8') as fh: - long_description = fh.read() +# Always prefer setuptools over distutils +from setuptools import setup, find_packages +import pathlib + +here = pathlib.Path(__file__).parent.resolve() + +# Get the long description from the README file +long_description = (here / 'README.md').read_text(encoding='utf-8') pkg_req = [ 'requests>=2.25.0' @@ -10,7 +18,7 @@ 'pytest>=3.0.6' ] -setuptools.setup( +setup( name="midtransclient", version="1.3.0", author="Rizda Prasetya",