copier_python_tools.sync#

Sync tools.

Module Contents#

Classes#

Lock

Lockfile.

Compiler

Compiler.

Compilation

Compilation.

Functions#

check_compilation

Check compilation, re-lock if incompatible, and return the requirements.

lock

Lock.

get_uv_version

Get version of uv at bin/uv.

get_directs

Get directs.

get_lockfile

Get lockfile path.

compile

Compile dependencies.

get_subs

Get submodules.

get_submodule_info

Get submodule info.

escape

Escape a path, suitable for passing to e.g. run().

Data#

MINIMUM_PYTHON

This project’s default Python version.

REQS

Requirements.

DEV

Other development tools and editable local dependencies.

DEPS

Paths to compile dependencies for.

OVERRIDES

Overrides to satisfy otherwise incompatible combinations.

NODEPS

Path to dependencies which should not have their transitive dependencies compiled.

REQUIREMENTS

Requirements.

NAME_PAT

Regular expression for a legal Python package name.

OP_PAT

Regular expression for valid version separators.

API#

copier_python_tools.sync.MINIMUM_PYTHON#

‘3.10’

This project’s default Python version.

copier_python_tools.sync.REQS#

‘Path(…)’

Requirements.

copier_python_tools.sync.DEV#

None

Other development tools and editable local dependencies.

copier_python_tools.sync.DEPS#

()

Paths to compile dependencies for.

copier_python_tools.sync.OVERRIDES#

None

Overrides to satisfy otherwise incompatible combinations.

copier_python_tools.sync.NODEPS#

None

Path to dependencies which should not have their transitive dependencies compiled.

copier_python_tools.sync.REQUIREMENTS#

None

Requirements.

class copier_python_tools.sync.Lock#

Lockfile.

time: str#

None

uv: str#

None

minimum_python: copier_python_tools.types.PythonVersion#

None

paths: tuple[str, ...]#

None

overrides: str#

None

directs: dict[str, copier_python_tools.types.Dep]#

None

direct_requirements: str#

None

requirements: str#

None

copier_python_tools.sync.check_compilation(
high: bool = False,
) str#

Check compilation, re-lock if incompatible, and return the requirements.

copier_python_tools.sync.lock(
directs: dict[str, copier_python_tools.types.Dep] | None = None,
high: bool = False,
) str#

Lock.

copier_python_tools.sync.get_uv_version() str#

Get version of uv at bin/uv.

class copier_python_tools.sync.Compiler#

Compiler.

uv: str#

‘field(…)’

Version of uv used to compile.

python_version: copier_python_tools.types.PythonVersion#

None

Python version compiled for.

high: bool#

False

Highest dependencies.

no_deps: bool#

False

Without transitive dependencies.

overrides: pathlib.Path#

None

Overrides.

paths: tuple[pathlib.Path, ...]#

None

Paths compiled from, such as requirements.in or pyproject.toml.

get_command() tuple[datetime.datetime, list[str]]#

Command to reproduce compilation requirements.

compile(
time: datetime.datetime = datetime.min,
directs: dict[str, copier_python_tools.types.Dep] | None = None,
) copier_python_tools.sync.Compilation#

Compile dependencies.

copier_python_tools.sync.NAME_PAT#

‘[A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9._-]*[A-Za-z0-9]’

Regular expression for a legal Python package name.

See: https://packaging.python.org/en/latest/specifications/name-normalization/#name-format

copier_python_tools.sync.OP_PAT#

‘join(…)’

Regular expression for valid version separators.

copier_python_tools.sync.get_directs(
requirements: str | None = None,
) dict[str, copier_python_tools.types.Dep]#

Get directs.

class copier_python_tools.sync.Compilation#

Compilation.

compiler: copier_python_tools.sync.Compiler#

‘field(…)’

Compiler used to compile.

time: datetime.datetime#

None

Time of compilation.

requirements: str = <Multiline-String>#

Result of compilation.

directs: dict[str, copier_python_tools.types.Dep]#

‘field(…)’

Direct dependencies and their revisions.

__post_init__()#
copier_python_tools.sync.get_lockfile(
high: bool = False,
) pathlib.Path#

Get lockfile path.

copier_python_tools.sync.compile(
compiler: copier_python_tools.sync.Compiler,
) tuple[datetime.datetime, str]#

Compile dependencies.

copier_python_tools.sync.get_subs() dict[str, copier_python_tools.types.Dep]#

Get submodules.

copier_python_tools.sync.get_submodule_info(
kind: copier_python_tools.types.SubmoduleInfoKind,
) list[str]#

Get submodule info.

copier_python_tools.sync.escape(
path: str | pathlib.Path,
) str#

Escape a path, suitable for passing to e.g. run().