From 731d6391c3c5fcb028a5d7979f7cab8848e0e1af Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 9 Nov 2020 18:36:31 -0800 Subject: Add setuptools as a dependency for pkg_resources module, and update build scripts to properly delete last build --- .gitignore | 2 + cli/poetry.lock | 253 ++++++++++++++++---------------- cli/pyproject.toml | 1 + desktop/package/linux/build-appimage.py | 10 +- desktop/package/macos/build.py | 10 +- desktop/package/windows/build.py | 12 +- 6 files changed, 145 insertions(+), 143 deletions(-) diff --git a/.gitignore b/.gitignore index b9578089..c96d9d1d 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,5 @@ desktop/*.whl desktop/linux desktop/windows desktop/macOS +# gets added automatically when building for Windows or macOS +desktop/include \ No newline at end of file diff --git a/cli/poetry.lock b/cli/poetry.lock index 5ca58cbc..00331cc4 100644 --- a/cli/poetry.lock +++ b/cli/poetry.lock @@ -1,78 +1,76 @@ [[package]] -category = "dev" -description = "Atomic file writes." -marker = "sys_platform == \"win32\"" name = "atomicwrites" +version = "1.4.0" +description = "Atomic file writes." +category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "1.4.0" [[package]] -category = "dev" -description = "Classes Without Boilerplate" name = "attrs" +version = "20.3.0" +description = "Classes Without Boilerplate" +category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "20.2.0" [package.extras] -dev = ["coverage (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "sphinx", "sphinx-rtd-theme", "pre-commit"] -docs = ["sphinx", "sphinx-rtd-theme", "zope.interface"] -tests = ["coverage (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"] -tests_no_zope = ["coverage (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six"] +dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface", "furo", "sphinx", "pre-commit"] +docs = ["furo", "sphinx", "zope.interface"] +tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "zope.interface"] +tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six"] [[package]] -category = "main" -description = "Python package for providing Mozilla's CA Bundle." name = "certifi" +version = "2020.11.8" +description = "Python package for providing Mozilla's CA Bundle." +category = "main" optional = false python-versions = "*" -version = "2020.6.20" [[package]] -category = "main" -description = "Universal encoding detector for Python 2 and 3" name = "chardet" +version = "3.0.4" +description = "Universal encoding detector for Python 2 and 3" +category = "main" optional = false python-versions = "*" -version = "3.0.4" [[package]] -category = "main" -description = "Composable command line interface toolkit" name = "click" +version = "7.1.2" +description = "Composable command line interface toolkit" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" -version = "7.1.2" [[package]] -category = "dev" -description = "Cross-platform colored terminal text." -marker = "sys_platform == \"win32\"" name = "colorama" +version = "0.4.4" +description = "Cross-platform colored terminal text." +category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" -version = "0.4.4" [[package]] -category = "main" -description = "DNS toolkit" name = "dnspython" +version = "1.16.0" +description = "DNS toolkit" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "1.16.0" [package.extras] DNSSEC = ["pycryptodome", "ecdsa (>=0.13)"] IDNA = ["idna (>=2.1)"] [[package]] -category = "main" -description = "Highly concurrent networking library" name = "eventlet" +version = "0.29.1" +description = "Highly concurrent networking library" +category = "main" optional = false python-versions = "*" -version = "0.29.1" [package.dependencies] dnspython = ">=1.15.0,<2.0.0" @@ -80,18 +78,18 @@ greenlet = ">=0.3" six = ">=1.10.0" [[package]] -category = "main" -description = "A simple framework for building complex web applications." name = "flask" +version = "1.1.2" +description = "A simple framework for building complex web applications." +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" -version = "1.1.2" [package.dependencies] -Jinja2 = ">=2.10.1" -Werkzeug = ">=0.15" click = ">=5.1" itsdangerous = ">=0.24" +Jinja2 = ">=2.10.1" +Werkzeug = ">=0.15" [package.extras] dev = ["pytest", "coverage", "tox", "sphinx", "pallets-sphinx-themes", "sphinxcontrib-log-cabinet", "sphinx-issues"] @@ -99,52 +97,51 @@ docs = ["sphinx", "pallets-sphinx-themes", "sphinxcontrib-log-cabinet", "sphinx- dotenv = ["python-dotenv"] [[package]] -category = "main" -description = "Basic and Digest HTTP authentication for Flask routes" name = "flask-httpauth" +version = "4.1.0" +description = "Basic and Digest HTTP authentication for Flask routes" +category = "main" optional = false python-versions = "*" -version = "4.1.0" [package.dependencies] Flask = "*" [[package]] -category = "main" -description = "Socket.IO integration for Flask applications" name = "flask-socketio" +version = "4.3.1" +description = "Socket.IO integration for Flask applications" +category = "main" optional = false python-versions = "*" -version = "4.3.1" [package.dependencies] Flask = ">=0.9" python-socketio = ">=4.3.0" [[package]] -category = "main" -description = "Lightweight in-process concurrent programming" name = "greenlet" +version = "0.4.17" +description = "Lightweight in-process concurrent programming" +category = "main" optional = false python-versions = "*" -version = "0.4.17" [[package]] -category = "main" -description = "Internationalized Domain Names in Applications (IDNA)" name = "idna" +version = "2.10" +description = "Internationalized Domain Names in Applications (IDNA)" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "2.10" [[package]] -category = "dev" -description = "Read metadata from Python packages" -marker = "python_version < \"3.8\"" name = "importlib-metadata" +version = "2.0.0" +description = "Read metadata from Python packages" +category = "dev" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" -version = "2.0.0" [package.dependencies] zipp = ">=0.5" @@ -154,28 +151,28 @@ docs = ["sphinx", "rst.linker"] testing = ["packaging", "pep517", "importlib-resources (>=1.3)"] [[package]] -category = "dev" -description = "iniconfig: brain-dead simple config-ini parsing" name = "iniconfig" +version = "1.1.1" +description = "iniconfig: brain-dead simple config-ini parsing" +category = "dev" optional = false python-versions = "*" -version = "1.1.1" [[package]] -category = "main" -description = "Various helpers to pass data to untrusted environments and back." name = "itsdangerous" +version = "1.1.0" +description = "Various helpers to pass data to untrusted environments and back." +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "1.1.0" [[package]] -category = "main" -description = "A very fast and expressive template engine." name = "jinja2" +version = "2.11.2" +description = "A very fast and expressive template engine." +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" -version = "2.11.2" [package.dependencies] MarkupSafe = ">=0.23" @@ -184,106 +181,101 @@ MarkupSafe = ">=0.23" i18n = ["Babel (>=0.8)"] [[package]] -category = "main" -description = "Safely add untrusted strings to HTML/XML markup." name = "markupsafe" +version = "1.1.1" +description = "Safely add untrusted strings to HTML/XML markup." +category = "main" optional = false python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" -version = "1.1.1" [[package]] -category = "dev" -description = "Core utilities for Python packages" name = "packaging" +version = "20.4" +description = "Core utilities for Python packages" +category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "20.4" [package.dependencies] pyparsing = ">=2.0.2" six = "*" [[package]] -category = "dev" -description = "plugin and hook calling mechanisms for python" name = "pluggy" +version = "0.13.1" +description = "plugin and hook calling mechanisms for python" +category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "0.13.1" [package.dependencies] -[package.dependencies.importlib-metadata] -python = "<3.8" -version = ">=0.12" +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} [package.extras] dev = ["pre-commit", "tox"] [[package]] -category = "dev" -description = "library with cross-python path, ini-parsing, io, code, log facilities" name = "py" +version = "1.9.0" +description = "library with cross-python path, ini-parsing, io, code, log facilities" +category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "1.9.0" [[package]] -category = "main" -description = "Cryptographic library for Python" name = "pycryptodome" +version = "3.9.9" +description = "Cryptographic library for Python" +category = "main" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "3.9.9" [[package]] -category = "dev" -description = "Python parsing module" name = "pyparsing" +version = "2.4.7" +description = "Python parsing module" +category = "dev" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" -version = "2.4.7" [[package]] -category = "main" -description = "A Python SOCKS client module. See https://github.com/Anorov/PySocks for more information." name = "pysocks" +version = "1.7.1" +description = "A Python SOCKS client module. See https://github.com/Anorov/PySocks for more information." +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "1.7.1" [[package]] -category = "dev" -description = "pytest: simple powerful testing with Python" name = "pytest" +version = "6.1.2" +description = "pytest: simple powerful testing with Python" +category = "dev" optional = false python-versions = ">=3.5" -version = "6.1.2" [package.dependencies] -atomicwrites = ">=1.0" +atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} attrs = ">=17.4.0" -colorama = "*" +colorama = {version = "*", markers = "sys_platform == \"win32\""} +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<1.0" py = ">=1.8.2" toml = "*" -[package.dependencies.importlib-metadata] -python = "<3.8" -version = ">=0.12" - [package.extras] -checkqa_mypy = ["mypy (0.780)"] +checkqa_mypy = ["mypy (==0.780)"] testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] [[package]] -category = "main" -description = "Engine.IO server" name = "python-engineio" +version = "3.13.2" +description = "Engine.IO server" +category = "main" optional = false python-versions = "*" -version = "3.13.2" [package.dependencies] six = ">=1.9.0" @@ -293,12 +285,12 @@ asyncio_client = ["aiohttp (>=3.4)"] client = ["requests (>=2.21.0)", "websocket-client (>=0.54.0)"] [[package]] -category = "main" -description = "Socket.IO server" name = "python-socketio" +version = "4.6.0" +description = "Socket.IO server" +category = "main" optional = false python-versions = "*" -version = "4.6.0" [package.dependencies] python-engineio = ">=3.13.0" @@ -309,12 +301,12 @@ asyncio_client = ["aiohttp (>=3.4)", "websockets (>=7.0)"] client = ["requests (>=2.21.0)", "websocket-client (>=0.54.0)"] [[package]] -category = "main" -description = "Python HTTP for Humans." name = "requests" +version = "2.24.0" +description = "Python HTTP for Humans." +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" -version = "2.24.0" [package.dependencies] certifi = ">=2017.4.17" @@ -324,73 +316,73 @@ urllib3 = ">=1.21.1,<1.25.0 || >1.25.0,<1.25.1 || >1.25.1,<1.26" [package.extras] security = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)"] -socks = ["PySocks (>=1.5.6,<1.5.7 || >1.5.7)", "win-inet-pton"] +socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"] [[package]] -category = "main" -description = "Python 2 and 3 compatibility utilities" name = "six" +version = "1.15.0" +description = "Python 2 and 3 compatibility utilities" +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" -version = "1.15.0" [[package]] -category = "main" -description = "Stem is a Python controller library that allows applications to interact with Tor (https://www.torproject.org/)." name = "stem" +version = "1.8.0" +description = "Stem is a Python controller library that allows applications to interact with Tor (https://www.torproject.org/)." +category = "main" optional = false python-versions = "*" -version = "1.8.0" [[package]] -category = "dev" -description = "Python Library for Tom's Obvious, Minimal Language" name = "toml" +version = "0.10.2" +description = "Python Library for Tom's Obvious, Minimal Language" +category = "dev" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" -version = "0.10.2" [[package]] -category = "main" -description = "HTTP library with thread-safe connection pooling, file post, and more." name = "urllib3" +version = "1.25.11" +description = "HTTP library with thread-safe connection pooling, file post, and more." +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" -version = "1.25.11" [package.extras] brotli = ["brotlipy (>=0.6.0)"] secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "ipaddress"] -socks = ["PySocks (>=1.5.6,<1.5.7 || >1.5.7,<2.0)"] +socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [[package]] -category = "main" -description = "The comprehensive WSGI web application library." name = "werkzeug" +version = "1.0.1" +description = "The comprehensive WSGI web application library." +category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" -version = "1.0.1" [package.extras] dev = ["pytest", "pytest-timeout", "coverage", "tox", "sphinx", "pallets-sphinx-themes", "sphinx-issues"] watchdog = ["watchdog"] [[package]] -category = "dev" -description = "Backport of pathlib-compatible object wrapper for zip files" -marker = "python_version < \"3.8\"" name = "zipp" +version = "3.4.0" +description = "Backport of pathlib-compatible object wrapper for zip files" +category = "dev" optional = false python-versions = ">=3.6" -version = "3.4.0" [package.extras] docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] -testing = ["pytest (>=3.5,<3.7.3 || >3.7.3)", "pytest-checkdocs (>=1.2.3)", "pytest-flake8", "pytest-cov", "jaraco.test (>=3.2.0)", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy"] +testing = ["pytest (>=3.5,!=3.7.3)", "pytest-checkdocs (>=1.2.3)", "pytest-flake8", "pytest-cov", "jaraco.test (>=3.2.0)", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy"] [metadata] -content-hash = "30df798474ba3e34572ac2e94410a0155cbd7f6a0559c495c33150b530f8620b" +lock-version = "1.1" python-versions = "^3.6" +content-hash = "3947b230139f4b699f40c97e0b90d8c8ab6d3d7ef9093d16d2acb507131e14da" [metadata.files] atomicwrites = [ @@ -398,12 +390,12 @@ atomicwrites = [ {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, ] attrs = [ - {file = "attrs-20.2.0-py2.py3-none-any.whl", hash = "sha256:fce7fc47dfc976152e82d53ff92fa0407700c21acd20886a13777a0d20e655dc"}, - {file = "attrs-20.2.0.tar.gz", hash = "sha256:26b54ddbbb9ee1d34d5d3668dd37d6cf74990ab23c828c2888dccdceee395594"}, + {file = "attrs-20.3.0-py2.py3-none-any.whl", hash = "sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6"}, + {file = "attrs-20.3.0.tar.gz", hash = "sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700"}, ] certifi = [ - {file = "certifi-2020.6.20-py2.py3-none-any.whl", hash = "sha256:8fc0819f1f30ba15bdb34cceffb9ef04d99f420f68eb75d901e9560b8749fc41"}, - {file = "certifi-2020.6.20.tar.gz", hash = "sha256:5930595817496dd21bb8dc35dad090f1c2cd0adfaf21204bf6732ca5d8ee34d3"}, + {file = "certifi-2020.11.8-py2.py3-none-any.whl", hash = "sha256:1f422849db327d534e3d0c5f02a263458c3955ec0aae4ff09b95f195c59f4edd"}, + {file = "certifi-2020.11.8.tar.gz", hash = "sha256:f05def092c44fbf25834a51509ef6e631dc19765ab8a57b4e7ab85531f0a9cf4"}, ] chardet = [ {file = "chardet-3.0.4-py2.py3-none-any.whl", hash = "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"}, @@ -415,6 +407,7 @@ click = [ ] colorama = [ {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, + {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, ] dnspython = [ {file = "dnspython-1.16.0-py2.py3-none-any.whl", hash = "sha256:f69c21288a962f4da86e56c4905b49d11aba7938d3d740e80d9e366ee4f1632d"}, diff --git a/cli/pyproject.toml b/cli/pyproject.toml index 9946ab62..08206844 100644 --- a/cli/pyproject.toml +++ b/cli/pyproject.toml @@ -27,6 +27,7 @@ requests = "*" stem = "*" urllib3 = "*" eventlet = "*" +setuptools = "*" [tool.poetry.dev-dependencies] pytest = "*" diff --git a/desktop/package/linux/build-appimage.py b/desktop/package/linux/build-appimage.py index 8fcbda90..30c5de94 100755 --- a/desktop/package/linux/build-appimage.py +++ b/desktop/package/linux/build-appimage.py @@ -23,6 +23,12 @@ def main(): cli_dir = os.path.join(root, "cli") desktop_dir = os.path.join(root, "desktop") + print("○ Clean up from last build") + if os.path.exist(os.path.join(cli_dir, "dist")): + shutil.rmtree(os.path.join(cli_dir, "dist")) + if os.path.exists(os.path.join(desktop_dir, "linux")): + shutil.rmtree(os.path.join(desktop_dir, "linux")) + print("○ Building onionshare-cli") run(["poetry", "install"], cli_dir) run(["poetry", "build"], cli_dir) @@ -30,10 +36,6 @@ def main(): whl_basename = os.path.basename(whl_filename) shutil.copyfile(whl_filename, os.path.join(desktop_dir, whl_basename)) - print("○ Clean up from last build") - if os.path.exists(os.path.join(desktop_dir, "linux")): - shutil.rmtree(os.path.join(desktop_dir, "linux")) - print("○ Create the binary") run(["briefcase", "create"], desktop_dir) diff --git a/desktop/package/macos/build.py b/desktop/package/macos/build.py index 0cf3c57c..f9af29c5 100755 --- a/desktop/package/macos/build.py +++ b/desktop/package/macos/build.py @@ -33,6 +33,12 @@ def main(): cli_dir = os.path.join(root, "cli") desktop_dir = os.path.join(root, "desktop") + print("○ Clean up from last build") + if os.path.exist(os.path.join(cli_dir, "dist")): + shutil.rmtree(os.path.join(cli_dir, "dist")) + if os.path.exists(os.path.join(desktop_dir, "macOS")): + shutil.rmtree(os.path.join(desktop_dir, "macOS")) + print("○ Building onionshare-cli") run(["poetry", "install"], cli_dir) run(["poetry", "build"], cli_dir) @@ -40,10 +46,6 @@ def main(): whl_basename = os.path.basename(whl_filename) shutil.copyfile(whl_filename, os.path.join(desktop_dir, whl_basename)) - print("○ Clean up from last build") - if os.path.exists(os.path.join(desktop_dir, "macOS")): - shutil.rmtree(os.path.join(desktop_dir, "macOS")) - print("○ Create app bundle") run(["briefcase", "create"], desktop_dir) app_path = os.path.join(desktop_dir, "macOS", "OnionShare", "OnionShare.app") diff --git a/desktop/package/windows/build.py b/desktop/package/windows/build.py index 3ee7de4f..c4d1fd89 100644 --- a/desktop/package/windows/build.py +++ b/desktop/package/windows/build.py @@ -23,6 +23,12 @@ def main(): cli_dir = os.path.join(root, "cli") desktop_dir = os.path.join(root, "desktop") + print("○ Clean up from last build") + if os.path.exist(os.path.join(cli_dir, "dist")): + shutil.rmtree(os.path.join(cli_dir, "dist")) + if os.path.exists(os.path.join(desktop_dir, "windows")): + shutil.rmtree(os.path.join(desktop_dir, "windows")) + print("○ Building onionshare-cli") run(["poetry", "install"], cli_dir) run(["poetry", "build"], cli_dir) @@ -30,14 +36,10 @@ def main(): whl_basename = os.path.basename(whl_filename) shutil.copyfile(whl_filename, os.path.join(desktop_dir, whl_basename)) - print("○ Clean up from last build") - if os.path.exists(os.path.join(desktop_dir, "windows")): - shutil.rmtree(os.path.join(desktop_dir, "windows")) - print("○ Create the binary") run(["briefcase", "create"], desktop_dir) run(["briefcase", "package"], desktop_dir) - msi_filename = os.path.join(desktop_dir, "windows", "OnionShare-2.3.dev1.msi") + msi_filename = glob.glob(os.path.join(cli_dir, "windows", "OnionShare-*.msi"))[0] print(f"○ Created unsigned installer: {msi_filename}") print(f"○ Signing installer") -- cgit v1.2.3-54-g00ecf