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

chore: Updating all dependencies #123

Merged
merged 4 commits into from
Jan 30, 2024
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
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.12"

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

[requires]
Expand Down
1,099 changes: 567 additions & 532 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.11 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
22 changes: 5 additions & 17 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 @@ -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
Loading