Skip to content

Commit

Permalink
Merge pull request #207 from ral-facilities/feature/wsgi
Browse files Browse the repository at this point in the history
Add WSGI script and fix errors with pip install
  • Loading branch information
ajkyffin authored Feb 26, 2021
2 parents 611c227 + 1572c0c commit 04eafd5
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ max-complexity = 17
max-line-length = 80
application-import-names = datagateway_api,test,util
import-order-style = google
per-file-ignores = test/*:S101,util/icat_db_generator.py:S311
per-file-ignores = test/*:S101,util/icat_db_generator.py:S311,datagateway_api/wsgi.py:E402,F401
enable-extensions=G
4 changes: 2 additions & 2 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ jobs:
run: touch logs.log
- name: Configure log file location
run: echo "`jq -r --arg REPO_DIR "$GITHUB_WORKSPACE/logs.log" \
'.log_location=$REPO_DIR' config.json.example`" > config.json.example
'.log_location=$REPO_DIR' datagateway_api/config.json.example`" > datagateway_api/config.json.example
- name: Create config.json
run: cp config.json.example config.json
run: cp datagateway_api/config.json.example datagateway_api/config.json

# Install Nox, Poetry and API's dependencies
- name: Install Nox
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,9 @@ illustrated below:
├── .pre-commit-config.yaml
├── LICENSE
├── README.md
├── config.json.example
├── datagateway_api
│ ├── config.json.example
│ ├── wsgi.py
│ ├── common
│ │ ├── backend.py
│ │ ├── backends.py
Expand Down
2 changes: 1 addition & 1 deletion datagateway_api/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class Config(object):
def __init__(self, path=Path(__file__).parent.parent.parent / "config.json"):
def __init__(self, path=Path(__file__).parent.parent / "config.json"):
self.path = path
with open(self.path) as target:
self.config = json.load(target)
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions datagateway_api/wsgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import logging
import sys

logging.basicConfig(stream=sys.stderr)

from datagateway_api.src.main import app as application
121 changes: 70 additions & 51 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ PyYAML = "5.3.1"
python-icat = "0.17.0"
suds-community = "^0.8.4"
Flask-SQLAlchemy = "^2.4.4"
requests = "^2.25.1"
python-dateutil = "^2.8.1"

[tool.poetry.dev-dependencies]
pip-tools = "5.3.1"
Expand Down
Loading

0 comments on commit 04eafd5

Please sign in to comment.