diff --git a/run.py b/run.py index 31fe759..73c05a3 100755 --- a/run.py +++ b/run.py @@ -18,19 +18,19 @@ import sys from util import ip from util.cache import Cache -__version__ = "python@none-build" # CI 时会被Tag替换 +__version__ = "${BUILD_SOURCEBRANCHNAME}@${BUILD_DATE}" # CI 时会被Tag替换 __description__ = "自动更新DNS记录指向本地IP [automatically update DNS records to dynamic local IP]" __doc__ = """ ddns[%s] (i) 文档主页[homepage or docs]: https://ddns.newfuture.cc/ (?) 问题和帮助[issues or bugs]: https://github.com/NewFuture/DDNS/issues -Copyright (c) New Future ♥ (MIT License) +Copyright (c) New Future (MIT License) """ % (__version__) if getattr(sys, 'frozen', False): - __version__ = "${BUILD_SOURCEBRANCHNAME}@${BUILD_DATE}" # https://github.com/pyinstaller/pyinstaller/wiki/Recipe-OpenSSL-Certificate - environ['SSL_CERT_FILE'] = path.join(sys._MEIPASS, 'lib', 'cert.pem') + environ['SSL_CERT_FILE'] = path.join( + getattr(sys, '_MEIPASS'), 'lib', 'cert.pem') CACHE_FILE = path.join(gettempdir(), 'ddns.cache') diff --git a/setup.py b/setup.py index 0bc3789..64f59cb 100644 --- a/setup.py +++ b/setup.py @@ -20,6 +20,11 @@ from run import __description__ here = path.abspath(path.dirname(__file__)) +# Clean dist after binary build +if path.isfile('dist/ddns') or path.isfile('dist/ddns.exe') or path.isfile('dist/ddns-osx'): + from shutil import rmtree + rmtree('dist/') + # Get the long description from the README file with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() @@ -218,4 +223,6 @@ setup( 'Bug Reports': 'https://github.com/NewFuture/DDNS/issues', 'Source': 'https://github.com/NewFuture/DDNS', }, + license="MIT", + platforms=['any'], )