Class PythonProjectLayout
java.lang.Object
org.machanism.machai.project.layout.ProjectLayout
org.machanism.machai.project.layout.PythonProjectLayout
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 Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringConventional Python project descriptor used for project detection.Fields inherited from class org.machanism.machai.project.layout.ProjectLayout
NO_MODULES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns documentation directories discovered for the Python project.Returns source directories discovered for the Python project.getTests()Returns test source directories discovered for the Python project.static booleanisPythonProject(File projectDir) Checks whether a directory contains a public Python project described bypyproject.toml.Methods inherited from class org.machanism.machai.project.layout.ProjectLayout
getExcludeDirs, getModules, getParentId, getProjectDir, getProjectId, getProjectLayoutType, getProjectName, getRelativePath, getRelativePath, getRelativePath, getTempDir, isExcludedPath, listDirectories, listFiles, projectDir, setExcludeDirs
-
Field Details
-
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
Checks whether a directory contains a public Python project described bypyproject.toml.The descriptor must define
project.name. Projects whoseproject.classifierscontainPrivateare excluded. Invalid or unreadable TOML descriptors are treated as non-Python projects.- Parameters:
projectDir- directory to examine forpyproject.toml- Returns:
truewhen a public named project is detected;falseotherwise
-
getSources
Returns source directories discovered for the Python project.- Specified by:
getSourcesin classProjectLayout- Returns:
- empty list; intentionally returns a safe default until Python source discovery is implemented
-
getDocuments
Returns documentation directories discovered for the Python project.- Specified by:
getDocumentsin classProjectLayout- Returns:
- empty list; intentionally returns a safe default until Python documentation discovery is implemented
-
getTests
Returns test source directories discovered for the Python project.- Specified by:
getTestsin classProjectLayout- Returns:
- empty list; intentionally returns a safe default until Python test discovery is implemented
-