ImportOptions
- class ImportOptions
Parsed arguments for the
syside reqif importsubcommand.Members defined in
ImportOptions(9 members)
RWDirectory to extract ReqIF attachments into. When
None, defaults to<cwd>/joined withsyside.reqif.ATTACHMENTS_DIRat run time (--attachments-dir).
RWOptional domain label inserted into the generated package and file names, immediately after the
ReqIF_Import_unit (e.g.PowertrainturnsReqIF_Import_SpecificationsintoReqIF_Import_Powertrain_Specifications). Characters that are not filename-safe (spaces,/ \ : * ? " < > |, etc.) are percent-encoded. WhenNone(the default), names are emitted unchanged (--domain).
RWPath to the
.reqifor.reqifzfile to import (positional).
RWBuild options from parsed args, assembling
split_by.
RWItems between progress updates when stdout is not a TTY.
0disables progress output entirely. On a TTY,richrenders a live bar regardless of this value (--progress-interval).
RWDelta imports into a
--split-by=hierarchyworkspace 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@reqiftag. 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 byfrom_args()); an error on a fresh import.
RWWhen 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).
RWPartitioning algorithm for the Objects content (
--split-by), orNonefor 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 theFlatGreedySplit/HierarchySplitvalue byfrom_args(); a sizing flag cannot be passed without--split-by(validated there).Nonetherefore means a monolith fresh import or a bare delta re-import that uses the detected layout with default sizing.
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 withsyside.reqif.ATTACHMENTS_DIRat 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.PowertrainturnsReqIF_Import_SpecificationsintoReqIF_Import_Powertrain_Specifications). Characters that are not filename-safe (spaces,/ \ : * ? " < > |, etc.) are percent-encoded. WhenNone(the default), names are emitted unchanged (--domain).
- file: pathlib.Path = None
Path to the
.reqifor.reqifzfile 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-bychoice, so they are assembled intosplit_byhere 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.
0disables progress output entirely. On a TTY,richrenders a live bar regardless of this value (--progress-interval).
- rename_files: bool = False
Delta imports into a
--split-by=hierarchyworkspace 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@reqiftag. 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 byfrom_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), orNonefor 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 theFlatGreedySplit/HierarchySplitvalue byfrom_args(); a sizing flag cannot be passed without--split-by(validated there).Nonetherefore 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-bythat 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 singlerequirement deflarger 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.