lively-dusk-46231
10/25/2022, 11:01 AM$ cat BUILD
python_sources(name='source', sources=['my_api/**/*.py'])
And I am dynamically importing a file: my_api/config/development_settings.py
I tried:
python_sources(
name='source',
sources=['my_api/**/*.py'],
overried={'my_api/config/__init__.py': {'dependencies': ['my_api/config/development_settings.py']}},
)
And it did not work.
Then I tried my_api/config/development_settings.py:../../source
and it seemed to work
Question: Why did the "shortcut" not work for me ? Do I need to explicitly add ../../
everywhere ?
In another case, I want configs for my pytest to be specified. So, I have something like:
python_tests(
name='tests',
sources=['my_api_test/**/test_*.py'],
dependencies=['my_api_test/config/*.py']},
# Also tried: dependencies=['my_api_test/config/*.py:*']},
# And also: dependencies=['//my_api_test/config/*.py:*']},
)
This does not work with the error: Directory 'corridor_api_test/instance' does not contain any BUILD files
curved-television-6568
10/25/2022, 11:35 AM:../../
question, it is because the target name, if left off will use a default name that is the name of the directory for the file, so in your case, leaving of the target name from the file, yields the same as my_api/config/development_settings.py:config
Hope that makes it a little clearer.curved-television-6568
10/25/2022, 11:36 AMpython_sources()
target in your config
dir)bitter-ability-32190
10/25/2022, 12:46 PMlively-dusk-46231
10/25/2022, 12:48 PMbitter-ability-32190
10/25/2022, 1:15 PMbitter-ability-32190
10/25/2022, 1:15 PM