Skip to content

Commit

Permalink
www: Move imports into function
Browse files Browse the repository at this point in the history
Moved the imports in __init__.py in the nipapwww module to be able to
import the module during package build without having the dependencies
installed.
  • Loading branch information
garberg committed Oct 5, 2023
1 parent eba6be6 commit e3c586c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions nipap-www/nipapwww/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
import os

from flask import Flask, redirect, url_for

from nipap.nipapconfig import NipapConfig

import pynipap

__version__ = "0.31.1"
__author__ = "Kristian Larsson, Lukas Garberg"
__author_email__ = "[email protected], [email protected]"
Expand All @@ -15,6 +7,14 @@


def create_app(test_config=None):

# Moved imports here to be able to import this module without having the
# dependencies installed. Relevant during initial package build.
import os
from flask import Flask, redirect, url_for
from nipap.nipapconfig import NipapConfig
import pynipap

# create and configure the app
app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping(
Expand Down

0 comments on commit e3c586c

Please sign in to comment.