|
28 | 28 | ) |
29 | 29 |
|
30 | 30 |
|
| 31 | +base_cryptography_require = ["cryptography>=38.0.3"] |
| 32 | + |
| 33 | +python38_cryptography_require = ["cryptography < 39.0.0; python_version <= '3.8'"] |
| 34 | + |
31 | 35 | requests_extra_require = ["requests >= 2.20.0, < 3.0.0.dev0"] |
32 | | -aiohttp_extra_require = [ |
33 | | - "aiohttp >= 3.6.2, < 4.0.0.dev0", |
34 | | -] + requests_extra_require |
| 36 | + |
| 37 | +aiohttp_extra_require = ["aiohttp >= 3.6.2, < 4.0.0.dev0", *requests_extra_require] |
35 | 38 |
|
36 | 39 | pyjwt_extra_require = [ |
37 | 40 | "pyjwt>=2.0", |
38 | | - "cryptography>=38.0.3", |
39 | | - "cryptography < 39.0.0; python_version == '3.7'", |
| 41 | + *base_cryptography_require, |
| 42 | + *python38_cryptography_require, |
40 | 43 | ] |
41 | 44 |
|
42 | 45 | reauth_extra_require = ["pyu2f>=0.1.5"] |
43 | 46 |
|
| 47 | +enterprise_cert_extra_require = [ |
| 48 | + "cryptography", |
| 49 | + "pyopenssl", |
| 50 | + *python38_cryptography_require, |
| 51 | +] |
| 52 | + |
| 53 | +pyopenssl_extra_require = [ |
| 54 | + "pyopenssl>=20.0.0", |
| 55 | + *base_cryptography_require, |
| 56 | + *python38_cryptography_require, |
| 57 | +] |
| 58 | + |
44 | 59 | # Unit test requirements. |
45 | | -testing_extra_require = ( |
46 | | - [ |
47 | | - "flask", |
48 | | - "freezegun", |
49 | | - "mock", |
50 | | - "pyopenssl", |
51 | | - "pytest", |
52 | | - "pytest-cov", |
53 | | - "pytest-localserver", |
54 | | - "pyu2f", |
55 | | - "responses", |
56 | | - # TODO(): Remove `grpcio` from testing requirements once an extra is added for `grpcio` dependency. |
57 | | - "grpcio", |
58 | | - # TODO(): Remove `oauth2client` from testing requirements once an extra is added for `grpcio` dependency. |
59 | | - "oauth2client", |
60 | | - # Async Dependencies |
61 | | - # TODO(https://github.com/googleapis/google-auth-library-python/issues/1722): `test_aiohttp_requests` depend on |
62 | | - # aiohttp < 3.10.0 which is a bug. Investigate and remove the pinned aiohttp version and use `aiohttp_extra_require`. |
63 | | - "aiohttp < 3.10.0", |
64 | | - "pytest-asyncio", |
65 | | - "aioresponses", |
66 | | - ] |
67 | | - + pyjwt_extra_require |
68 | | - + reauth_extra_require |
69 | | -) |
| 60 | +testing_extra_require = [ |
| 61 | + "flask", |
| 62 | + "freezegun", |
| 63 | + "mock", |
| 64 | + "pytest", |
| 65 | + "pytest-cov", |
| 66 | + "pytest-localserver", |
| 67 | + "responses", |
| 68 | + "pytest-asyncio", |
| 69 | + "aioresponses", |
| 70 | + # TODO(): Remove `grpcio` from testing requirements once an extra is added for `grpcio` dependency. |
| 71 | + "grpcio", |
| 72 | + # TODO(): Remove `oauth2client` from testing requirements once an extra is added for `grpcio` dependency. |
| 73 | + "oauth2client", |
| 74 | + # Async Dependencies |
| 75 | + # TODO(https://github.com/googleapis/google-auth-library-python/issues/1722): `test_aiohttp_requests` depend on |
| 76 | + # aiohttp < 3.10.0 which is a bug. Investigate and remove the pinned aiohttp version and use `aiohttp_extra_require`. |
| 77 | + "aiohttp < 3.10.0", |
| 78 | + *pyjwt_extra_require, |
| 79 | + *reauth_extra_require, |
| 80 | + *pyopenssl_extra_require, |
| 81 | +] |
70 | 82 |
|
71 | 83 | extras = { |
72 | 84 | "aiohttp": aiohttp_extra_require, |
73 | | - "pyopenssl": [ |
74 | | - "pyopenssl>=20.0.0", |
75 | | - "cryptography>=38.0.3", |
76 | | - "cryptography < 39.0.0; python_version == '3.7'", |
77 | | - ], |
| 85 | + "pyopenssl": pyopenssl_extra_require, |
78 | 86 | "requests": requests_extra_require, |
79 | | - "reauth": "pyu2f>=0.1.5", |
80 | | - "enterprise_cert": [ |
81 | | - "cryptography", |
82 | | - "pyopenssl", |
83 | | - "cryptography < 39.0.0; python_version == '3.7'", |
84 | | - ], |
| 87 | + "reauth": reauth_extra_require, |
| 88 | + "enterprise_cert": enterprise_cert_extra_require, |
85 | 89 | "pyjwt": pyjwt_extra_require, |
86 | 90 | "testing": testing_extra_require, |
87 | 91 | # TODO(): Add an extra for `grpcio` dependency. |
|
0 commit comments