requirementslib.models.lockfile module¶
-
class
requirementslib.models.lockfile.
Lockfile
(path: pathlib.Path = NOTHING, requirements: list = NOTHING, dev_requirements: list = NOTHING, projectfile: requirementslib.models.project.ProjectFile = NOTHING, lockfile: plette.lockfiles.Lockfile = NOTHING, newlines: str = 'n')[source]¶ Bases:
object
-
as_requirements
(include_hashes=False, dev=False)[source]¶ Returns a list of requirements in pip-style format
-
default
¶
-
dev_requirements
¶
-
dev_requirements_list
¶
-
develop
¶
-
extended_keys
¶
-
classmethod
from_data
(path, data, meta_from_project=True)[source]¶ Create a new lockfile instance from a dictionary.
Parameters:
-
get_requirements
(dev=True, only=False)[source]¶ Produces a generator which generates requirements from the desired section.
Parameters: dev (bool) – Indicates whether to use dev requirements, defaults to False Returns: Requirements from the relevant the relevant pipfile Return type: Requirement
-
classmethod
load
(path, create=True)[source]¶ Create a new lockfile instance.
Parameters: - project_path (str or
pathlib.Path
) – Path to project root or lockfile - lockfile_name (str) – Name of the lockfile in the project root directory
- pipfile_path (
pathlib.Path
) – Path to the project pipfile
Returns: A new lockfile representing the supplied project paths
Return type: - project_path (str or
-
classmethod
load_projectfile
(path, create=True, data=None)[source]¶ Given a path, load or create the necessary lockfile.
Parameters: Raises: - OSError – Thrown if the project root directory doesn’t exist
- FileNotFoundError – Thrown if the lockfile doesn’t exist and
create=False
Returns: A project file instance for the supplied project
Return type:
-
lockfile
¶
-
newlines
¶
-
path
¶
-
projectfile
¶
-
classmethod
read_projectfile
(path)[source]¶ Read the specified project file and provide an interface for writing/updating.
Parameters: path (str) – Path to the target file. Returns: A project file with the model and location for interaction Return type: ProjectFile
-
requirements
¶
-
requirements_list
¶
-
section_keys
¶
-