setup.py 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. from distutils.core import setup
  4. try:
  5. from cx_Freeze import setup, Executable
  6. cx_Freeze = True
  7. except ImportError:
  8. cx_Freeze = False
  9. import warnings
  10. import os
  11. import sys
  12. from libpwman import __version__
  13. basedir = os.path.abspath(os.path.dirname(__file__))
  14. for base in (os.getcwd(), basedir):
  15. sys.path.insert(0, base)
  16. isWindows = os.name.lower() in {"nt", "ce"}
  17. isPosix = os.name.lower() == "posix"
  18. # Create freeze executable list.
  19. extraKeywords = {}
  20. if cx_Freeze:
  21. guiBase = "Win32GUI" if isWindows else None
  22. freezeExecutables = [
  23. ("pwman", None, None),
  24. ]
  25. executables = []
  26. for script, exe, base in freezeExecutables:
  27. if exe:
  28. if isWindows:
  29. exe += ".exe"
  30. executables.append(Executable(script=script,
  31. targetName=exe,
  32. base=base))
  33. else:
  34. executables.append(Executable(script=script,
  35. base=base))
  36. extraKeywords["executables"] = executables
  37. extraKeywords["options"] = {
  38. "build_exe" : {
  39. "packages" : [ "readline",
  40. "pyreadline",
  41. "curses",
  42. "_curses",
  43. "sqlite3",
  44. "sqlite3.dump", ],
  45. "excludes" : [ "tkinter", ],
  46. }
  47. }
  48. warnings.filterwarnings("ignore", r".*'python_requires'.*")
  49. warnings.filterwarnings("ignore", r".*'install_requires'.*")
  50. warnings.filterwarnings("ignore", r".*'long_description_content_type'.*")
  51. with open(os.path.join(basedir, "README.rst"), "rb") as fd:
  52. readmeText = fd.read().decode("UTF-8")
  53. setup(
  54. name = "pwman-python",
  55. version = __version__,
  56. description = "Commandline password manager",
  57. author = "Michael Buesch",
  58. author_email = "m@bues.ch",
  59. url = "https://bues.ch/h/pwman",
  60. python_requires = ">=3.7",
  61. install_requires = [ "pyaes", ],
  62. packages = [ "libpwman", ],
  63. scripts = [ "pwman", ],
  64. keywords = "password manager command line TOTP 2FA",
  65. classifiers = [
  66. "Development Status :: 5 - Production/Stable",
  67. "Environment :: Console",
  68. "Intended Audience :: Developers",
  69. "Intended Audience :: Information Technology",
  70. "Intended Audience :: End Users/Desktop",
  71. "Intended Audience :: System Administrators",
  72. "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
  73. "Operating System :: OS Independent",
  74. "Programming Language :: Python :: 3",
  75. ],
  76. long_description=readmeText,
  77. long_description_content_type="text/x-rst",
  78. **extraKeywords
  79. )