Skip to content
Open

B1 #301

Show file tree
Hide file tree
Changes from all commits
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
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
__email__ = "dave@vdb.name"

if "sdist" in sys.argv[1:]:
with open("src/skidl/pckg_info.py", "w") as f:
# Windows 默认编码常为 GBK,显式 UTF-8 避免写入非 ASCII 时出错
with open("src/skidl/pckg_info.py", "w", encoding="utf-8") as f:
for name in ["__version__", "__author__", "__email__"]:
f.write('{} = "{}"\n'.format(name, locals()[name]))

Expand All @@ -20,10 +21,11 @@
from distutils.core import setup


with open("README.md") as readme_file:
# README/HISTORY 为 UTF-8;不设 encoding 时 Windows 会用系统编码读文件,pip 构建会报 UnicodeDecodeError
with open("README.md", encoding="utf-8") as readme_file:
readme = readme_file.read()

with open("HISTORY.md") as history_file:
with open("HISTORY.md", encoding="utf-8") as history_file:
history = history_file.read()

requirements = [
Expand Down
Loading