Drop _go_to_top_cargo_toml

This commit is contained in:
Alberto Planas 2021-03-22 19:09:54 +01:00
parent 7b93f1a01a
commit b8c292f0aa

View file

@ -32,15 +32,6 @@ def _cargo_toml(source_path, path, exclude_vendor=True):
raise Exception(f'Cargo.toml not found for binary {binary}')
def _go_to_top_cargo_toml(source_path, path):
"""Find the top Cargo.toml and change directory."""
path = os.path.dirname(path)
while path != source_path:
if os.path.exists(os.path.join(path, 'Cargo.toml')):
os.chdir(path)
path = os.path.dirname(path)
def main():
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group(required=True)
@ -110,10 +101,6 @@ def main():
return data
for f in files:
# We need to change directory, so cargo can find any local
# configuration file
_go_to_top_cargo_toml(args.path, f)
data = set()
mds = Metadata.from_file(f)
for md in mds: