Skip to content

Commit

Permalink
Add an option to set ouput directory on build
Browse files Browse the repository at this point in the history
  • Loading branch information
Secrus committed Jan 21, 2023
1 parent ed5441f commit 363fef9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ Note that, at the moment, only pure python wheels are supported.
### Options

* `--format (-f)`: Limit the format to either `wheel` or `sdist`.
* `--output (-o)`: Set output directory for build artifacts.

## publish

Expand Down
16 changes: 10 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ generate-setup-file = false
[tool.poetry.dependencies]
python = "^3.7"

poetry-core = "1.4.0"
# subject to change after poetry-core is released
poetry-core = {git = "https://github.com/python-poetry/poetry-core", branch = "main"}
poetry-plugin-export = "^1.2.0"
"backports.cached-property" = { version = "^1.0.2", python = "<3.8" }
cachecontrol = { version = "^0.12.9", extras = ["filecache"] }
Expand Down
5 changes: 3 additions & 2 deletions src/poetry/console/commands/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ class BuildCommand(EnvCommand):
description = "Builds a package, as a tarball and a wheel by default."

options = [
option("format", "f", "Limit the format to either sdist or wheel.", flag=False)
option("format", "f", "Limit the format to either sdist or wheel.", flag=False),
option("output", "o", "Set output directory name", flag=False, default="dist"),
]

loggers = [
Expand All @@ -31,6 +32,6 @@ def handle(self) -> int:
)

builder = Builder(self.poetry)
builder.build(fmt, executable=env.python)
builder.build(fmt, executable=env.python, target_dir=self.option("output"))

return 0

0 comments on commit 363fef9

Please sign in to comment.