|
12 | 12 | # See the License for the specific language governing permissions and
|
13 | 13 | # limitations under the License.
|
14 | 14 |
|
15 |
| -from setuptools import find_packages, setup |
| 15 | +from setuptools import setup |
16 | 16 |
|
17 | 17 | # Do not edit these constants. They will be updated automatically
|
18 | 18 | # by scripts/update-client.sh.
|
|
27 | 27 | # prerequisite: setuptools
|
28 | 28 | # http://pypi.python.org/pypi/setuptools
|
29 | 29 |
|
| 30 | +EXTRAS = {} |
| 31 | +REQUIRES = [] |
30 | 32 | with open('requirements.txt') as f:
|
31 |
| - REQUIRES = f.readlines() |
| 33 | + for line in f: |
| 34 | + line, _, _ = line.partition('#') |
| 35 | + line = line.strip() |
| 36 | + if ';' in line: |
| 37 | + requirement, _, specifier = line.partition(';') |
| 38 | + for_specifier = EXTRAS.setdefault(':{}'.format(specifier), []) |
| 39 | + for_specifier.append(requirement) |
| 40 | + else: |
| 41 | + REQUIRES.append(line) |
32 | 42 |
|
33 | 43 | with open('test-requirements.txt') as f:
|
34 | 44 | TESTS_REQUIRES = f.readlines()
|
|
44 | 54 | keywords=["Swagger", "OpenAPI", "Kubernetes"],
|
45 | 55 | install_requires=REQUIRES,
|
46 | 56 | tests_require=TESTS_REQUIRES,
|
| 57 | + extras_require=EXTRAS, |
47 | 58 | packages=['kubernetes', 'kubernetes.client', 'kubernetes.config',
|
48 | 59 | 'kubernetes.watch', 'kubernetes.client.apis',
|
49 | 60 | 'kubernetes.stream', 'kubernetes.client.models'],
|
|
0 commit comments