Skip to content

Commit 8854ecd

Browse files
phorwardsveneberth
andauthored
chore: Updating all dependencies (#123)
- Update viur-core 3.5.12 - Update viur-cli 1.1.2 - Update viur-admin 4.0.24 - Update app.yaml - Update project.json - Update README.md - Update tox.ini - Update .gitignore - Cleaned-up clean-base.py --------- Co-authored-by: Sven Eberth <mail@sveneberth.de>
1 parent 9ace35a commit 8854ecd

11 files changed

+640
-626
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
*.bak
44
*.bat
55

6+
.venv
67
.idea
8+
.vscode
79

810
deploy/pyodide
911
deploy/vi

.gitmodules

Whitespace-only changes.

Pipfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ verify_ssl = true
44
name = "pypi"
55

66
[packages]
7-
viur-core = "==3.5.1"
7+
viur-core = "==3.5.12"
88

99
[dev-packages]
10-
viur-cli = "~=1.0"
10+
viur-cli = "==1.1.2"
1111
pycodestyle = "==2.10.0"
1212

1313
[requires]

Pipfile.lock

+567-532
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,22 @@ project demands.
1515

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

18-
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.
19-
2. `git`, `python >= 3.10` and `pipenv` should be installed
18+
1. You either need Linux, macOS, or Windows with WSL.
19+
See [awesome-viur](https://awesome.viur.dev/README#tutorials--examples) for further help and information for specific operating systems.
20+
2. `git`, `python`, `pyenv` and `pipenv` should be installed
21+
You can use any Python version >= 3.10 with ViUR, we recommend Python 3.11 currently.
2022
3. install [Google Cloud SDK](https://cloud.google.com/sdk/docs/install) and the required components with the following commands
21-
```
22-
gcloud components update
23-
gcloud components install app-engine-python app-engine-python-extras
24-
gcloud auth application-default login
23+
```
24+
gcloud components update
25+
gcloud components install app-engine-python app-engine-python-extras
26+
gcloud auth application-default login
2527
```
2628
or (see [here](https://core.docs.viur.dev/en/stable/doc_start/index.html#prerequisites) for further help)
2729
2830
## Usage
2931
3032
1. Create a new Google Cloud project [here](https://console.cloud.google.com/projectcreate) and activate billing.
31-
33+
3234
> We will refer to the name of the project you created as `YOUR-APP-ID`.
3335
2. Clone this repository with `git clone https://github.com/viur-framework/viur-base.git YOUR-PROJECT`.
3436
@@ -37,7 +39,7 @@ Before you start, please check out the following preliminaries are met:
3739
4. `./clean-base.py -A YOUR-APP-ID`
3840
5. `./viur-gcloud-setup.sh YOUR-APP-ID`
3941
6. Install local development dependencies with `pipenv install --dev`
40-
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.
42+
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.
4143
4244
See the [documentation](https://viur-core.readthedocs.io/en/latest/doc_start/index.html) for further help.
4345

clean-base.py

+15-31
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,10 @@
22
import argparse
33
import datetime
44
import getpass
5-
import io
65
import os
76
import subprocess
87
import sys
9-
import time
10-
import zipfile
118

12-
from urllib.request import urlopen
13-
14-
VI_VERSION = "3.0.31"
159

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

5145
if args.app_id is None:
52-
prompt = f"Enter Author Name (leave empty to default to {whoami}): "
53-
name = input(prompt)
46+
prompt = input(f"Enter author name (leave empty to default to {whoami}): ")
5447

55-
if name:
56-
whoami = name
48+
if prompt:
49+
whoami = prompt
5750

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

60-
prompt = f"Enter application-id (leave empty to default to {app_id}): "
61-
name = input(prompt)
53+
prompt = input(f"Enter application-id (leave empty to default to {app_id}): ")
54+
55+
if prompt:
56+
app_id = prompt
6257

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

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

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

7465
workdir = os.getcwd() + "/deploy"
7566
file_list = ["viur-project.md"]
@@ -99,8 +90,8 @@
9990

10091
# Update submodules
10192

102-
if os.path.exists(".git") and clean_history:
103-
print("Clean git history")
93+
if clean_history and os.path.exists(".git"):
94+
print("Cleaning git history")
10495
subprocess.check_output("git checkout --orphan main_tmp", shell=True)
10596
print(subprocess.check_output("git branch -D main", shell=True).decode().rstrip("\n"))
10697
subprocess.check_output("git branch -m main", shell=True)
@@ -111,14 +102,6 @@
111102
)
112103
print("---")
113104

114-
# Install prebuilt Vi
115-
sys.stdout.write("Downloading latest build of viur-vi...")
116-
zip = urlopen(f"https://github.com/viur-framework/viur-vi/releases/download/v{VI_VERSION}/viur-vi.zip").read()
117-
zip = zipfile.ZipFile(io.BytesIO(zip))
118-
zip.extractall("deploy/vi")
119-
zip.close()
120-
print("Done")
121-
122105
# Generate files
123106
sys.stdout.write("Generating project documentation...")
124107
sys.stdout.flush()
@@ -138,8 +121,9 @@
138121
print("# Next run #")
139122
print("# #")
140123
print("# pipenv install --dev #")
124+
print("# pipenv run viur build release #")
141125
print("# #")
142-
print("# Then, run #")
126+
print("# Afterwards, run #")
143127
print("# #")
144128
print("# ./viur-gcloud-setup.sh #")
145129
print("# #")

deploy/app.yaml

+5-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
runtime: python310
1+
runtime: python311
22

33
# (1) Under some circumstances, you need to set a higher instance_class,
44
# like F2 or F4. Unfortunately, this will increase App Engine cost,
@@ -16,20 +16,11 @@ automatic_scaling:
1616
max_instances: 1
1717
max_idle_instances: 1
1818

19-
handlers:
20-
# (4) For a local Pyodide installation, activate below and run get-pyodide.py from project root.
21-
# Leave the comments to use the CDN-version of Pyodide, which also runs very well.
22-
#- url: /pyodide/(.*\.(wasm|data))$
23-
# static_files: pyodide/\1
24-
# upload: pyodide/.*\.(wasm|data)$
25-
# mime_type: application/wasm
26-
#- url: /pyodide
27-
# static_dir: pyodide
28-
29-
# (5) Activate this when vi_plugins should be used
30-
#- url: /vi_plugins/s
31-
# static_dir: vi_plugins
19+
# (4) Required for viur-core >= 3.6, leave as is for viur-core <= 3.5
20+
# app_engine_apis: true
3221

22+
# (5) Default handlers for ViUR. Add project-specific handlers if wanted.
23+
handlers:
3324
- url: /vi/s
3425
static_dir: vi
3526
- url: /static
@@ -45,9 +36,6 @@ handlers:
4536
- url: /robots.txt
4637
static_files: static/meta/robots.txt
4738
upload: robots.txt
48-
# (5) This is necessary to use the Google appengine apis
49-
app_engine_apis: true
5039

5140
inbound_services:
5241
- warmup
53-

0 commit comments

Comments
 (0)