@@ -24,7 +24,8 @@ async function run() {
2424
2525 core . info ( `Searching in "${ rootDir } " ...` ) ;
2626
27- const output = await findPythonProjects ( rootDir , desiredExportPaths ) ;
27+ const skips = determineSkips ( core . getInput ( "exclude-commands" ) ) ;
28+ const output = await findPythonProjects ( rootDir , desiredExportPaths , skips ) ;
2829
2930 core . setOutput ( "projects" , JSON . stringify ( output . projects ) ) ;
3031 core . setOutput (
@@ -40,8 +41,9 @@ async function run() {
4041/**
4142 * @param {string } rootDir
4243 * @param {string[]? } desiredExportPaths
44+ * @param {Object<string, string> } skips
4345 */
44- async function findPythonProjects ( rootDir , desiredExportPaths ) {
46+ async function findPythonProjects ( rootDir , desiredExportPaths , skips ) {
4547 const globbyOpts = {
4648 gitignore : true ,
4749 } ;
@@ -59,6 +61,7 @@ async function findPythonProjects(rootDir, desiredExportPaths) {
5961 const project = await createProjectResult (
6062 pyprojectPath ,
6163 desiredExportPaths ,
64+ skips ,
6265 ) ;
6366 projects . push ( project ) ;
6467 }
@@ -73,15 +76,26 @@ async function findPythonProjects(rootDir, desiredExportPaths) {
7376/**
7477 * @param {string } pyprojectPath
7578 * @param {string[]? } desiredExportPaths
79+ * @param {Object<string, string> } skips
7680 */
77- async function createProjectResult ( pyprojectPath , desiredExportPaths ) {
81+ async function createProjectResult ( pyprojectPath , desiredExportPaths , skips ) {
7882 const projectToml = await fs . readFile ( pyprojectPath ) ;
7983 const projectTomlParsed = TOML . parse ( projectToml ) ;
8084
8185 const projectName = getBestConfig ( projectTomlParsed , PROJECT_NAME_PATHS ) ;
8286 const pythonVersion = getBestConfig ( projectTomlParsed , PYTHON_VERSION_PATHS ) ;
8387
8488 const commands = generateCommands ( projectTomlParsed ) ;
89+ const commandsFiltered = Object . fromEntries (
90+ Object . entries ( commands ) . filter ( ( [ commandName ] ) => {
91+ const globalSkips = skips [ GLOBAL_KEY ] ?? [ ] ;
92+ const projectSkips = skips [ projectName ] ?? [ ] ;
93+ return (
94+ ! globalSkips . includes ( commandName ) &&
95+ ! projectSkips . includes ( commandName )
96+ ) ;
97+ } ) ,
98+ ) ;
8599
86100 const arbitraryMetadata = { } ;
87101 if ( desiredExportPaths ) {
@@ -92,7 +106,7 @@ async function createProjectResult(pyprojectPath, desiredExportPaths) {
92106
93107 return {
94108 buildBackend : getBuildBackend ( projectTomlParsed ) ,
95- commands : commands ,
109+ commands : commandsFiltered ,
96110 directory : path . dirname ( pyprojectPath ) ,
97111 name : projectName ,
98112 path : pyprojectPath ,
0 commit comments