From addfa43076493886c775d36b1f458c7bca66f673 Mon Sep 17 00:00:00 2001 From: Fede Calendino Date: Tue, 1 Nov 2022 19:15:48 +0100 Subject: [PATCH] Update for v2.7.0 --- info.plist | 4 +- poetry.lock | 163 +++++---------------------------------------- pyproject.toml | 7 +- scripts/build.sh | 27 +++----- scripts/release.sh | 2 +- src/main.py | 4 +- 6 files changed, 37 insertions(+), 170 deletions(-) diff --git a/info.plist b/info.plist index 7f99845..5954763 100644 --- a/info.plist +++ b/info.plist @@ -79,7 +79,7 @@ runningsubtext script - ./dist/main/main $@ + /usr/bin/python3 ./dist/main.py $@ scriptargtype 1 scriptfile @@ -186,7 +186,7 @@ The valid 3-letter fiat currency codes can be found here: https://www.iban.com/c version - 2.6.0 + 2.7.0 webaddress https://github.com/fedecalendino/alfred-currency-converter diff --git a/poetry.lock b/poetry.lock index 2343406..d6cdd92 100644 --- a/poetry.lock +++ b/poetry.lock @@ -9,14 +9,6 @@ python-versions = ">=3.8,<4.0" [package.dependencies] requests = ">=2.28.1,<3.0.0" -[[package]] -name = "altgraph" -version = "0.17.3" -description = "Python graph (network) package" -category = "dev" -optional = false -python-versions = "*" - [[package]] name = "black" version = "22.10.0" @@ -41,15 +33,15 @@ uvloop = ["uvloop (>=0.15.2)"] [[package]] name = "ccy" -version = "1.2.2" +version = "1.3.0" description = "Python currencies" category = "main" optional = false -python-versions = "*" +python-versions = ">=3.8,<3.12" [package.dependencies] -python-dateutil = "*" -pytz = "*" +python-dateutil = ">=2.8.2,<3.0.0" +pytz = ">=2022.5,<2023.0" [[package]] name = "certifi" @@ -83,19 +75,11 @@ colorama = {version = "*", markers = "platform_system == \"Windows\""} [[package]] name = "colorama" -version = "0.4.5" +version = "0.4.6" description = "Cross-platform colored terminal text." category = "dev" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" - -[[package]] -name = "future" -version = "0.18.2" -description = "Clean single-source support for Python 3 and 2" -category = "dev" -optional = false -python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" [[package]] name = "idna" @@ -105,17 +89,6 @@ category = "main" optional = false python-versions = ">=3.5" -[[package]] -name = "macholib" -version = "1.16.2" -description = "Mach-O header analysis and editing" -category = "dev" -optional = false -python-versions = "*" - -[package.dependencies] -altgraph = ">=0.17" - [[package]] name = "mypy-extensions" version = "0.4.3" @@ -132,17 +105,6 @@ category = "dev" optional = false python-versions = ">=3.7" -[[package]] -name = "pefile" -version = "2022.5.30" -description = "Python PE parsing module" -category = "dev" -optional = false -python-versions = ">=3.6.0" - -[package.dependencies] -future = "*" - [[package]] name = "platformdirs" version = "2.5.2" @@ -157,7 +119,7 @@ test = ["appdirs (==1.4.4)", "pytest (>=6)", "pytest-cov (>=2.7)", "pytest-mock [[package]] name = "pycoingecko" -version = "3.0.0" +version = "3.1.0" description = "Python wrapper around the CoinGecko API" category = "main" optional = false @@ -166,34 +128,6 @@ python-versions = "*" [package.dependencies] requests = "*" -[[package]] -name = "pyinstaller" -version = "5.5" -description = "PyInstaller bundles a Python application and all its dependencies into a single package." -category = "dev" -optional = false -python-versions = "<3.12,>=3.7" - -[package.dependencies] -altgraph = "*" -macholib = {version = ">=1.8", markers = "sys_platform == \"darwin\""} -pefile = {version = ">=2022.5.30", markers = "sys_platform == \"win32\""} -pyinstaller-hooks-contrib = ">=2021.4" -pywin32-ctypes = {version = ">=0.2.0", markers = "sys_platform == \"win32\""} -setuptools = "*" - -[package.extras] -encryption = ["tinyaes (>=1.0.0)"] -hook_testing = ["execnet (>=1.5.0)", "psutil", "pytest (>=2.7.3)"] - -[[package]] -name = "pyinstaller-hooks-contrib" -version = "2022.10" -description = "Community maintained hooks for PyInstaller" -category = "dev" -optional = false -python-versions = ">=3.7" - [[package]] name = "python-dateutil" version = "2.8.2" @@ -207,20 +141,12 @@ six = ">=1.5" [[package]] name = "pytz" -version = "2022.4" +version = "2022.6" description = "World timezone definitions, modern and historical" category = "main" optional = false python-versions = "*" -[[package]] -name = "pywin32-ctypes" -version = "0.2.0" -description = "" -category = "dev" -optional = false -python-versions = "*" - [[package]] name = "requests" version = "2.28.1" @@ -239,19 +165,6 @@ urllib3 = ">=1.21.1,<1.27" socks = ["PySocks (>=1.5.6,!=1.5.7)"] use_chardet_on_py3 = ["chardet (>=3.0.2,<6)"] -[[package]] -name = "setuptools" -version = "65.4.1" -description = "Easily download, build, install, upgrade, and uninstall Python packages" -category = "dev" -optional = false -python-versions = ">=3.7" - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-hoverxref (<2)", "sphinx-inline-tabs", "sphinx-notfound-page (==0.8.3)", "sphinx-reredirects", "sphinxcontrib-towncrier"] -testing = ["build[virtualenv]", "filelock (>=3.4.0)", "flake8 (<5)", "flake8-2020", "ini2toml[lite] (>=0.9)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "mock", "pip (>=19.1)", "pip-run (>=8.8)", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1)", "pytest-perf", "pytest-xdist", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] -testing-integration = ["build[virtualenv]", "filelock (>=3.4.0)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "pytest", "pytest-enabler", "pytest-xdist", "tomli", "virtualenv (>=13.0.0)", "wheel"] - [[package]] name = "six" version = "1.16.0" @@ -292,17 +205,13 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [metadata] lock-version = "1.1" python-versions = ">=3.8,<3.11" -content-hash = "724c19d0289033ddebd74865e59fe1a4471ce54652fb6fa98944484a1e00bd83" +content-hash = "395742adec39dc9207da6506bf53e6dc5f780edde32aaea2009b4cb8505750e9" [metadata.files] alfred-pyflow = [ {file = "alfred-pyflow-0.3.2.tar.gz", hash = "sha256:a7dd82d1cef2dad7f0885362bb33f0a81b7374bce014f2fbc7c684290a633a40"}, {file = "alfred_pyflow-0.3.2-py3-none-any.whl", hash = "sha256:f2e33b0f0dff067f83492c85b5bddb046caf20d57e3ac58b78b5df8cc4dd7678"}, ] -altgraph = [ - {file = "altgraph-0.17.3-py2.py3-none-any.whl", hash = "sha256:c8ac1ca6772207179ed8003ce7687757c04b0b71536f81e2ac5755c6226458fe"}, - {file = "altgraph-0.17.3.tar.gz", hash = "sha256:ad33358114df7c9416cdb8fa1eaa5852166c505118717021c6a8c7c7abbd03dd"}, -] black = [ {file = "black-22.10.0-1fixedarch-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:5cc42ca67989e9c3cf859e84c2bf014f6633db63d1cbdf8fdb666dcd9e77e3fa"}, {file = "black-22.10.0-1fixedarch-cp311-cp311-macosx_11_0_x86_64.whl", hash = "sha256:5d8f74030e67087b219b032aa33a919fae8806d49c867846bfacde57f43972ef"}, @@ -327,11 +236,8 @@ black = [ {file = "black-22.10.0.tar.gz", hash = "sha256:f513588da599943e0cde4e32cc9879e825d58720d6557062d1098c5ad80080e1"}, ] ccy = [ - {file = "ccy-1.2.2-py36-none-any.whl", hash = "sha256:4df50b34e977359a61d18402c18c6af6af1766d5b730380e287a7c1270c5da28"}, - {file = "ccy-1.2.2-py37-none-any.whl", hash = "sha256:95432a4ef1eaed7e16e6d22c8f78ecbd6052590bea493aea3dda2298e561ef80"}, - {file = "ccy-1.2.2-py38-none-any.whl", hash = "sha256:18d085376d91e10684ec36fdc59f35931cf112a642945886d4cdf56b432e20d1"}, - {file = "ccy-1.2.2-py39-none-any.whl", hash = "sha256:1ab43bc74a7fcbf38c479168769e43ba567e3903627ab50f121b3d505eb6dc8c"}, - {file = "ccy-1.2.2.tar.gz", hash = "sha256:a65c9ece998fe2b886f40762ed09ec2da011bd37bb8175d2066eb028508e026d"}, + {file = "ccy-1.3.0-py3-none-any.whl", hash = "sha256:d485918172fbbf0d7539f809a404b0ba95c5752a2460602b26368fec1464fde3"}, + {file = "ccy-1.3.0.tar.gz", hash = "sha256:8f6af3f1091ddfc48c58149d9309dc7b3360a12de909bba703349eaa6c66bf58"}, ] certifi = [ {file = "certifi-2022.9.24-py3-none-any.whl", hash = "sha256:90c1a32f1d68f940488354e36370f6cca89f0f106db09518524c88d6ed83f382"}, @@ -346,20 +252,13 @@ click = [ {file = "click-8.1.3.tar.gz", hash = "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e"}, ] colorama = [ - {file = "colorama-0.4.5-py2.py3-none-any.whl", hash = "sha256:854bf444933e37f5824ae7bfc1e98d5bce2ebe4160d46b5edf346a89358e99da"}, - {file = "colorama-0.4.5.tar.gz", hash = "sha256:e6c6b4334fc50988a639d9b98aa429a0b57da6e17b9a44f0451f930b6967b7a4"}, -] -future = [ - {file = "future-0.18.2.tar.gz", hash = "sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d"}, + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] idna = [ {file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"}, {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, ] -macholib = [ - {file = "macholib-1.16.2-py2.py3-none-any.whl", hash = "sha256:44c40f2cd7d6726af8fa6fe22549178d3a4dfecc35a9cd15ea916d9c83a688e0"}, - {file = "macholib-1.16.2.tar.gz", hash = "sha256:557bbfa1bb255c20e9abafe7ed6cd8046b48d9525db2f9b77d3122a63a2a8bf8"}, -] mypy-extensions = [ {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, {file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"}, @@ -368,54 +267,26 @@ pathspec = [ {file = "pathspec-0.10.1-py3-none-any.whl", hash = "sha256:46846318467efc4556ccfd27816e004270a9eeeeb4d062ce5e6fc7a87c573f93"}, {file = "pathspec-0.10.1.tar.gz", hash = "sha256:7ace6161b621d31e7902eb6b5ae148d12cfd23f4a249b9ffb6b9fee12084323d"}, ] -pefile = [ - {file = "pefile-2022.5.30.tar.gz", hash = "sha256:a5488a3dd1fd021ce33f969780b88fe0f7eebb76eb20996d7318f307612a045b"}, -] platformdirs = [ {file = "platformdirs-2.5.2-py3-none-any.whl", hash = "sha256:027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788"}, {file = "platformdirs-2.5.2.tar.gz", hash = "sha256:58c8abb07dcb441e6ee4b11d8df0ac856038f944ab98b7be6b27b2a3c7feef19"}, ] pycoingecko = [ - {file = "pycoingecko-3.0.0-py3-none-any.whl", hash = "sha256:f848c6f785c26944e3cb1f9425fc86a1a8cbb68016f592dc7a4ebf54d9517a12"}, - {file = "pycoingecko-3.0.0.tar.gz", hash = "sha256:bd49d92f918bc3f03ba9c042558844992576fbee859e438ddeafefd41861d2b1"}, -] -pyinstaller = [ - {file = "pyinstaller-5.5-py3-none-macosx_10_13_universal2.whl", hash = "sha256:838e0a385355e55833f2ac62e75290f345d0b57bad53f08742c28a7cb96e91c8"}, - {file = "pyinstaller-5.5-py3-none-manylinux2014_aarch64.whl", hash = "sha256:2a2fc8755b00cc1ea4d89bb81f8ada8c2afe0d13a7f7b35020e8a694d6882c9e"}, - {file = "pyinstaller-5.5-py3-none-manylinux2014_i686.whl", hash = "sha256:94e947980c7d9b7e422f4af9885f12560cb546ee2017fb0f2c8af5a9a309c63f"}, - {file = "pyinstaller-5.5-py3-none-manylinux2014_ppc64le.whl", hash = "sha256:5f8834af70a6e080ab4fe53ec2b8b4fdfcc0106bd8db7cc27da9a8973ecffe05"}, - {file = "pyinstaller-5.5-py3-none-manylinux2014_s390x.whl", hash = "sha256:47a63d42ceb73355bf3afec51109ee3f5b3893f068be821a6735cada229ab680"}, - {file = "pyinstaller-5.5-py3-none-manylinux2014_x86_64.whl", hash = "sha256:91c0947063f49b21476e374662f62b00d0cf5a97ad6851c12124280409aebbd1"}, - {file = "pyinstaller-5.5-py3-none-musllinux_1_1_aarch64.whl", hash = "sha256:9e8950c599847d15e7d7b8c18073fab267d7d3d41650a64c46278b97655076d3"}, - {file = "pyinstaller-5.5-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:d902a9b669f90665a3abe5d0f176784fc3f2e1320d6c98df0bd1457c77ca706a"}, - {file = "pyinstaller-5.5-py3-none-win32.whl", hash = "sha256:c7326298be50adcdf799e9b3f880543b925be7341cb1ac2a1e5b1a47b9dc3183"}, - {file = "pyinstaller-5.5-py3-none-win_amd64.whl", hash = "sha256:d06378354b8d3d08309fddb230c813fc750848d71156274c15afdfedd56f57cf"}, - {file = "pyinstaller-5.5.tar.gz", hash = "sha256:88993dfc6429dce8dd1f9a73c08e259af71dd3a227d3002ccb8e959151757dc3"}, -] -pyinstaller-hooks-contrib = [ - {file = "pyinstaller-hooks-contrib-2022.10.tar.gz", hash = "sha256:e5edd4094175e78c178ef987b61be19efff6caa23d266ade456fc753e847f62e"}, - {file = "pyinstaller_hooks_contrib-2022.10-py2.py3-none-any.whl", hash = "sha256:d1dd6ea059dc30e77813cc12a5efa8b1d228e7da8f5b884fe11775f946db1784"}, + {file = "pycoingecko-3.1.0-py3-none-any.whl", hash = "sha256:5798240c0ffccfea14635b7ce42f90e49c8ba54a3cfa3e233fcc99df087485f6"}, + {file = "pycoingecko-3.1.0.tar.gz", hash = "sha256:dcc08522c160e88bd1deb50bbab390be33dce87abb10a91ce6013d15bf859c12"}, ] python-dateutil = [ {file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"}, {file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"}, ] pytz = [ - {file = "pytz-2022.4-py2.py3-none-any.whl", hash = "sha256:2c0784747071402c6e99f0bafdb7da0fa22645f06554c7ae06bf6358897e9c91"}, - {file = "pytz-2022.4.tar.gz", hash = "sha256:48ce799d83b6f8aab2020e369b627446696619e79645419610b9facd909b3174"}, -] -pywin32-ctypes = [ - {file = "pywin32-ctypes-0.2.0.tar.gz", hash = "sha256:24ffc3b341d457d48e8922352130cf2644024a4ff09762a2261fd34c36ee5942"}, - {file = "pywin32_ctypes-0.2.0-py2.py3-none-any.whl", hash = "sha256:9dc2d991b3479cc2df15930958b674a48a227d5361d413827a4cfd0b5876fc98"}, + {file = "pytz-2022.6-py2.py3-none-any.whl", hash = "sha256:222439474e9c98fced559f1709d89e6c9cbf8d79c794ff3eb9f8800064291427"}, + {file = "pytz-2022.6.tar.gz", hash = "sha256:e89512406b793ca39f5971bc999cc538ce125c0e51c27941bef4568b460095e2"}, ] requests = [ {file = "requests-2.28.1-py3-none-any.whl", hash = "sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349"}, {file = "requests-2.28.1.tar.gz", hash = "sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983"}, ] -setuptools = [ - {file = "setuptools-65.4.1-py3-none-any.whl", hash = "sha256:1b6bdc6161661409c5f21508763dc63ab20a9ac2f8ba20029aaaa7fdb9118012"}, - {file = "setuptools-65.4.1.tar.gz", hash = "sha256:3050e338e5871e70c72983072fe34f6032ae1cdeeeb67338199c2f74e083a80e"}, -] six = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, diff --git a/pyproject.toml b/pyproject.toml index c5300e7..6911567 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "Currency Converter" -version = "2.6.0" +version = "2.7.0" description = "Convert between multiple fiat and crypto currencies" documentation = "https://github.com/fedecalendino/alfred-currency-converter/blob/main/README.md" homepage = "https://github.com/fedecalendino/alfred-currency-converter" @@ -14,12 +14,11 @@ authors = [ python = ">=3.8,<3.11" alfred-pyflow = "latest" requests = "^2.28.1" -pycoingecko = "^3.0.0" -ccy = "^1.2.2" +pycoingecko = "^3.1.0" +ccy = "^1.3.0" [tool.poetry.dev-dependencies] black = "22.10.0" -pyinstaller = "5.5" [build-system] requires = ["poetry-core>=1.0.0"] diff --git a/scripts/build.sh b/scripts/build.sh index 54a25d2..f17f957 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,24 +1,19 @@ -function build() { - echo "Generating $1 binary" - echo - - poetry run pyinstaller --onedir --paths ./src/ "src/$1.py" 1> /dev/null - - echo "Workspace cleanup" - echo +rm -rf "./dist/" - rm "./$1.spec" - rm -rf "./build/" +echo "Copy dependencies" +cp -r $(find .venv | egrep "site-packages$") ./dist - echo - echo "Finished generating bin file for $1" - echo -} +echo "Clean up dist folder" +cd dist +ls -d */ | grep info | xargs rm -rf +ls | egrep "^\_.*" | xargs rm -rf +rm -rf *.so black blackd blib2to3 distutils* pkg_resources pip* setuptools* wheel* -rm -rf "./dist/" +cd .. -build main +echo "Copy source code" +cp -r ./src/* dist echo "Finished" echo diff --git a/scripts/release.sh b/scripts/release.sh index 2c48f43..d0c5207 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -15,7 +15,7 @@ echo "NEW VERSION: v$VERSION" echo -echo "Building binaries..." +echo "Building dist..." echo ./scripts/build.sh > /dev/null echo diff --git a/src/main.py b/src/main.py index 47997af..81edacd 100644 --- a/src/main.py +++ b/src/main.py @@ -1,7 +1,9 @@ import sys from pyflow import Workflow -from src import util, api + +import api +import util def fetch_rates(workflow):