Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

global: added flask app factory #50

Merged

Conversation

jbenito3
Copy link
Member

@jbenito3 jbenito3 commented Sep 4, 2015

  • Refactors the whole code structure to use Flask-AppFactory.
    (closes global: add flask_appfactory #22)
  • Changes Dockerfile and docker-compose in order to use the newly added
    commands claimstore collect (collects static files) and claimstore initdb && claimstore populatedb which creates the database squema and
    populates it with basic information (predicates).

Signed-off-by: Jose Benito Gonzalez Lopez jose.benito.gonzalez@cern.ch

@jbenito3
Copy link
Member Author

jbenito3 commented Sep 4, 2015

@tiborsimko please could you have a look at the docker modifications I've done before merging...Thanks!
And BTW, that import error report...once again it makes no sense 😢

@@ -45,6 +47,7 @@ ADD . /code

# Install ClaimStore:
RUN pip install -e .
RUN claimstore collect
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra white space can be removed.

@tiborsimko
Copy link
Member

And BTW, that import error report...once again it makes no sense 😢

Let's use # isort:skip and at the higher module level in the offending files until this is solved?

@tiborsimko
Copy link
Member

Refactors the whole code structure to use Flask-AppFactory.

In the commit log message and in the docs, you can maybe specify the full new command line chain to run? Would be easier for people to upgrade...

$ claimstore initdb
$ claimstore populatedb 
$ python run.py
[...]

@jbenito3
Copy link
Member Author

jbenito3 commented Sep 7, 2015

I have thought of adding it to the docs, but since we have only docker-compose build && docker-compose up, I did not change it. Should I add it somewhere in particular?

@jbenito3 jbenito3 force-pushed the 22-add-flask-appfactory branch 5 times, most recently from e25ae39 to 68234ae Compare September 7, 2015 13:41
@jbenito3
Copy link
Member Author

jbenito3 commented Sep 7, 2015

@tiborsimko shall we merge?

from claimstore.modules.claims.fixtures.claimant import CLAIMANT_CDS_FN, \
CLAIMANT_INSPIRE_FN, create_claimant, load_claimant
from claimstore.modules.claims.fixtures.predicate import create_all_predicates
from webtest import TestApp # isort: skip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/isort: skip/isort:skip/

BTW I still get warnings locally, the best is perhaps to use the following test_restful_api.py module docstring:

"""claimstore.modules.claims.restful test suite.

isort:skip_file
"""

This will switch off isort checking for the whole file.

* Refactors the whole code structure to use Flask-AppFactory.
  (closes inveniosoftware#22)

* Adds command `claimstore` with arguments like `run` (runs the
  web server), `initdb` (creates the database schema), `populatedb`
  (inserts all the predicates in the database) and `collect` (collects
  all the static files from the modules to a single location).

* Changes Dockerfile and docker-compose in order to use the newly added
  commands `claimstore collect` and `claimstore initdb && claimstore
  populatedb`.

Signed-off-by: Jose Benito Gonzalez Lopez <jose.benito.gonzalez@cern.ch>
@tiborsimko tiborsimko merged commit 1370431 into inveniosoftware:master Sep 7, 2015
@jbenito3 jbenito3 deleted the 22-add-flask-appfactory branch September 7, 2015 14:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

global: add flask_appfactory
2 participants