Skip to content
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ansible/site.yml
!ansible/roles/.keep
!ansible/roles/devel

alembic/versions/*
build
cbsd.conf
coverage.xml
Expand Down
11 changes: 6 additions & 5 deletions alembic.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ sqlalchemy.url = sqlite:///db.sqlite
# on newly generated revision scripts. See the documentation for further
# detail and examples

# format using "black" - use the console_scripts runner, against the "black" entrypoint
hooks = black
black.type = console_scripts
black.entrypoint = black
black.options = -l 79 REVISION_SCRIPT_FILENAME
hooks = ruff

# format using "ruff" - use the exec runner, execute a binary
ruff.type = exec
ruff.executable = ruff
ruff.options = format REVISION_SCRIPT_FILENAME

# Logging configuration
[loggers]
Expand Down
90 changes: 0 additions & 90 deletions alembic/versions/06a043f2516a_initial.py

This file was deleted.

13 changes: 13 additions & 0 deletions bin/shell.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

BIN_DIR=`dirname $0`
export FREENIT_ENV=${FREENIT_ENV:="dev"}
export OFFLINE=${OFFLINE:="no"}


. ${BIN_DIR}/common.sh
setup

echo "Backend"
echo "==============="
env PYTHONPATH=${PWD}/.. ipython
7 changes: 3 additions & 4 deletions freenit/base_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ class BaseConfig:
theme_name = "Freenit"
meta = None
auth = Auth()
mail = Mail()
ldap = LDAP()
mail = None
ldap = None

def __init__(self):
self.database = databases.Database(self.dburl)
Expand All @@ -119,15 +119,14 @@ class DevConfig(BaseConfig):
debug = True
dburl = "sqlite:///db.sqlite"
auth = Auth(secure=False)
mail = None


class TestConfig(BaseConfig):
debug = True
dburl = "sqlite:///test.sqlite"
auth = Auth(secure=False)
mail = None


class ProdConfig(BaseConfig):
secret = "MORESECURESECRET" # nosec
mail = Mail()
1 change: 1 addition & 0 deletions freenit/project/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ site.retry
project.mk
vars.mk

.ruff_cache
__pycache__
*.sqlite
*.egg-info
11 changes: 6 additions & 5 deletions freenit/project/alembic.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ sqlalchemy.url = sqlite:///db.sqlite
# on newly generated revision scripts. See the documentation for further
# detail and examples

# format using "black" - use the console_scripts runner, against the "black" entrypoint
# hooks = black
# black.type = console_scripts
# black.entrypoint = black
# black.options = -l 79 REVISION_SCRIPT_FILENAME
hooks = ruff

# format using "ruff" - use the exec runner, execute a binary
ruff.type = exec
ruff.executable = ruff
ruff.options = format REVISION_SCRIPT_FILENAME

# Logging configuration
[loggers]
Expand Down
4 changes: 2 additions & 2 deletions freenit/project/bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ export PROJECT_ROOT="${BIN_DIR}/.."
export VIRTUALENV=${VIRTUALENV:="${app_name}"}
export FREENIT_ENV=${FREENIT_ENV:="prod"}
export SYSPKG=${SYSPKG:="no"}
export OFFLINE=${OFFLINE:="no"}


setup() {
cd ${PROJECT_ROOT}
if [ "${SYSPKG}" != "YES" ]; then
update=${1}
if [ ! -d ${HOME}/.virtualenvs/${VIRTUALENV} ]; then
python${PY_VERSION} -m venv "${HOME}/.virtualenvs/${VIRTUALENV}"
fi
Expand All @@ -22,7 +22,7 @@ setup() {
if [ "${FREENIT_ENV}" = "prod" ]; then
INSTALL_TARGET="."
fi
if [ "${update}" != "no" ]; then
if [ "${OFFLINE}" = "no" ]; then
pip install -U pip
pip install -U wheel
pip install -U --upgrade-strategy eager -e "${INSTALL_TARGET}"
Expand Down
13 changes: 13 additions & 0 deletions freenit/project/bin/shell.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

BIN_DIR=`dirname $0`
export FREENIT_ENV=${FREENIT_ENV:="dev"}
export OFFLINE=${OFFLINE:="no"}


. ${BIN_DIR}/common.sh
setup

echo "Backend"
echo "==============="
env PYTHONPATH=${PWD}/.. ipython
6 changes: 4 additions & 2 deletions freenit/project/project/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
from .router import api
import freenit.api.user
__all__ = ["api", "user", "role"]

from freenit.api import role, user
from freenit.api.router import api
1 change: 0 additions & 1 deletion freenit/project/project/api/router.py

This file was deleted.

4 changes: 2 additions & 2 deletions freenit/project/project/base_config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from freenit.base_config import Auth
from freenit.base_config import BaseConfig as FreenitBaseConfig
from freenit.base_config import Auth, Mail, BaseConfig as FreenitBaseConfig


class BaseConfig(FreenitBaseConfig):
Expand All @@ -21,3 +20,4 @@ class TestConfig(BaseConfig):

class ProdConfig(BaseConfig):
secret = "MORESECURESECRET" #nosec
mail = Mail()
20 changes: 7 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ classifiers = [
beanie = ["beanie"]
dev = [
"aiosqlite",
"black",
"isort",
"ruff",
"uvicorn",
]
build = ["twine"]
Expand All @@ -44,31 +43,26 @@ classifiers = [
test = [
"aiosqlite",
"bandit",
"black",
"httpx",
"isort",
"pytest-asyncio",
"pytest-factoryboy",
"requests",
"ruff",
]
all = [
"beanie",
"aiosqlite",
"black",
"isort",
"uvicorn",
"bonsai",
"alembic",
"ormar",
"aiosqlite",
"bandit",
"black",
"beanie",
"bonsai",
"httpx",
"isort",
"ormar",
"pytest-asyncio",
"pytest-factoryboy",
"requests",
"ruff",
"twine",
"uvicorn",
]

[project.urls]
Expand Down
Loading