Vigia

Actualizar argparse de 2.x a 3.x

Comparación de la API pública de argparse 2.0.1 y 3.0.2, calculada automáticamente a partir de sus tipos TypeScript. Una firma modificada es un posible cambio incompatible, no una certeza.

Resumen

Rutas de importación eliminadas0
Exports eliminados1
Firmas modificadas18
Miembros de clases o interfaces eliminados1
Miembros de clases o interfaces modificados45
Nuevas deprecaciones0
Cambios de requisitos (engines, dependencias peer)0
Exports nuevos24

Exports eliminados

importexportkindAntes
argparseSubParserclassclass

Firmas modificadas

exportAntesDespués
argparse · Actionclassinterface
argparse · PARSERstring"A..."
argparse · OPTIONALstring"?"
argparse · SUPPRESSstring"==SUPPRESS=="
argparse · Namespaceclassinterface
argparse · REMAINDERstring"..."
argparse · ONE_OR_MOREstring"+"
argparse · ZERO_OR_MOREstring"*"
argparse · ArgumentErrorclassinterface
argparse · ArgumentGroupclassinterface
argparse · HelpFormatterclassinterface
argparse · ArgumentParserclassinterface
argparse · ArgumentTypeErrorclassinterface
argparse · RawTextHelpFormatterclassinterface
argparse · BooleanOptionalActionclassinterface
argparse · ActionConstructorOptionsnumber & { _: "ActionConstructorOptions"; }interface
argparse · RawDescriptionHelpFormatterclassinterface
argparse · ArgumentDefaultsHelpFormatterclassinterface

Miembros de clases o interfaces eliminados

memberimportAntes
ArgumentGroup.add_argument_groupargparse(options?: ArgumentGroupOptions | undefined): ArgumentGroup

Miembros de clases o interfaces modificados

