In CI I am running my django tests with those sett...
# general
In CI I am running my django tests with those settings:
Copy code
        python_tests: dict(
My goal here is to set a list of environments as defined in a macro. Now, I would like to run
pants run django/ -- makemigrations --check
, but I am not able to set this list of environments as the field is unregonized for a
target. 1. How can I adress this? Is env in 2.16 the equivalent? 2. Can I pass the macro function in in a CLI argument as well or only in a BUILD file?
pants run --env=env_vars_test_django() django/ -- makemigrations --check
Re 2. no, that won't work, macros are strictly a BUILD file thing.
Re 1. unlike other goals, which are very isolated by design,
will take env vars from the ambient environment, so you can just set them there
Re 2. so in that case I would need an additional target for which I specify this particular need I guess Re 1. I would need to an additional script to call that macro function and set it in the environment. Is this new env feature equivalent or is there any other way to pass it to the pex target?
You can set env vars however makes sense to you, but I don't know if calling a macro is what I would do. Maybe having .env file that the macro reads, or something like that?