ImportOptions

class ImportOptions

Parsed arguments for the syside reqif import subcommand.

%3 ImportOptions ImportOptions syside.reqif.ImportOptions OptionsBase OptionsBase syside.reqif.OptionsBase OptionsBase->ImportOptions
Members defined in ImportOptions (9 members)

attachments_dir

RW

Directory to extract ReqIF attachments into. When None, defaults to <cwd>/ joined with syside.reqif.ATTACHMENTS_DIR at run time (--attachments-dir).

domain

RW

Optional domain label inserted into the generated package and file names, immediately after the ReqIF_Import_ unit (e.g. Powertrain turns ReqIF_Import_Specifications into ReqIF_Import_Powertrain_Specifications). Characters that are not filename-safe (spaces, / \ : * ? " < > |, etc.) are percent-encoded. When None (the default), names are emitted unchanged (--domain).

file

RW

Path to the .reqif or .reqifz file to import (positional).

from_args

RW

Build options from parsed args, assembling split_by.

progress_interval

RW

Items between progress updates when stdout is not a TTY. 0 disables progress output entirely. On a TTY, rich renders a live bar regardless of this value (--progress-interval).

rename_files

RW

Delta imports into a --split-by=hierarchy workspace only (--rename-files): rename slug-derived files, folders, packages, and aliases to match the elements’ current display names. Without it, renamed elements keep their now-stale paths (with a warning) — the file name is a navigation hint, identity is the @reqif tag. Reconciles all stale slugs, not only this delta’s renames, so a no-op re-import with the flag is a layout cleanup. Requires --split-by=hierarchy (validated by from_args()); an error on a fresh import.

resolve_duplicate_names

RW

When set, append a __<6chars> suffix derived from each colliding element’s ReqIF identifier so that duplicated names — within the top-level ReqIF namespace, between Spec Relations and that namespace, or between Spec Relations inside one Relation Group — are made unique before validation. Use this for tools like Codebeamer that require LONG_NAME on every element but do not enforce its uniqueness (--resolve-duplicate-names).

split_by

RW

Partitioning algorithm for the Objects content (--split-by), or None for the single-file layout. The sole carrier of all split configuration: the sizing knobs (--split-max-loc, --split-reexports, and the hierarchy-only --split-max-depth / --split-min-depth / --split-max-slug-length) are assembled into the FlatGreedySplit / HierarchySplit value by from_args(); a sizing flag cannot be passed without --split-by (validated there). None therefore means a monolith fresh import or a bare delta re-import that uses the detected layout with default sizing.

add_args

Register this subcommand’s flags onto parser.

Members inherited from OptionsBase (0 members)

Attributes

attachments_dir: pathlib.Path | None = None

Directory to extract ReqIF attachments into. When None, defaults to <cwd>/ joined with syside.reqif.ATTACHMENTS_DIR at run time (--attachments-dir).

domain: str | None = None

Optional domain label inserted into the generated package and file names, immediately after the ReqIF_Import_ unit (e.g. Powertrain turns ReqIF_Import_Specifications into ReqIF_Import_Powertrain_Specifications). Characters that are not filename-safe (spaces, / \ : * ? " < > |, etc.) are percent-encoded. When None (the default), names are emitted unchanged (--domain).

file: pathlib.Path = None

Path to the .reqif or .reqifz file to import (positional).

classmethod from_args(args: argparse.Namespace) Self

Build options from parsed args, assembling split_by.

This is the single place split-flag combinations are validated (_validate_split_args()): the sizing flags are only meaningful as part of a --split-by choice, so they are assembled into split_by here and the rest of the pipeline never re-parses strings or re-checks combinations.

progress_interval: int = 1000

Items between progress updates when stdout is not a TTY. 0 disables progress output entirely. On a TTY, rich renders a live bar regardless of this value (--progress-interval).

rename_files: bool = False

Delta imports into a --split-by=hierarchy workspace only (--rename-files): rename slug-derived files, folders, packages, and aliases to match the elements’ current display names. Without it, renamed elements keep their now-stale paths (with a warning) — the file name is a navigation hint, identity is the @reqif tag. Reconciles all stale slugs, not only this delta’s renames, so a no-op re-import with the flag is a layout cleanup. Requires --split-by=hierarchy (validated by from_args()); an error on a fresh import.

resolve_duplicate_names: bool = False

When set, append a __<6chars> suffix derived from each colliding element’s ReqIF identifier so that duplicated names — within the top-level ReqIF namespace, between Spec Relations and that namespace, or between Spec Relations inside one Relation Group — are made unique before validation. Use this for tools like Codebeamer that require LONG_NAME on every element but do not enforce its uniqueness (--resolve-duplicate-names).

split_by: syside.reqif.SplitAlgorithm | None = None

Partitioning algorithm for the Objects content (--split-by), or None for the single-file layout. The sole carrier of all split configuration: the sizing knobs (--split-max-loc, --split-reexports, and the hierarchy-only --split-max-depth / --split-min-depth / --split-max-slug-length) are assembled into the FlatGreedySplit / HierarchySplit value by from_args(); a sizing flag cannot be passed without --split-by (validated there). None therefore means a monolith fresh import or a bare delta re-import that uses the detected layout with default sizing.

A delta import detects the workspace’s split layout by itself; passing a --split-by that contradicts the detected layout is an error. On a delta the sizing carried here governs the placement of new content only; existing files are never repacked. Splitting lets a large import open and edit in the LSP that the single-file layout cannot load within the start timeout; it does not reduce peak memory or speed up model-wide operations. A single requirement def larger than the cap cannot be split; it is emitted alone in its own over-cap file with a warning.

Methods

static add_args(parser: argparse.ArgumentParser) None

Register this subcommand’s flags onto parser.

Used in