memberAntesDespués
Action.call(parser: ArgumentParser, namespace: Namespace, values: string | string[], optionString: string | null): void(parser: ArgumentParser, namespace: Namespace, values: unknown, option_string?: string | undefined): void
Action.constructor(options: ActionConstructorOptions): Action
Namespace.constructor(options: object): Namespace
ArgumentError.constructor(argument: Action, message: string): ArgumentError
ArgumentGroup.constructor(): ArgumentGroup
ArgumentGroup.get_default(dest: string): any(dest: string): unknown
ArgumentGroup.add_argument(arg: string, options?: ArgumentOptions | undefined): void | (arg1: string, arg2: string, options?: ArgumentOptions | undefined): void(name: string, ...names: string[]): Action | (name: string, ...namesAndOptions: [...string[], ArgumentOptions]): Action
ArgumentGroup.set_defaults(options?: {} | undefined): void(options: object): void
ArgumentGroup.add_mutually_exclusive_group(options?: { required: boolean; } | undefined): ArgumentGroup(options?: MutuallyExclusiveGroupOptions | undefined): MutuallyExclusiveGroup
HelpFormatter.constructor(): HelpFormatter
ArgumentParser.exit(status: number, message: string): void(status?: number | undefined, message?: string | undefined): void
ArgumentParser.error(err: string | Error): void(message: string): void
ArgumentParser.parse_args(args?: string[] | undefined, ns?: object | Namespace | undefined): any<T extends object = Namespace>(args?: string[] | undefined, namespace?: T | undefined): T
ArgumentParser.print_help(): void(file?: Writable | undefined): void
ArgumentParser.constructor(options?: ArgumentParserOptions | undefined): ArgumentParser
ArgumentParser.get_default(dest: string): any(dest: string): unknown
ArgumentParser.print_usage(): void(file?: Writable | undefined): void
ArgumentParser.add_argument(arg: string, options?: ArgumentOptions | undefined): void | (arg1: string, arg2: string, options?: ArgumentOptions | undefined): void(name: string, ...names: string[]): Action | (name: string, ...namesAndOptions: [...string[], ArgumentOptions]): Action
ArgumentParser.set_defaults(options?: {} | undefined): void(options: object): void
ArgumentParser.add_subparsers(options?: SubparserOptions | undefined): SubParser(options?: SubparserOptions | undefined): SubparsersAction
ArgumentParser.parse_known_args(args?: string[] | undefined, ns?: object | Namespace | undefined): any[]<T extends object = Namespace>(args?: string[] | undefined, namespace?: T | undefined): [T, string[]]
ArgumentParser.add_argument_group(options?: ArgumentGroupOptions | undefined): ArgumentGroup(options?: ArgumentGroupOptions | undefined): ArgumentGroup | (title?: string | undefined, description?: string | undefined): ArgumentGroup
ArgumentParser.parse_intermixed_args(args?: string[] | undefined, ns?: object | Namespace | undefined): any<T extends object = Namespace>(args?: string[] | undefined, namespace?: T | undefined): T
ArgumentParser.convert_arg_line_to_args(argLine: string): string[](arg_line: string): string[]
ArgumentParser.parse_known_intermixed_args(args?: string[] | undefined, ns?: object | Namespace | undefined): any[]<T extends object = Namespace>(args?: string[] | undefined, namespace?: T | undefined): [T, string[]]
ArgumentParser.add_mutually_exclusive_group(options?: { required: boolean; } | undefined): ArgumentGroup(options?: MutuallyExclusiveGroupOptions | undefined): MutuallyExclusiveGroup
ArgumentOptions.typestring | Function | undefinedArgumentType | undefined
ArgumentOptions.constanyunknown
ArgumentOptions.nargsstring | number | undefinedNargs | undefined
ArgumentOptions.actionstring | (new (options: ActionConstructorOptions) => Action) | undefinedstring | ActionClass | undefined
ArgumentOptions.choicesstring | string[] | undefinedstring | object | readonly unknown[] | undefined
ArgumentOptions.defaultanyunknown
SubparserOptions.actionstring | undefinedstring | ActionClass | undefined
SubparserOptions.parser_class(new () => any) | undefinedArgumentParserClass | undefined
ArgumentTypeError.constructor(message: string): ArgumentTypeError
ArgumentGroupOptions.argument_defaultanyunknown
RawTextHelpFormatter.constructor(): RawTextHelpFormatter
ArgumentParserOptions.formatter_class(new () => HelpFormatter | ArgumentDefaultsHelpFormatter | RawDescriptionHelpFormatter | RawTextHelpFormatter) | undefinedHelpFormatterFactory | undefined
ArgumentParserOptions.argument_defaultanyunknown
BooleanOptionalAction.call(parser: ArgumentParser, namespace: Namespace, values: string | string[], optionString: string | null): void(parser: ArgumentParser, namespace: Namespace, values: unknown, option_string?: string | undefined): void
BooleanOptionalAction.constructor(options: ActionConstructorOptions): BooleanOptionalAction
SubArgumentParserOptions.formatter_class(new () => HelpFormatter | ArgumentDefaultsHelpFormatter | RawDescriptionHelpFormatter | RawTextHelpFormatter) | undefinedHelpFormatterFactory | undefined
SubArgumentParserOptions.argument_defaultanyunknown
RawDescriptionHelpFormatter.constructor(): RawDescriptionHelpFormatter
ArgumentDefaultsHelpFormatter.constructor(): ArgumentDefaultsHelpFormatter

Nuevas deprecaciones

No se detectaron.

Cambios de requisitos (engines, dependencias peer)

No se detectaron.

Exports nuevos (24)
importexportkind
argparseNargstype
argparseFileTypeinterface
argparseWritableinterface
argparseActionClassinterface
argparseArgumentTypetype
argparseFileTypeResultinterface
argparseFileTypeOptionsinterface
argparseActionsContainerinterface
argparseSubparsersActioninterface
argparseActionConstructorinterface
argparseHelpFormatterClassinterface
argparseArgumentParserClassinterface
argparseFileTypeConstructorinterface
argparseHelpFormatterFactorytype
argparseHelpFormatterOptionsinterface
argparseNamespaceConstructorinterface
argparseMutuallyExclusiveGroupinterface
argparseArgumentErrorConstructorinterface
argparseHelpFormatterConstructorinterface
argparseMetavarTypeHelpFormatterinterface
argparseArgumentParserConstructorinterface
argparseArgumentTypeErrorConstructorinterface
argparseMutuallyExclusiveGroupOptionsinterface
argparseBooleanOptionalActionConstructorinterface

Preguntas frecuentes

¿Cuáles son los cambios incompatibles al actualizar argparse de 2 a 3?

Entre argparse 2.0.1 y 3.0.2, Vigia encontró 1 exports eliminados, 18 firmas modificadas y 46 miembros de clases o interfaces eliminados o modificados.

¿Qué quedó deprecado en argparse 3?

0 exports o miembros quedaron marcados como deprecados en argparse 3.0.2.

Para agentes

GET https://vigia.coredls.cloud/v1/packages/npm/argparse/upgrade?from=2.0.1&to=3.0.2