Skip to content

Commit

Permalink
fix: Make setup.py Windows compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
achillesrasquinha committed Jan 4, 2019
1 parent 272666d commit a02b395
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import sys
import os.path as osp
import glob
import io

from setuptools import setup, find_packages

Expand All @@ -20,16 +21,16 @@
def isdef(var):
return var in globals()

def read(path):
def read(path, encoding = None):
content = None

with open(path) as f:
with open(path, encoding = encoding) as f:
content = f.read()

return content

def get_package_info():
attr = osp.join(SRCDIR, PACKAGE, "__attr__.py")
attr = osp.abspath(osp.join(SRCDIR, PACKAGE, "__attr__.py"))
info = dict(__file__ = attr) # HACK

with open(attr) as f:
Expand Down Expand Up @@ -60,7 +61,7 @@ def get_dependencies(type_ = None):
author = PKGINFO["__author__"],
author_email = PKGINFO["__email__"],
description = PKGINFO["__description__"],
long_description = read("README.md"),
long_description = read("README.md", encoding = "utf8"),
license = PKGINFO["__license__"],
keywords = " ".join(PKGINFO["__keywords__"]),
packages = find_packages(where = SRCDIR),
Expand Down
2 changes: 2 additions & 0 deletions src/pipupgrade/__attr__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python

import sys
import os.path as osp
import subprocess
Expand Down

0 comments on commit a02b395

Please sign in to comment.