Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple changes in providers repo #312

Merged
merged 19 commits into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,15 @@ updates:
- shyamd
labels:
- dependency_updates
- package-ecosystem: submodules
directory: "/"
schedule:
interval: weekly
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
interval: weekly
interval: weekly

I reckon we could make this one daily? We're never going to decline it and it would be good for clients that are continuously deploying this package to remain up to date.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good.

open-pull-requests-limit: 10
target-branch: master
reviewers:
- CasperWA
- ml-evs
- shyamd
labels:
- providers_updates
10 changes: 10 additions & 0 deletions .github/workflows/deps_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Set up Python 3.7
uses: actions/setup-python@v1
Expand All @@ -58,6 +60,8 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Set up Python 3.7
uses: actions/setup-python@v1
Expand Down Expand Up @@ -86,6 +90,8 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Build the Docker images
run: docker-compose build
Expand Down Expand Up @@ -148,6 +154,8 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
Expand Down Expand Up @@ -199,6 +207,8 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
submodules: true

- uses: actions/setup-python@v1
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/publish-on-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true

- name: Set up Python 3.7
uses: actions/setup-python@v1
Expand Down Expand Up @@ -94,6 +96,8 @@ jobs:

steps:
- uses: actions/checkout@v2
with:
submodules: true

- uses: actions/setup-python@v1
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "providers"]
path = providers
url = git@github.com:Materials-Consortia/providers.git
shyamd marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ WORKDIR /app
# copy repo contents
COPY setup.py README.md ./
COPY optimade ./optimade
COPY providers/providers.json ./optimade/server/data/
shyamd marked this conversation as resolved.
Show resolved Hide resolved
RUN pip install -e .[server]

ARG PORT=5000
Expand Down
1 change: 1 addition & 0 deletions optimade/server/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"structures": "test_structures.json",
"references": "test_references.json",
"links": "test_links.json",
"providers": "providers.json",
}


Expand Down
1 change: 1 addition & 0 deletions optimade/server/data/providers.json
10 changes: 2 additions & 8 deletions optimade/server/routers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from optimade.server.entry_collections import EntryCollection
from optimade.server.exceptions import BadRequest
from optimade.server.query_params import EntryListingQueryParams, SingleEntryQueryParams

from optimade.server.data import providers

ENTRY_INFO_SCHEMAS = {
"structures": StructureResource.schema,
Expand Down Expand Up @@ -303,14 +303,8 @@ def mongo_id_for_database(database_id: str, database_type: str) -> str:

def get_providers():
"""Retrieve Materials-Consortia providers (from https://providers.optimade.org/providers.json)"""
import requests

mat_consortia_providers = requests.get(
"https://providers.optimade.org/providers.json"
).json()

providers_list = []
for provider in mat_consortia_providers.get("data", []):
for provider in providers.get("data", []):
# Remove/skip "exmpl"
if provider["id"] == "exmpl":
continue
Expand Down
1 change: 1 addition & 0 deletions providers
Submodule providers added at 732593
1 change: 1 addition & 0 deletions tests/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"landing_page.html",
"filters.txt",
"optional_filters.txt",
"providers.json",
]


Expand Down