Skip to content

Commit

Permalink
[Release] Synchronize for release
Browse files Browse the repository at this point in the history
  • Loading branch information
reboot-dev-bot committed Dec 5, 2024
1 parent c588216 commit c983c0c
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 55 deletions.
26 changes: 4 additions & 22 deletions .tests/all_pytests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,9 @@ all_application_folders=(
"hello-tasks"
)

# In case of any errors, this test has failed. Fail immediately.
set -e
# In case of undefined variables, there must be a bug. Fail immediately.
set -u
# Show us the commands we're executing, to aid in debugging.
set -x

# Check that this script has been invoked with the right working directory, by
# checking that the expected subdirectories exist.
ls -l api/ hello-constructors/backend/src/ 2> /dev/null > /dev/null || {
echo "ERROR: this script must be invoked from the root of the 'reboot-examples' repository."
echo "Current working directory is '$(pwd)'."
exit 1
}
set -e # Exit if a command exits with an error.
set -u # In case of undefined variables, there must be a bug. Fail immediately.
set -x # Echo executed commands to help debug failures.

# Require `REBOOT_WHL_FILE` to have been passed; all tests calling this
# file should be explicit about a specific Reboot wheel file they've built.
Expand All @@ -45,18 +34,11 @@ function runPyTest () {
popd
}

# Convert symlinks to files that we need to mutate into copies.
for file in "requirements.lock" "requirements-dev.lock" "pyproject.toml"; do
cp "$file" "${file}.tmp"
rm "$file"
mv "${file}.tmp" "$file"
done

# Install the `reboot` package from the specified path explicitly, over-
# writing the version from `pyproject.toml`.
rye remove --no-sync reboot
rye remove --no-sync --dev reboot
rye add --dev reboot --absolute --path=$REBOOT_WHL_FILE
rye add --dev reboot --absolute --path=${SANDBOX_ROOT}$REBOOT_WHL_FILE

# Create and activate a virtual environment.
rye sync --no-lock
Expand Down
27 changes: 3 additions & 24 deletions .tests/readme_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,8 @@

### Preamble: sanity checks and setup not found in the `README.md`. ###

# In case of any errors, this test has failed. Fail immediately.
set -e
# Show us the commands we're executing, to aid in debugging.
set -x

# Check that this script has been invoked with the right working directory, by
# checking that the expected subdirectories exist.
ls -l api/ hello-constructors/backend/src/ 2> /dev/null > /dev/null || {
echo "ERROR: this script must be invoked from the root of the 'reboot-examples' repository."
echo "Current working directory is '$(pwd)'."
exit 1
}

# Convert symlinks to files that we need to mutate into copies.
for file in "requirements.lock" "requirements-dev.lock" "pyproject.toml"; do
cp "$file" "${file}.tmp"
rm "$file"
mv "${file}.tmp" "$file"
done
set -e # Exit if a command exits with an error.
set -x # Echo executed commands to help debug failures.

# Use the published Reboot pip package by default, but allow the test system
# to override them with a different value.
Expand All @@ -32,7 +15,7 @@ if [ -n "$REBOOT_WHL_FILE" ]; then
# writing the version from `pyproject.toml`.
rye remove --no-sync reboot
rye remove --no-sync --dev reboot
rye add --dev reboot --absolute --path=$REBOOT_WHL_FILE
rye add --dev reboot --absolute --path=${SANDBOX_ROOT}$REBOOT_WHL_FILE
fi

### Start of the README.md test ###
Expand All @@ -49,7 +32,3 @@ rbt protoc

# Test.
pytest backend/

# Deactivate the virtual environment, since we can run a test which may require
# another virtual environment (currently we do that only in `all_tests.sh`).
deactivate
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ way of keeping the options you have to type (and remember!) to a minimum. We
provide a different `.rbtrc` for every application in this repository, and by
selecting an application directory you select the `.rbtrc` that will be used:

<!-- MARKDOWN-AUTO-DOCS:START (CODE:src=./.tests/readme_test.sh&lines=45-45) -->
<!-- MARKDOWN-AUTO-DOCS:START (CODE:src=./.tests/readme_test.sh&lines=28-28) -->
<!-- The below code snippet is automatically added from ./.tests/readme_test.sh -->
```sh
cd hello-constructors
Expand Down
8 changes: 4 additions & 4 deletions bank/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
def configure_parser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser()
parser.add_argument(
"--gateway_address",
"--application_api_url",
type=str,
default="localhost:9991",
default="http://localhost:9991",
)
parser.add_argument(
"--bank_id",
Expand Down Expand Up @@ -91,10 +91,10 @@ def configure_parser() -> argparse.ArgumentParser:
return parser


async def run_action(args: argparse.Namespace) -> int:
async def run_action(args: argparse.Namespace) -> None:
context = ExternalContext(
name=f"bank-cli-action-{str(uuid.uuid4())}",
gateway=args.gateway_address,
url=args.application_api_url,
)

bank = Bank.lookup(args.bank_id)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[project]
requires-python = ">= 3.10"
dependencies = [
"reboot==0.19.2",
"reboot==0.20.0",
]

[tool.rye]
dev-dependencies = [
"mypy==1.2.0",
"pytest>=7.4.2",
"types-protobuf>=4.24.0.20240129",
"reboot==0.19.2",
"reboot==0.20.0",
]

# This project only uses `rye` to provide `python` and its dependencies, so
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ python-dateutil==2.9.0.post0
pyyaml==6.0.2
# via kubernetes-asyncio
# via reboot
reboot==0.19.2
reboot==0.20.0
setuptools==75.1.0
# via grpcio-tools
six==1.16.0
Expand Down
2 changes: 1 addition & 1 deletion requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ python-dateutil==2.9.0.post0
pyyaml==6.0.2
# via kubernetes-asyncio
# via reboot
reboot==0.19.2
reboot==0.20.0
setuptools==75.1.0
# via grpcio-tools
six==1.16.0
Expand Down

0 comments on commit c983c0c

Please sign in to comment.