Skip to content

Commit 284742e

Browse files
committed
setup.py: only add dataclasses dependency if py36
It's silly to pull in this extra dependency. I think I had hoped that Pip would be smart enough to know it's a backport, but alas, it is not. Signed-off-by: Stephen Brennan <[email protected]>
1 parent 67a5098 commit 284742e

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

setup.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2023, Oracle and/or its affiliates.
1+
# Copyright (c) 2023, 2025, Oracle and/or its affiliates.
22
#
33
# The Universal Permissive License (UPL), Version 1.0
44
#
@@ -32,13 +32,21 @@
3232
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3333
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3434
# SOFTWARE.
35+
import sys
36+
3537
from setuptools import find_packages
3638
from setuptools import setup
3739

3840
long_description = open("README.md").read()
3941

4042
VERSION = "1.9.0"
4143

44+
additional_requires = [] # type: ignore
45+
46+
# Add backport for dataclasses, only if we need it
47+
if sys.version_info < (3, 7):
48+
additional_requires.append("dataclasses")
49+
4250
setup(
4351
name="yo",
4452
version=VERSION,
@@ -57,8 +65,8 @@
5765
"subc>=0.8.0",
5866
"setuptools",
5967
"argcomplete",
60-
"dataclasses",
61-
],
68+
]
69+
+ additional_requires,
6270
url="https://github.com/oracle/yo",
6371
author="Oracle",
6472
author_email="[email protected]",

0 commit comments

Comments
 (0)