setup.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #!/usr/bin/env python3
  2. import os
  3. import re
  4. from pathlib import Path
  5. from setuptools import setup
  6. try:
  7. from cx_Freeze import setup, Executable
  8. cx_Freeze = True
  9. except ImportError as e:
  10. cx_Freeze = False
  11. basedir = Path(__file__).parent.absolute()
  12. isWindows = os.name.lower() == "nt"
  13. extraKeywords = {}
  14. # Create freeze executable list.
  15. if cx_Freeze:
  16. extraKeywords["executables"] = [
  17. Executable(script="piccol",
  18. base=("Win32GUI" if isWindows else None)),
  19. ]
  20. extraKeywords["options"] = {
  21. "build_exe" : {
  22. "packages" : [],
  23. "excludes" : [
  24. "PyQt5.QtCore", "PyQt5.QtGui", "PyQt5.QtWidgets",
  25. "PySide2.QtCore", "PySide2.QtGui", "PySide2.QtWidgets",
  26. "tkinter",
  27. "test", "unittest",
  28. ],
  29. },
  30. }
  31. # Get version.
  32. with open(basedir / "piccol", "rb") as fd:
  33. m = re.match(r'.*^\s*PICCOL_VERSION\s*=\s*"([\w\d\.\-_]+)"\s*$.*',
  34. fd.read().decode("UTF-8"),
  35. re.DOTALL | re.MULTILINE)
  36. assert m
  37. version = m.group(1)
  38. print("piccol version %s" % version)
  39. # Get readme text.
  40. with open(basedir / "README.md", "rb") as fd:
  41. readmeText = fd.read().decode("UTF-8")
  42. setup(
  43. name = "piccol",
  44. version = version,
  45. description = "Color picker and translator",
  46. license = "GNU General Public License v2 or later",
  47. author = "Michael Büsch",
  48. author_email = "m@bues.ch",
  49. url = "https://bues.ch/",
  50. scripts = [ "piccol", ],
  51. keywords = [ "color", "RGB", "HLS", "HSL", ],
  52. install_requires = [ "PyQt6", ],
  53. python_requires = ">=3.7",
  54. classifiers = [
  55. "Development Status :: 5 - Production/Stable",
  56. "Environment :: Win32 (MS Windows)",
  57. "Environment :: X11 Applications",
  58. "Environment :: X11 Applications :: Qt",
  59. "Intended Audience :: End Users/Desktop",
  60. "Intended Audience :: Developers",
  61. "Intended Audience :: Education",
  62. "Intended Audience :: Information Technology",
  63. "Intended Audience :: System Administrators",
  64. "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
  65. "Operating System :: Microsoft :: Windows",
  66. "Operating System :: POSIX",
  67. "Operating System :: POSIX :: Linux",
  68. "Programming Language :: Python",
  69. "Programming Language :: Python :: 3",
  70. "Programming Language :: Python :: Implementation :: CPython",
  71. "Topic :: Desktop Environment",
  72. "Topic :: Education",
  73. "Topic :: Scientific/Engineering",
  74. "Topic :: Software Development",
  75. ],
  76. long_description=readmeText,
  77. long_description_content_type="text/markdown",
  78. **extraKeywords
  79. )