Skip to content

Commit

Permalink
chore: Updating all dependencies
Browse files Browse the repository at this point in the history
- Update viur-core 3.5.10
- Update viur-cli 1.1.1
- Update viur-admin 4.0.22
- Update app.yaml
- Update project.json
- Update README.md
- Cleaned-up clean-base.py
  • Loading branch information
phorward committed Jan 8, 2024
1 parent 2f5573c commit 70e53e3
Show file tree
Hide file tree
Showing 11 changed files with 639 additions and 619 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
*.bak
*.bat

.venv
.idea
.vscode

deploy/pyodide
deploy/vi
Expand Down
Empty file removed .gitmodules
Empty file.
4 changes: 2 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ verify_ssl = true
name = "pypi"

[packages]
viur-core = "==3.5.1"
viur-core = "==3.5.10"

[dev-packages]
viur-cli = "~=1.0"
viur-cli = "==1.1.1"
pycodestyle = "==2.10.0"

[requires]
Expand Down
1,089 changes: 565 additions & 524 deletions Pipfile.lock

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,22 @@ project demands.

Before you start, please check out the following preliminaries are met:

1. You either need Linux, macOS, or Windows with WSL. See [awesome-viur](https://awesome.viur.dev/README#tutorials--examples) for further help and information for specific operating systems.
2. `git`, `python >= 3.10` and `pipenv` should be installed
1. You either need Linux, macOS, or Windows with WSL.
See [awesome-viur](https://awesome.viur.dev/README#tutorials--examples) for further help and information for specific operating systems.
2. `git`, `python`, `pyenv` and `pipenv` should be installed
You can use any Python version >= 3.10 with ViUR, we recommend Python 3.10 currently.
3. install [Google Cloud SDK](https://cloud.google.com/sdk/docs/install) and the required components with the following commands
```
gcloud components update
gcloud components install app-engine-python app-engine-python-extras
gcloud auth application-default login
```
gcloud components update
gcloud components install app-engine-python app-engine-python-extras
gcloud auth application-default login
```
or (see [here](https://core.docs.viur.dev/en/stable/doc_start/index.html#prerequisites) for further help)
## Usage
1. Create a new Google Cloud project [here](https://console.cloud.google.com/projectcreate) and activate billing.
> We will refer to the name of the project you created as `YOUR-APP-ID`.
2. Clone this repository with `git clone https://github.com/viur-framework/viur-base.git YOUR-PROJECT`.
Expand All @@ -37,7 +39,7 @@ Before you start, please check out the following preliminaries are met:
4. `./clean-base.py -A YOUR-APP-ID`
5. `./viur-gcloud-setup.sh YOUR-APP-ID`
6. Install local development dependencies with `pipenv install --dev`
7. Locally run your project with `pipenv run viur run` or deploy it with `pipenv run viur deploy app`. Run a `pipenv shell` to work with the [viur-cli](https://github.com/viur-framework/viur-cli) command line tool.
7. Locally run your project with `pipenv run viur run` or deploy it with `pipenv run viur deploy app`. Run a `pipenv shell` to work with the [viur-cli](https://github.com/viur-framework/viur-cli) command line tool.
See the [documentation](https://viur-core.readthedocs.io/en/latest/doc_start/index.html) for further help.
Expand All @@ -51,7 +53,7 @@ We take great interest in your opinion about ViUR. We appreciate your feedback a
## License
Copyright © 2023 by Mausbrand Informationssysteme GmbH.<br>
Copyright © 2024 by Mausbrand Informationssysteme GmbH.<br>
Mausbrand and ViUR are registered trademarks of Mausbrand Informationssysteme GmbH.
You may use, modify and distribute this software under the terms and conditions of the GNU Lesser General Public License (LGPL).<br>
Expand Down
46 changes: 15 additions & 31 deletions clean-base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@
import argparse
import datetime
import getpass
import io
import os
import subprocess
import sys
import time
import zipfile

from urllib.request import urlopen

VI_VERSION = "3.0.31"

try:
whoami = getpass.getuser()
Expand Down Expand Up @@ -49,27 +43,24 @@
update = False # this might be changed by command-line flag later on

if args.app_id is None:
prompt = f"Enter Author Name (leave empty to default to {whoami}): "
name = input(prompt)
prompt = input(f"Enter author name (leave empty to default to {whoami}): ")

if name:
whoami = name
if prompt:
whoami = prompt

app_id = os.path.split(os.getcwd())[-1]

prompt = f"Enter application-id (leave empty to default to {app_id}): "
name = input(prompt)
prompt = input(f"Enter application-id (leave empty to default to {app_id}): ")

if prompt:
app_id = prompt

if name:
app_id = name
while (prompt := input("Do you want to clean the git history? [Y/n] ").lower().strip()) not in {"", "y", "n"}:
print(f'Invalid option "{prompt}". "y", "n" or empty input expected.')

prompt = "Do you want to clean the git history? [Y/n] "
while (option := input(prompt).lower().strip()) not in {"", "y", "n"}:
print(f'Invalid option "{option}". "y", "n" or empty input expected.')
clean_history = option != "n"
clean_history = prompt != "n"

time = time.time()
timestamp = datetime.datetime.fromtimestamp(time).strftime("%Y-%m-%d %H:%M:%S")
timestamp = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")

workdir = os.getcwd() + "/deploy"
file_list = ["viur-project.md"]
Expand Down Expand Up @@ -99,8 +90,8 @@

# Update submodules

if os.path.exists(".git") and clean_history:
print("Clean git history")
if clean_history and os.path.exists(".git"):
print("Cleaning git history")
subprocess.check_output("git checkout --orphan main_tmp", shell=True)
print(subprocess.check_output("git branch -D main", shell=True).decode().rstrip("\n"))
subprocess.check_output("git branch -m main", shell=True)
Expand All @@ -111,14 +102,6 @@
)
print("---")

# Install prebuilt Vi
sys.stdout.write("Downloading latest build of viur-vi...")
zip = urlopen(f"https://github.com/viur-framework/viur-vi/releases/download/v{VI_VERSION}/viur-vi.zip").read()
zip = zipfile.ZipFile(io.BytesIO(zip))
zip.extractall("deploy/vi")
zip.close()
print("Done")

# Generate files
sys.stdout.write("Generating project documentation...")
sys.stdout.flush()
Expand All @@ -138,8 +121,9 @@
print("# Next run #")
print("# #")
print("# pipenv install --dev #")
print("# pipenv run viur build release #")
print("# #")
print("# Then, run #")
print("# Afterwards, run #")
print("# #")
print("# ./viur-gcloud-setup.sh #")
print("# #")
Expand Down
24 changes: 6 additions & 18 deletions deploy/app.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
runtime: python310
runtime: python311

# (1) Under some circumstances, you need to set a higher instance_class,
# like F2 or F4. Unfortunately, this will increase App Engine cost,
Expand All @@ -7,7 +7,7 @@ instance_class: F1
default_expiration: "30s"

# (2) To get more memory and concurrent requests, a separate gunicorn is run.
entrypoint: gunicorn -b :$PORT -w 1 --threads 2 --disable-redirect-access-to-syslog main:app
entrypoint: gunicorn -b :$PORT -w 1 --threads 2 --disable-redirect-access-to-syslog --timeout 60 main:app

# (3) Limited scaling is default, to keep frontend instance hours low.
# Please change these values on your demands.
Expand All @@ -16,20 +16,11 @@ automatic_scaling:
max_instances: 1
max_idle_instances: 1

handlers:
# (4) For a local Pyodide installation, activate below and run get-pyodide.py from project root.
# Leave the comments to use the CDN-version of Pyodide, which also runs very well.
#- url: /pyodide/(.*\.(wasm|data))$
# static_files: pyodide/\1
# upload: pyodide/.*\.(wasm|data)$
# mime_type: application/wasm
#- url: /pyodide
# static_dir: pyodide

# (5) Activate this when vi_plugins should be used
#- url: /vi_plugins/s
# static_dir: vi_plugins
# (4) Required for viur-core >= 3.6, leave as is for viur-core <= 3.5
# app_engine_apis: true

# (5) Default handlers for ViUR. Add project-specific handlers if wanted.
handlers:
- url: /vi/s
static_dir: vi
- url: /static
Expand All @@ -45,9 +36,6 @@ handlers:
- url: /robots.txt
static_files: static/meta/robots.txt
upload: robots.txt
# (5) This is necessary to use the Google appengine apis
app_engine_apis: true

inbound_services:
- warmup

Loading

0 comments on commit 70e53e3

Please sign in to comment.