-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Project update: - running on docker - upgrade dependencies - removed jdc provider - add GitHub actions lint and test
- Loading branch information
Showing
61 changed files
with
2,589 additions
and
3,051 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
local_settings.py | ||
env.list | ||
volumes | ||
.env* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# COMMONS | ||
MONGODB_URL=mongodb://localhost:27017/winds_mobi | ||
REDIS_URL=redis://localhost:6380/0 | ||
GOOGLE_API_KEY= | ||
|
||
# PROVIDERS | ||
|
||
# Windline | ||
WINDLINE_SQL_URL= | ||
|
||
# METAR | ||
CHECKWX_API_KEY= | ||
|
||
# Romma | ||
ROMMA_KEY= | ||
|
||
# iWeathar | ||
IWEATHAR_KEY= | ||
|
||
# BornToFly | ||
BORN_TO_FLY_VENDOR_ID= | ||
BORN_TO_FLY_DEVICE_ID= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# COMMONS | ||
MONGODB_URL=mongodb://mongodb:27017/winds_mobi | ||
REDIS_URL=redis://host.docker.internal:6380/0 | ||
GOOGLE_API_KEY= | ||
|
||
# PROVIDERS | ||
|
||
# Windline | ||
WINDLINE_SQL_URL= | ||
|
||
# METAR | ||
CHECKWX_API_KEY= | ||
|
||
# Romma | ||
ROMMA_KEY= | ||
|
||
# iWeathar | ||
IWEATHAR_KEY= | ||
|
||
# BornToFly | ||
BORN_TO_FLY_VENDOR_ID= | ||
BORN_TO_FLY_DEVICE_ID= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[flake8] | ||
max-line-length = 120 | ||
multiline-quotes = ''' | ||
extend-ignore = E203 | ||
exclude = winds_mobi_provider/uwxutils.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Test project | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
test-python: | ||
name: Lint and test | ||
runs-on: ubuntu-latest | ||
env: | ||
PYTHON_VERSION: "3.9" | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Install python dependencies with pipenv | ||
run: | | ||
pip install pipenv | ||
pipenv install --deploy --dev | ||
- name: Check python code format | ||
run: pipenv run black --check . | ||
|
||
- name: Run python linter | ||
run: pipenv run flake8 . | ||
|
||
- name: Run python tests | ||
run: pipenv run pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
*.pyc | ||
.idea/ | ||
/local_settings.py | ||
/env.list | ||
/volumes/ | ||
.env | ||
.env.localhost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,29 @@ | ||
FROM python:3.7-slim-buster | ||
FROM python:3.9-slim-buster AS base | ||
|
||
ENV LANG C.UTF-8 | ||
ENV LC_ALL C.UTF-8 | ||
|
||
# PHP 7.3 is required by JDC provider | ||
RUN apt-get update; \ | ||
DEBIAN_FRONTEND=noninteractive apt-get --yes --no-install-recommends install build-essential \ | ||
python-scipy libpq-dev libmariadb-dev-compat php7.3-cli; \ | ||
rm -rf /var/lib/apt/lists/* | ||
apt-get --yes --no-install-recommends install python-scipy libpq5 libmariadb3 | ||
|
||
ADD . /app | ||
WORKDIR /app | ||
FROM base AS python-deps | ||
|
||
RUN apt-get update; \ | ||
apt-get --yes --no-install-recommends install build-essential python-scipy libpq-dev libmariadb-dev | ||
|
||
RUN pip install pipenv | ||
RUN pipenv install --system --deploy | ||
|
||
RUN apt-get --yes --purge autoremove build-essential | ||
COPY . . | ||
RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy | ||
|
||
FROM base AS runtime | ||
|
||
ENV PATH="/.venv/bin:$PATH" | ||
|
||
WORKDIR /app | ||
COPY . . | ||
|
||
FROM runtime AS production | ||
|
||
ENTRYPOINT ["python"] | ||
COPY --from=python-deps /.venv /.venv | ||
ENTRYPOINT ["python", "run_providers.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.