xcookie.builders.pyproject module

xcookie.builders.pyproject._parse_requirement_file_for_metadata(fpath)[source]

Separate package requirements from pip-only composition/policy.

xcookie.builders.pyproject._requirement_file_needs_metadata_copy(fpath)[source]

Whether a requirements file needs a companion for its local entries.

xcookie.builders.pyproject._build_setuptools_requirement_metadata_text(fpath)[source]

Build metadata for only the direct requirements in one pip file.

Recursive -r composition is represented by multiple paths in tool.setuptools.dynamic instead of duplicating transitive requirements into this companion file. Installer-only options are omitted.

xcookie.builders.pyproject._dynamic_requirement_relpaths(self, name)[source]

Resolve one pip requirements file into setuptools metadata sources.

xcookie.builders.pyproject._autodictify(value)[source]
xcookie.builders.pyproject._coerce_spdx_license(value: str) → str[source]

Coerce a configured license value into a valid SPDX expression.

xcookie.builders.pyproject._canonical_os_values(value)[source]

Canonicalize OS spellings for semantic config comparisons.

xcookie.builders.pyproject._build_xcookie_tool_config(self, pyproj_config)[source]

Build the [tool.xcookie] block without leaking inferred defaults.

XCookieConfig is resolved before builders run, so values such as version='0.0.1', pkg_name=mod_name, and os=['linux', 'osx', 'win'] may be present even when the user never wrote them in pyproject.toml. Persisting those values creates noisy diffs and, in the case of version, can produce stale metadata next to a dynamic PEP 621 version declaration.

xcookie.builders.pyproject.build_pyproject(self)[source]
Returns:

templated code

Return type:

str