fresh-architect-74417
04/30/2021, 8:33 PMdependencies
function from an external library. Is that possible? I know Get and MultiGet use a custom ioloop written in rust.hundreds-father-404
04/30/2021, 8:37 PM@_uncacheable_rule
instead of @rule
fresh-architect-74417
04/30/2021, 8:39 PM@_uncacheable_rule
fresh-architect-74417
04/30/2021, 9:04 PMbuild_parser.parse_file('<BUILD FILE PATH>')
[
{
'type': 'python_library',
'name': 'rorm',
'dependencies': ['src/python/pants/libs/goldmine:utils'],
'sources': 'rorm.py'
},
{
'type': 'python_binary',
'name': 'utils',
'dependencies': ['3rdparty/python:boto3'],
'sources': ['utils.py'],
'zip_safe': True,
'version': 1
},
{
'type': 'python_tests',
'name': 'parser',
'dependencies': ['src/python/pants/libs/build_parser:parser'],
'sources': ['parser_test.py']
},
{
'type': 'resources',
'name': 'scripts',
'sources': ['mco-dynamodblocal']
}
]
Is it possible to read the dependencies for a given target by calling
@goal_rule
async def dependencies(
console: Console, addresses: Addresses,
dependencies_subsystem: DependenciesSubsystem
)
from external library?fresh-architect-74417
04/30/2021, 9:06 PMparse_file
uses Python ast to read the BUILD files. I wrote it 2 years ago when I wanted to read list of dependencies from pants, and calling pants was too slow for my use case.hundreds-father-404
04/30/2021, 9:08 PM@goal_rule
from a plugin, but you can call the code that determines dependencies: https://www.pantsbuild.org/v2.5/docs/rules-api-and-target-api#the-dependencies-field
What's the end goal here? Are you thinking of adding a new goal like ./pants custom-workflow
?
--
Taking a step back, have you tried recently to do this via ./pants dependencies
with pantsd? Pantsd wasn't as much of a thing 2 years ago, and it didn't work as well with the v1 engine. It's meant to make "warm" runs very fastfresh-architect-74417
04/30/2021, 9:21 PM--changed-since
, but I will need to test it with sharding.fresh-architect-74417
04/30/2021, 9:22 PMpantsd
from Python?happy-kitchen-89482
05/05/2021, 1:38 AM./pants dependencies
as usual but with pantsd enabled. The idea is that this would now be fast enough to use for your purposes.happy-kitchen-89482
05/05/2021, 1:38 AM