Class PythonProjectLayout

java.lang.Object
org.machanism.machai.project.layout.ProjectLayout
org.machanism.machai.project.layout.PythonProjectLayout

public class PythonProjectLayout extends ProjectLayout
Detects public Python projects described by pyproject.toml.

isPythonProject(File) accepts descriptors with a project.name and rejects descriptors classified as private. This layout does not currently infer module, source, documentation, or test directories; the corresponding accessors return empty lists.

Since:
0.0.2
Author:
Viktor Tovstyi
  • Field Details

    • PROJECT_MODEL_FILE_NAME

      private static final String PROJECT_MODEL_FILE_NAME
      Conventional Python project descriptor used for project detection.
      See Also:
  • Constructor Details

    • PythonProjectLayout

      public PythonProjectLayout()
      Creates a Python project layout instance.
  • Method Details

    • isPythonProject

      public static boolean isPythonProject(File projectDir)
      Checks whether a directory contains a public Python project described by pyproject.toml.

      The descriptor must define project.name. Projects whose project.classifiers contain Private are excluded. Invalid or unreadable TOML descriptors are treated as non-Python projects.

      Parameters:
      projectDir - directory to examine for pyproject.toml
      Returns:
      true when a public named project is detected; false otherwise
    • getSources

      public List<String> getSources()
      Returns source directories discovered for the Python project.
      Specified by:
      getSources in class ProjectLayout
      Returns:
      empty list; intentionally returns a safe default until Python source discovery is implemented
    • getDocuments

      public List<String> getDocuments()
      Returns documentation directories discovered for the Python project.
      Specified by:
      getDocuments in class ProjectLayout
      Returns:
      empty list; intentionally returns a safe default until Python documentation discovery is implemented
    • getTests

      public List<String> getTests()
      Returns test source directories discovered for the Python project.
      Specified by:
      getTests in class ProjectLayout
      Returns:
      empty list; intentionally returns a safe default until Python test discovery is implemented