diff --git a/Makefile b/Makefile index d5a7b1f..9eb84e1 100644 --- a/Makefile +++ b/Makefile @@ -16,3 +16,6 @@ lint: pretty: black --target-version py38 --skip-string-normalization --line-length=100 $(CODE) isort $(CODE) + +build: + python ./setup.py bdist diff --git a/poetry.lock b/poetry.lock index 9509104..866545e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -28,14 +28,14 @@ optional = false python-versions = ">=3.6" [package.dependencies] -appdirs = "*" -click = ">=7.1.2" -mypy-extensions = ">=0.4.3" -pathspec = ">=0.6,<1" regex = ">=2020.1.8" -toml = ">=0.10.1" +mypy-extensions = ">=0.4.3" typed-ast = ">=1.4.0" +toml = ">=0.10.1" typing-extensions = ">=3.7.4" +pathspec = ">=0.6,<1" +click = ">=7.1.2" +appdirs = "*" [package.extras] colorama = ["colorama (>=0.4.3)"] @@ -57,6 +57,17 @@ category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +[[package]] +name = "cx-freeze" +version = "6.4.1" +description = "Create standalone executables from Python scripts" +category = "main" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +importlib-metadata = ">=1.6.1" + [[package]] name = "et-xmlfile" version = "1.0.1" @@ -87,13 +98,28 @@ optional = false python-versions = "*" [package.dependencies] -flake8 = ">=3.2.1,<4" -isort = ">=4.3.5,<6" testfixtures = ">=6.8.0,<7" +isort = ">=4.3.5,<6" +flake8 = ">=3.2.1,<4" [package.extras] test = ["pytest (>=4.0.2,<6)", "toml"] +[[package]] +name = "importlib-metadata" +version = "3.1.1" +description = "Read metadata from Python packages" +category = "main" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +zipp = ">=0.5" + +[package.extras] +docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] +testing = ["pytest (>=3.5,!=3.7.3)", "pytest-checkdocs (>=1.2.3)", "pytest-flake8", "pytest-cov", "jaraco.test (>=3.2.0)", "packaging", "pep517", "pyfakefs", "flufl.flake8", "pytest-black (>=0.3.7)", "pytest-mypy", "importlib-resources (>=1.3)"] + [[package]] name = "isort" version = "5.6.4" @@ -103,9 +129,9 @@ optional = false python-versions = ">=3.6,<4.0" [package.extras] +colors = ["colorama (>=0.4.3,<0.5.0)"] pipfile_deprecated_finder = ["pipreqs", "requirementslib"] requirements_deprecated_finder = ["pipreqs", "pip-api"] -colors = ["colorama (>=0.4.3,<0.5.0)"] [[package]] name = "jdcal" @@ -148,8 +174,8 @@ optional = false python-versions = ">=3.6," [package.dependencies] -et-xmlfile = "*" jdcal = "*" +et-xmlfile = "*" [[package]] name = "pathspec" @@ -185,10 +211,10 @@ python-versions = ">=3.5.*" [package.dependencies] astroid = ">=2.4.0,<=2.5" -colorama = {version = "*", markers = "sys_platform == \"win32\""} -isort = ">=4.2.5,<6" mccabe = ">=0.6,<0.7" +colorama = {version = "*", markers = "sys_platform == \"win32\""} toml = ">=0.7.1" +isort = ">=4.2.5,<6" [[package]] name = "pyqt5" @@ -242,9 +268,9 @@ optional = false python-versions = "*" [package.extras] -build = ["setuptools-git", "wheel", "twine"] -docs = ["sphinx", "zope.component", "sybil", "twisted", "mock", "django (<2)", "django"] test = ["pytest (>=3.6)", "pytest-cov", "pytest-django", "zope.component", "sybil", "twisted", "mock", "django (<2)", "django"] +docs = ["sphinx", "zope.component", "sybil", "twisted", "mock", "django (<2)", "django"] +build = ["setuptools-git", "wheel", "twine"] [[package]] name = "toml" @@ -278,10 +304,22 @@ category = "dev" optional = false python-versions = "*" +[[package]] +name = "zipp" +version = "3.4.0" +description = "Backport of pathlib-compatible object wrapper for zip files" +category = "main" +optional = false +python-versions = ">=3.6" + +[package.extras] +docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"] +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] lock-version = "1.1" python-versions = "~3.8" -content-hash = "b65cf9fe4c2ef6ebb8dc9bdd12f62d59f0e34ab9abb9cacb1c2d36693929af52" +content-hash = "d6fb2a95e2095774c31b2ecd694d49a823dae2a7705518f79562df67ece0371b" [metadata.files] appdirs = [ @@ -303,6 +341,17 @@ colorama = [ {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, ] +cx-freeze = [ + {file = "cx_Freeze-6.4.1-cp36-cp36m-win32.whl", hash = "sha256:cfa313f62dc048a45871a1a0f3bab8f059d4812dc48addea0a1028c7e50849d8"}, + {file = "cx_Freeze-6.4.1-cp36-cp36m-win_amd64.whl", hash = "sha256:9f25b642e9fc0a9f0e16fa470f3f9659944afb9a0dbbd7a3a75d4c216c156113"}, + {file = "cx_Freeze-6.4.1-cp37-cp37m-win32.whl", hash = "sha256:bc50c8e2b02954463028f3f6ffb197c8ebd8824df0a4013c82135c983f3bcfd3"}, + {file = "cx_Freeze-6.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:f3b7b79a624be55d73078f2f7e64ab63f667b2680fefdf34c20c6d22b3737534"}, + {file = "cx_Freeze-6.4.1-cp38-cp38-win32.whl", hash = "sha256:9d2f9fda84000c4ca405e08bb620eda247740b749ccf4aa51109571a3a478547"}, + {file = "cx_Freeze-6.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:a460a85c9eb7c51a1777e2cb70b84166b93b02d936aa4054627ed789fe2d0ce9"}, + {file = "cx_Freeze-6.4.1-cp39-cp39-win32.whl", hash = "sha256:c273c429f1c2a3777adf4e04f1b5b8b47c2f8f69bfb05890769330b7e1bacf1d"}, + {file = "cx_Freeze-6.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:e81f5606278d4e885360af10414386973bfc8cd42cfa72f20eea15eea82bf623"}, + {file = "cx_Freeze-6.4.1.tar.gz", hash = "sha256:043513b85e33038e38cc0571cea1f3ee8044ec083891c9a5dad1d436894424ea"}, +] et-xmlfile = [ {file = "et_xmlfile-1.0.1.tar.gz", hash = "sha256:614d9722d572f6246302c4491846d2c393c199cfa4edc9af593437691683335b"}, ] @@ -314,6 +363,10 @@ flake8-isort = [ {file = "flake8-isort-4.0.0.tar.gz", hash = "sha256:2b91300f4f1926b396c2c90185844eb1a3d5ec39ea6138832d119da0a208f4d9"}, {file = "flake8_isort-4.0.0-py2.py3-none-any.whl", hash = "sha256:729cd6ef9ba3659512dee337687c05d79c78e1215fdf921ed67e5fe46cce2f3c"}, ] +importlib-metadata = [ + {file = "importlib_metadata-3.1.1-py3-none-any.whl", hash = "sha256:6112e21359ef8f344e7178aa5b72dc6e62b38b0d008e6d3cb212c5b84df72013"}, + {file = "importlib_metadata-3.1.1.tar.gz", hash = "sha256:b0c2d3b226157ae4517d9625decf63591461c66b3a808c2666d538946519d170"}, +] isort = [ {file = "isort-5.6.4-py3-none-any.whl", hash = "sha256:dcab1d98b469a12a1a624ead220584391648790275560e1a43e54c5dceae65e7"}, {file = "isort-5.6.4.tar.gz", hash = "sha256:dcaeec1b5f0eca77faea2a35ab790b4f3680ff75590bfcb7145986905aab2f58"}, @@ -501,3 +554,7 @@ typing-extensions = [ wrapt = [ {file = "wrapt-1.12.1.tar.gz", hash = "sha256:b62ffa81fb85f4332a4f609cab4ac40709470da05643a082ec1eb88e6d9b97d7"}, ] +zipp = [ + {file = "zipp-3.4.0-py3-none-any.whl", hash = "sha256:102c24ef8f171fd729d46599845e95c7ab894a4cf45f5de11a44cc7444fb1108"}, + {file = "zipp-3.4.0.tar.gz", hash = "sha256:ed5eee1974372595f9e416cc7bbeeb12335201d8081ca8a0743c954d4446e5cb"}, +] diff --git a/pyproject.toml b/pyproject.toml index 501d02a..0adf5f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,6 +9,7 @@ python = "~3.8" "Qt5.py" = "^0.1.0" PyQt5 = "^5.15.1" openpyxl = "^3.0.5" +cx-Freeze = "^6.4.1" [tool.poetry.dev-dependencies] black = "^20.8b1" diff --git a/qt/__init__.py b/qt/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..cef0163 --- /dev/null +++ b/setup.py @@ -0,0 +1,22 @@ +import sys +from distutils.core import setup + +from cx_Freeze import Executable, setup + +# Dependencies are automatically detected, but it might need fine tuning. +# build_exe_options = {"packages": ["os"], "excludes": ["tkinter"]} +build_exe_options = {} + +# GUI applications require a different base on Windows (the default is for a +# console application). +base = None +if sys.platform == "win32": + base = "Win32GUI" + +setup( + name="Printer", + version="0.1", + description="Printtr", + options={"build_exe": build_exe_options}, + executables=[Executable("print.py", base=base, icon='Icon.ico')], +)