brainy-answer-80371
08/25/2018, 12:55 AMpython_tests
target workingbrainy-answer-80371
08/25/2018, 1:31 AMhappy-kitchen-89482
08/25/2018, 1:41 AMhappy-kitchen-89482
08/25/2018, 1:43 AMhappy-kitchen-89482
08/25/2018, 2:10 AMhappy-kitchen-89482
08/25/2018, 2:11 AMhappy-kitchen-89482
08/25/2018, 2:12 AMhundreds-father-404
08/25/2018, 2:14 AMadamant-quill-79654
08/27/2018, 8:52 PMpython_libilary
and open it. Lib which I work on should provide interface for this data.adamant-quill-79654
08/27/2018, 8:53 PMhappy-kitchen-89482
08/27/2018, 11:57 PMsource
to a resources
target, and have the python target depend on it. Then you can load the json file from the PYTHONPATH using pkg_resourceshappy-kitchen-89482
08/27/2018, 11:58 PMjson.loads(pkg_resources.resource_string('my.pkg.path', 'myfile.json'))
happy-kitchen-89482
08/27/2018, 11:58 PMhappy-kitchen-89482
08/27/2018, 11:59 PMpython_library(
dependencies = [
':myfiles',
'3rdparty/python:setuptools`
]
)
resources(
name = 'myfiles',
sources = globs(*.json')
)
enough-analyst-54434
08/28/2018, 12:02 AMsetuptools
, so you'll want a dependency on that.happy-kitchen-89482
08/28/2018, 12:04 AMhappy-kitchen-89482
08/28/2018, 12:06 AMsetuptools
in your 3rdparty/python/BUILD
(or in a requirements.txt
in that dir, if the BUILD file has python_requirements()
in it)happy-kitchen-89482
08/28/2018, 12:06 AMsources = ['myfile.json', 'myotherfile.json']
.high-advantage-47550
08/28/2018, 4:59 PM.pants.d/compile
, but when I add the library as a dependency, the generated classes don't end up on the classpath. I minimally extended JvmCompile
for this -- is there some mechanism I'm missing that defines how the classpath should change?witty-crayon-22786
08/28/2018, 5:01 PMhigh-advantage-47550
08/28/2018, 5:01 PMhigh-advantage-47550
08/28/2018, 5:02 PMwitty-crayon-22786
08/28/2018, 6:21 PMfierce-park-88503
08/29/2018, 2:41 PMpython_requirements()
target)fierce-park-88503
08/29/2018, 2:43 PMenough-analyst-54434
08/29/2018, 2:44 PMenough-analyst-54434
08/29/2018, 2:45 PMfierce-park-88503
08/29/2018, 2:51 PMenough-analyst-54434
08/29/2018, 2:51 PMfierce-park-88503
08/29/2018, 6:35 PM