2020-07-21 05:20:12 -04:00
|
|
|
import distutils, distutils.util
|
|
|
|
import os
|
2020-07-20 17:54:59 -04:00
|
|
|
import setuptools
|
2020-07-22 12:11:43 -04:00
|
|
|
import sys
|
2020-07-20 17:54:59 -04:00
|
|
|
|
|
|
|
import lokrez, lokrez.version
|
|
|
|
|
2020-07-21 05:20:12 -04:00
|
|
|
# Load README for long_description
|
2020-07-20 17:54:59 -04:00
|
|
|
with open("README.adoc", "r") as fh:
|
|
|
|
long_description = fh.read()
|
|
|
|
|
2020-07-22 12:11:43 -04:00
|
|
|
# Windows build
|
2020-07-21 05:20:12 -04:00
|
|
|
if os.name == "nt":
|
2020-07-22 12:11:43 -04:00
|
|
|
import cx_Freeze
|
|
|
|
|
2020-07-21 05:20:12 -04:00
|
|
|
arch = distutils.util.get_platform().split("-")[-1]
|
2020-07-22 12:11:43 -04:00
|
|
|
|
2020-07-21 05:20:12 -04:00
|
|
|
build_exe_options = {
|
|
|
|
"packages": ["os"],
|
|
|
|
"include_msvcr": True,
|
2020-07-22 12:11:43 -04:00
|
|
|
"include_files": [ "lokrez/data", "lokrez/templates", "lokrez/queries" ],
|
|
|
|
"includes": ["idna.idnadata"], # Because of cx-freeze bug
|
2020-07-21 05:20:12 -04:00
|
|
|
}
|
2020-07-22 12:11:43 -04:00
|
|
|
|
2020-07-21 05:20:12 -04:00
|
|
|
bdist_msi_options = {
|
|
|
|
"upgrade_code": "{123456789-1337-8483-ABCD-DEADBEEFCAFE}",
|
|
|
|
"add_to_path": True,
|
|
|
|
"initial_target_dir": r"[LocalAppDataFolder]\{}\{}" \
|
|
|
|
.format(
|
2020-07-22 12:11:43 -04:00
|
|
|
lokrez.version.ENTITY,
|
2020-07-21 05:20:12 -04:00
|
|
|
lokrez.version.NAME,
|
|
|
|
),
|
|
|
|
}
|
|
|
|
|
|
|
|
base = None
|
|
|
|
|
2020-07-22 12:11:43 -04:00
|
|
|
cx_Freeze.setup(
|
|
|
|
name = lokrez.version.NAME,
|
|
|
|
version = lokrez.version.__version__.replace("dev", "1337"),
|
|
|
|
author = lokrez.version.AUTHOR,
|
|
|
|
author_email = lokrez.version.AUTHOR_EMAIL,
|
|
|
|
description = lokrez.version.DESCRIPTION,
|
|
|
|
install_requires = [
|
|
|
|
"jinja2",
|
|
|
|
"requests",
|
|
|
|
"appdirs",
|
|
|
|
],
|
|
|
|
options = {
|
|
|
|
"build_exe": build_exe_options,
|
|
|
|
"bdist_msi": bdist_msi_options,
|
|
|
|
},
|
2020-07-21 05:20:12 -04:00
|
|
|
|
2020-07-22 12:11:43 -04:00
|
|
|
executables = [
|
|
|
|
cx_Freeze.Executable(
|
|
|
|
script = "lokrez/__main__.py",
|
|
|
|
targetName = "{}.exe".format(lokrez.version.NAME),
|
|
|
|
base = base,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)
|
2020-07-21 05:20:12 -04:00
|
|
|
|
2020-07-22 12:11:43 -04:00
|
|
|
sys.exit(0)
|
2020-07-21 05:20:12 -04:00
|
|
|
|
2020-07-22 12:11:43 -04:00
|
|
|
# Linux build
|
|
|
|
if os.name == "posix":
|
|
|
|
|
|
|
|
setuptools.setup(
|
|
|
|
name = lokrez.version.NAME,
|
|
|
|
version = lokrez.__version__,
|
|
|
|
author = lokrez.version.AUTHOR,
|
|
|
|
author_email = lokrez.version.AUTHOR_EMAIL,
|
|
|
|
description = lokrez.version.DESCRIPTION,
|
|
|
|
long_description = long_description,
|
|
|
|
long_description_content_type = "text/asciidoc",
|
|
|
|
url = lokrez.version.URL,
|
|
|
|
packages = ["lokrez"],
|
|
|
|
install_requires = [
|
|
|
|
"jinja2",
|
|
|
|
"requests",
|
|
|
|
"appdirs",
|
2020-07-20 17:54:59 -04:00
|
|
|
],
|
2020-07-22 12:11:43 -04:00
|
|
|
license = lokrez.version.__license__,
|
|
|
|
classifiers = [
|
|
|
|
"Programming Language :: Python :: 3",
|
|
|
|
"License :: OSI Approved :: MIT License",
|
|
|
|
"Operating System :: OS Independent",
|
|
|
|
"Intended Audience :: Smash Bros Ultimate Players",
|
2020-07-20 17:54:59 -04:00
|
|
|
],
|
2020-07-22 12:11:43 -04:00
|
|
|
python_requires = ">=3.5",
|
|
|
|
keywords = "smash ultimate local results esport smashgg",
|
|
|
|
# data_files = ("res", ["res/playerskinsdb.json"])
|
|
|
|
package_data = {
|
|
|
|
"lokrez": [
|
|
|
|
"data/*.json",
|
|
|
|
"queries/*.gql",
|
|
|
|
"templates/*/*.j2",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
entry_points = {
|
|
|
|
"console_scripts": [
|
|
|
|
"lokrez = lokrez:main",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
)
|