-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathsetup.py
executable file
·103 lines (92 loc) · 3.5 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
#!/usr/bin/env python
# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import sys
import re
from setuptools import setup, find_packages
import ebcli
def parse_requirements(filename):
"""
Parse a requirements file, returning a list of requirements.
This replaces the deprecated pkg_resources.parse_requirements function.
"""
requirements = []
with open(filename) as f:
for line in f:
line = line.strip()
# Skip empty lines, comments, and editable installs
if not line or line.startswith('#'):
continue
# Handle requirement specs with markers
if ';' in line:
req, marker = line.split(';', 1)
requirements.append(f"{req.strip()};{marker.strip()}")
else:
requirements.append(line)
return requirements
# Parse requirements.txt
requires = parse_requirements("requirements.txt")
testing_requires = [
'mock>=2.0.0',
'pytest>=8.3.5',
'pytest_socket>=0.5.1',
]
extras_require = {
# use the same ranges as 'docker-py':
# https://github.com/docker/docker-py/blob/e0495a91e49d19dc357513536c2882b7eaf28a05/setup.py#L29-L30
':sys_platform == "win32" and python_version < "3.6"': 'pypiwin32==219',
':sys_platform == "win32" and python_version >= "3.6"': 'pypiwin32==223',
}
if sys.platform.startswith('win'):
requires.append('pythonnet>=3.0.5,<4')
setup_options = dict(
name='awsebcli',
version=ebcli.__version__,
description='Command Line Interface for AWS EB.',
long_description=open('README.rst').read() + open('CHANGES.rst').read(),
data_files=[('', ['requirements.txt'])],
author='AWS Elastic Beanstalk',
author_email='[email protected]',
url='http://aws.amazon.com/elasticbeanstalk/',
packages=find_packages('.', exclude=['tests*', 'docs*', 'sampleApps*', 'scripts*']),
package_dir={'ebcli': 'ebcli'},
package_data={
'ebcli.lib': ['botocoredata/*/*/*.json'],
'ebcli.containers': ['containerfiles/*'],
'ebcli.labs': ['cloudwatchfiles/*.config'],
'ebcli.controllers': ['migrate_scripts/*.ps1']},
install_requires=requires,
extras_require=extras_require,
license="Apache License 2.0",
classifiers=(
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Natural Language :: English',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
),
entry_points={
'console_scripts': [
'eb=ebcli.core.ebcore:main',
'ebp=ebcli.core.ebpcore:main'
]
},
)
setup(**setup_options)