mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-21 05:52:17 +00:00
work
This commit is contained in:
38
.ruff.toml
38
.ruff.toml
@@ -1,49 +1,57 @@
|
||||
target-version = "py310"
|
||||
target-version = "py313"
|
||||
unsafe-fixes = true
|
||||
line-length = 100
|
||||
extend-exclude = ["temp"]
|
||||
extend-exclude = ["alembic", "*.ipynb", "temp"]
|
||||
|
||||
|
||||
lint.select = [
|
||||
"E", # pycodestyle errors
|
||||
"W", # pycodestyle warnings
|
||||
"F", # pyflakes
|
||||
"I", # isort
|
||||
'UP', # pyupgrade
|
||||
'A', # flake8-builtins
|
||||
"C4", # flake8-comprehensions
|
||||
'DTZ', # flake8-datetimez
|
||||
"E", # pycodestyle errors
|
||||
'EXE', # flake8-executable
|
||||
"F", # Pyflakes
|
||||
'FA', # flake8-future-annotations
|
||||
"I", # isort
|
||||
'PT', # flake8-pytest-style
|
||||
'RSE', # flake8-raise
|
||||
'SIM', # flake8-simplify
|
||||
'DTZ', # flake8-datetimez, https://beta.ruff.rs/docs/rules/#flake8-datetimez-dtz
|
||||
'UP', # pyupgrade
|
||||
"W", # pycodestyle warnings
|
||||
]
|
||||
|
||||
lint.ignore = [
|
||||
'A003',
|
||||
'DTZ007',
|
||||
# 'C408', # keep dict() as-is
|
||||
'DTZ007', # naive datetime.strptime() without %z
|
||||
'E501',
|
||||
'E711',
|
||||
'E712',
|
||||
# 'E721', # type comparison
|
||||
'E721', # type() comparison
|
||||
# 'E722', # bare except
|
||||
'E741',
|
||||
'F401', # unused imports
|
||||
'EXE003', # shebang should contain "python"
|
||||
'F401', # unused imports
|
||||
'F841',
|
||||
# 'PT018', # assertion should be broken into multiple parts
|
||||
'SIM102',
|
||||
#'SIM103', # needless-bool, return the condition {condition} directly
|
||||
'SIM103', # return the condition directly
|
||||
'SIM105',
|
||||
'SIM108',
|
||||
# 'SIM110', # use any() instead of a for loop
|
||||
# 'SIM114',
|
||||
'SIM115',
|
||||
# 'DTZ007', # Naive datetime constructed using `datetime.datetime.strptime()` without %z
|
||||
# 'UP007', # use X | Y instead of Union[X, Y]
|
||||
# 'UP032', # use an f-string instead of format()
|
||||
# 'UP046', # prefer type parameters over Generic subclasses
|
||||
]
|
||||
|
||||
[format]
|
||||
quote-style = "single"
|
||||
|
||||
[lint.isort]
|
||||
known-first-party = ["ssh_lib"]
|
||||
known-first-party = ["lib", "api", "deploy", "ssh_lib"]
|
||||
lines-after-imports = 2
|
||||
|
||||
[lint.flake8-comprehensions]
|
||||
allow-dict-calls-with-keyword-arguments = true
|
||||
|
||||
|
||||
5
TODO.md
5
TODO.md
@@ -1,3 +1,8 @@
|
||||
making web maps free and fun again
|
||||
add dark themes in website
|
||||
|
||||
|
||||
|
||||
logrotate
|
||||
|
||||
/var/log/nginx/*.log /var/log/nginx/*/*.log {
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
from ssh_lib.utils import (
|
||||
from ssh_lib.apt import (
|
||||
apt_get_install,
|
||||
apt_get_purge,
|
||||
apt_get_update,
|
||||
put_str,
|
||||
sudo_cmd,
|
||||
setup_apt_repository,
|
||||
)
|
||||
from ssh_lib.utils import (
|
||||
ubuntu_codename,
|
||||
)
|
||||
|
||||
|
||||
JAVA_VER = 24
|
||||
ADOPTIUM_REPO_NAME = 'adoptium'
|
||||
|
||||
|
||||
def java(c):
|
||||
@@ -16,25 +18,17 @@ def java(c):
|
||||
# remove old Ubuntu version of OpenJDK
|
||||
apt_get_purge(c, 'openjdk* temurin*')
|
||||
|
||||
# Download and install the Eclipse Adoptium GPG key
|
||||
sudo_cmd(
|
||||
c,
|
||||
'wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public '
|
||||
'| gpg --dearmor '
|
||||
'| tee /etc/apt/trusted.gpg.d/adoptium.gpg > /dev/null',
|
||||
)
|
||||
|
||||
# Get the Ubuntu codename
|
||||
codename = ubuntu_codename(c)
|
||||
|
||||
# Configure the Eclipse Adoptium apt repository
|
||||
put_str(
|
||||
setup_apt_repository(
|
||||
c,
|
||||
'/etc/apt/sources.list.d/adoptium.list',
|
||||
f'deb https://packages.adoptium.net/artifactory/deb {codename} main',
|
||||
repo_name=ADOPTIUM_REPO_NAME,
|
||||
key_url='https://packages.adoptium.net/artifactory/api/gpg/key/public',
|
||||
repo_url='https://packages.adoptium.net/artifactory/deb',
|
||||
suite=codename,
|
||||
component='main',
|
||||
)
|
||||
|
||||
# Update package list and install Temurin JDK
|
||||
apt_get_update(c)
|
||||
apt_get_install(c, f'temurin-{JAVA_VER}-jdk')
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
from ssh_lib.utils import apt_get_update, exists
|
||||
from ssh_lib.apt import apt_get_update
|
||||
from ssh_lib.utils import exists
|
||||
|
||||
|
||||
def rclone(c):
|
||||
|
||||
Reference in New Issue
Block a user