Skip to content

Commit c32a87c

Browse files
Updated naming conversion for poetry additional arguments and updated docs (readme)
1 parent 3fad7ae commit c32a87c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ source_path = [
459459
- `pip_requirements` - Controls whether to execute `pip install`. Set to `false` to disable this feature, `true` to run `pip install` with `requirements.txt` found in `path`. Or set to another filename which you want to use instead. When `source_path` is passed as a string containing a path (and not a list of maps), and `requirements.txt` is present, `pip install` is automatically executed.
460460
- `pip_tmp_dir` - Set the base directory to make the temporary directory for pip installs. Can be useful for Docker in Docker builds.
461461
- `poetry_install` - Controls whether to execute `poetry export` and `pip install`. Set to `false` to disable this feature, `true` to run `poetry export` with `pyproject.toml` and `poetry.lock` found in `path`. When `source_path` is passed as a string containing a path (and not a list of maps), and `pyproject.toml` with a build system `poetry` is present, `poetry export` and `pip install` are automatically executed.
462-
- `poetry_groups` - A list of poetry dependency groups to install can be left empty to default to default dependencies
462+
- `poetry_extra_args` - A list of additional poetry arguments to add to the poetry export command
463463
- `npm_requirements` - Controls whether to execute `npm install`. Set to `false` to disable this feature, `true` to run `npm install` with `package.json` found in `path`. Or set to another filename which you want to use instead.
464464
- `npm_tmp_dir` - Set the base directory to make the temporary directory for npm installs. Can be useful for Docker in Docker builds.
465465
- `prefix_in_zip` - If specified, will be used as a prefix inside zip-archive. By default, everything installs into the root of zip-archive.

package.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ def pip_requirements_step(path, prefix=None, required=False, tmp_dir=None):
693693
step("pip", runtime, requirements, prefix, tmp_dir)
694694
hash(requirements)
695695

696-
def poetry_install_step(path, poetry_args=[], prefix=None, required=False):
696+
def poetry_install_step(path, poetry_extra_args=[], prefix=None, required=False):
697697
pyproject_file = path
698698
if os.path.isdir(path):
699699
pyproject_file = os.path.join(path, "pyproject.toml")
@@ -703,7 +703,7 @@ def poetry_install_step(path, poetry_args=[], prefix=None, required=False):
703703
"poetry configuration not found: {}".format(pyproject_file)
704704
)
705705
else:
706-
step("poetry", runtime, path, poetry_args, prefix)
706+
step("poetry", runtime, path, poetry_extra_args, prefix)
707707
hash(pyproject_file)
708708
pyproject_path = os.path.dirname(pyproject_file)
709709
poetry_lock_file = os.path.join(pyproject_path, "poetry.lock")
@@ -807,7 +807,7 @@ def commands_step(path, commands):
807807
prefix = claim.get("prefix_in_zip")
808808
pip_requirements = claim.get("pip_requirements")
809809
poetry_install = claim.get("poetry_install")
810-
additional_poetry_arg = claim.get("additional_poetry_args", [])
810+
poetry_extra_args = claim.get("poetry_extra_args", [])
811811
npm_requirements = claim.get("npm_package_json")
812812
runtime = claim.get("runtime", query.runtime)
813813

@@ -832,7 +832,7 @@ def commands_step(path, commands):
832832
poetry_install_step(
833833
path,
834834
prefix=prefix,
835-
poetry_args=additional_poetry_arg,
835+
poetry_extra_args=poetry_extra_args,
836836
required=True,
837837
)
838838

@@ -907,11 +907,11 @@ def execute(self, build_plan, zip_stream, query):
907907
(
908908
runtime,
909909
path,
910-
poetry_args,
910+
poetry_extra_args,
911911
prefix,
912912
) = action[1:]
913-
log.info("Poetry arguments: %s", poetry_args)
914-
with install_poetry_dependencies(query, path, poetry_args) as rd:
913+
log.info("poetry_extra_args: %s", poetry_extra_args)
914+
with install_poetry_dependencies(query, path, poetry_extra_args) as rd:
915915
if rd:
916916
if pf:
917917
self._zip_write_with_filter(zs, pf, rd, prefix, timestamp=0)
@@ -1106,7 +1106,7 @@ def install_pip_requirements(query, requirements_file, tmp_dir):
11061106

11071107

11081108
@contextmanager
1109-
def install_poetry_dependencies(query, path, poetry_args):
1109+
def install_poetry_dependencies(query, path, poetry_extra_args):
11101110
# TODO:
11111111
# 1. Emit files instead of temp_dir
11121112

@@ -1204,7 +1204,7 @@ def copy_file_to_target(file, temp_dir):
12041204
"--output",
12051205
"requirements.txt",
12061206
"--with-credentials",
1207-
] + poetry_args
1207+
] + poetry_extra_args
12081208

12091209
poetry_commands = [
12101210
[

0 commit comments

Comments
 (0)