-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
128 lines (94 loc) · 3.4 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#!/usr/bin/env python
# -*- coding: ascii -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
"""Python jpencconverter jenc library
Copyright (C) 2024 Chris Clark (clach04)
https://github.com/clach04/jenc-py
Original Java version https://github.com/opensource21/jpencconverter and
https://gitlab.com/opensource21/jpencconverter
"""
import sys
import os
import platform
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup
find_packages = None
from distutils.util import get_platform
try:
from docutils.core import publish_cmdline
except ImportError:
publish_cmdline = None
is_win = sys.platform.startswith('win')
is_cpython = platform.python_implementation() == 'CPython'
readme_filename = 'README.md'
if os.path.exists(readme_filename):
f = open(readme_filename)
long_description = f.read()
f.close()
else:
long_description = None
if len(sys.argv) <= 1:
print("""
Suggested setup.py parameters:
* build
* install
* sdist --formats=zip
* sdist # NOTE requires tar/gzip commands
python -m pip install -e .
PyPi:
python -m pip install setuptools twine
python setup.py sdist
# python setup.py sdist --formats=zip
python -m twine upload dist/* --verbose
./setup.py sdist ; twine upload dist/* --verbose
""")
# Metadata
project_name = 'jenc'
project_name_lower = project_name.lower()
description = 'Python jenc jpencconverter encryption implementation'
license = "Apache Software License" # ensure this matches tail of http://pypi.python.org/pypi?%3Aaction=list_classifiers
__version__ = None # Overwritten by executing _version.py.
exec(open(os.path.join(os.path.abspath(os.path.dirname(__file__)), project_name_lower, '_version.py')).read()) # get __version__
person_name = 'clach04'
person_email = None
# disable package finding, explictly list package
find_packages = False
if find_packages:
packages = find_packages()
else:
packages = [project_name_lower]
setup(
name=project_name,
version=__version__,
url='https://github.com/clach04/' + project_name + '-py',
author=person_name,
author_email=person_email,
maintainer=person_name,
maintainer_email=person_email,
packages=packages,
license=license, # NOTE http://guide.python-distribute.org/creation.html and http://docs.python.org/distutils/setupscript.html disagree on what this field is
description=description,
long_description=long_description,
long_description_content_type='text/markdown',
classifiers=[ # See http://pypi.python.org/pypi?%3Aaction=list_classifiers
'Development Status :: 4 - Beta',
'License :: OSI Approved :: ' + license,
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Operating System :: Microsoft :: Windows :: Windows NT/2000',
'Operating System :: POSIX',
'Operating System :: POSIX :: Linux',
'Operating System :: Unix',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.12',
'Topic :: Security :: Cryptography',
],
platforms='any',
install_requires=['pycryptodome'], # PyCrypto will also work in a pinch. TODO optional pure AES, and Jython/Java support
zip_safe=True,
)