Skip to content

Commit

Permalink
Use paths relative to spec directory
Browse files Browse the repository at this point in the history
  • Loading branch information
KSmanis committed Jan 9, 2022
1 parent acfd6b7 commit 874d0c0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/pipautocompile/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,21 @@ def cli(
tty=True, command=["/app/venv/bin/pip", "install", "pip-tools"]
)

info("Copying specs...")
container_spec_dir = Path("/app/specs/")
container.copy_to(spec_dir, container_spec_dir)

for spec in specs:
info(f"Compiling {spec}...")
container_spec = Path("/app/") / spec.name
container.copy_to(spec, container_spec)
container_spec = container_spec_dir / spec.name
container.execute(
envs=pip_compile_env,
tty=True,
workdir=container_spec_dir,
command=[
"/app/venv/bin/pip-compile",
*pip_compile_args,
container_spec,
container_spec.name,
],
)
container.copy_from(
Expand All @@ -141,6 +145,7 @@ def cli(
for spec in specs:
info(f"Compiling {spec}...")
subprocess.check_call( # nosec
("pip-compile", *pip_compile_args, spec),
("pip-compile", *pip_compile_args, spec.name),
cwd=spec_dir,
env={**os.environ, **pip_compile_env},
)

0 comments on commit 874d0c0

Please sign in to comment.