pat2vec.util.compile_requirements

Functions

append_to_file(filename, requirement)

Appends a requirement to a file, followed by a newline.

process_requirements()

Processes requirements one by one to find incompatibilities.

run_pip_compile()

Runs pip-compile on requirements.in.

pat2vec.util.compile_requirements.run_pip_compile()[source]

Runs pip-compile on requirements.in.

This function executes the pip-compile requirements.in command to generate a requirements.txt file. If the command fails, it prints the error to the console.

Return type:

bool

Returns:

True if the command is successful, False otherwise.

pat2vec.util.compile_requirements.append_to_file(filename, requirement)[source]

Appends a requirement to a file, followed by a newline.

Parameters:
  • filename (str) – The path to the file.

  • requirement (str) – The requirement string to append.

Return type:

None

pat2vec.util.compile_requirements.process_requirements()[source]

Processes requirements one by one to find incompatibilities.

Reads requirements from requirements_source.txt, adds them individually to requirements.in, and runs pip-compile. If a requirement causes a compilation failure, it is reverted and logged to failed_requirements.txt.

Return type:

None