Skip to content

Commit

Permalink
chore(_build): added print_extras setup.py command to allow structu…
Browse files Browse the repository at this point in the history
…red dependency extraction
  • Loading branch information
aagnone3 committed Jun 23, 2024
1 parent 5cf20ec commit 38eec95
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import functools
import json
import os
import platform
import re
Expand Down Expand Up @@ -753,6 +754,25 @@ def init_install_requires():
],
)


class PrintExtrasCommand(setuptools.Command):
description = "print extras_require"
user_options = [
('output=', 'o', 'Path to output the extras_require JSON'),
]

def initialize_options(self):
self.output = None

def finalize_options(self):
if self.output is None:
raise ValueError("output is not set")

def run(self):
with open(self.output, 'w') as f:
json.dump(setup_spec.unique_extras, f, indent=2)


setuptools.setup(
name="dbgpt",
packages=packages,
Expand All @@ -770,6 +790,9 @@ def init_install_requires():
license="https://opensource.org/license/mit/",
python_requires=">=3.10",
extras_require=setup_spec.unique_extras,
cmdclass={
'print_extras': PrintExtrasCommand,
},
entry_points={
"console_scripts": [
"dbgpt=dbgpt.cli.cli_scripts:main",
Expand Down

0 comments on commit 38eec95

Please sign in to comment.