Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove DRY_RUN env var and --dry-run flag #210

Merged
merged 1 commit into from
Dec 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ You can configure the Functions Framework using command-line flags or environmen
| `--signature-type` | `FUNCTION_SIGNATURE_TYPE` | The signature used when writing your function. Controls unmarshalling rules and determines which arguments are used to invoke your function. Default: `http`; accepted values: `http`, `event` or `cloudevent` |
| `--source` | `FUNCTION_SOURCE` | The path to the file containing your function. Default: `main.py` (in the current working directory) |
| `--debug` | `DEBUG` | A flag that allows to run functions-framework to run in debug mode, including live reloading. Default: `False` |
| `--dry-run` | `DRY_RUN` | A flag that allows for testing the function build from the configuration without creating a server. Default: `False` |

## Enable Google Cloud Function Events

Expand Down
10 changes: 2 additions & 8 deletions src/functions_framework/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@
@click.option("--host", envvar="HOST", type=click.STRING, default="0.0.0.0")
@click.option("--port", envvar="PORT", type=click.INT, default=8080)
@click.option("--debug", envvar="DEBUG", is_flag=True)
@click.option("--dry-run", envvar="DRY_RUN", is_flag=True)
def _cli(target, source, signature_type, host, port, debug, dry_run):
def _cli(target, source, signature_type, host, port, debug):
app = create_app(target, source, signature_type)
if dry_run:
click.echo("Function: {}".format(target))
click.echo("URL: http://{}:{}/".format(host, port))
click.echo("Dry run successful, shutting down.")
else:
create_server(app, debug).run(host, port)
create_server(app, debug).run(host, port)
12 changes: 0 additions & 12 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,6 @@ def test_cli_no_arguments():
[pretend.call("foo", None, "event")],
[pretend.call("0.0.0.0", 8080)],
),
(
["--target", "foo", "--dry-run"],
{},
[pretend.call("foo", None, "http")],
[],
),
(
[],
{"FUNCTION_TARGET": "foo", "DRY_RUN": "True"},
[pretend.call("foo", None, "http")],
[],
),
(
["--target", "foo", "--host", "127.0.0.1"],
{},
Expand Down