Hello, I'm creating my first tox plugin, and I have some questions.

the plugin is: https://github.com/luzfcb/tox-lambda-autodiscovery

The context:

I'm doing an experimental project (closed source) with serverless[1] framework, aws lambda[2] and django.

aws lambda, allows me to have a requirements.txt file for each lambda function and
for each folder with lambda function, I also have one or more test files.
( this is necessary because lambda restricts the maximum size of the lambda function package to 50MB. The package includes all python and non-python dependencies.)

the directory structure looks like this ( do not be surprised with the camel case, it is restriction imposed by aws Lambda and aws CloudFormation)

image.png

The problem I want to solve:


I want to avoid creating manually, the tox testenv, for each of these lambda functions (because in the future there will be hundreds of them.)

I want to avoid doing this.

image.png


that is, I want my tox plugin to automatically analyze the project directories structure, and look for folders that contain a requirements.txt file and that also contain test files, named test*.py, and automatically create, one tox testenv for each of these folders.

my plugin currently can do this. (I do not know if it makes the best way, but it works).

currently, for it to work, it is only necessary to add [testenv:lambdaautodiscovery] in your tox.ini

The questions:

1 - how create a new variables for substitution ( to work like {toxinidir} )?
     What is the correct way to create it?

    https://github.com/luzfcb/tox-lambda-autodiscovery/issues/1

2 - I have a custom tox testenv, with some extra variables and configurations, and I would like to use it as a base, to create the others automatically generated tox testenv.
Am I doing it the right way?

https://github.com/luzfcb/tox-lambda-autodiscovery/blob/master/tox_lambda_autodiscovery/plugin.py#L85-L86

Do you have any suggestions on how to improve this?

3 - the only thing that still does not work is the main one: command

is there any way to defer command processing, or any other way to make it work?
see: https://github.com/luzfcb/tox-lambda-autodiscovery/issues/2

Thank you all for your help.
Any comment is welcome.




[1] https://serverless.com/

--
Fabio C. Barrionuevo da Luz
Palmas - Tocantins - Brasil - América do Sul