Skip to content

Commit

Permalink
Merge branch 'master' into ml-evs/demote_fastapi
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Aug 26, 2022
2 parents 7e836d0 + 88860c4 commit b6bdbb2
Show file tree
Hide file tree
Showing 68 changed files with 1,037 additions and 563 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cd_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
fetch-depth: 0

- name: Set up Python 3.8
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: 3.8

Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
ref: ${{ env.PUBLISH_UPDATE_BRANCH }}

- name: Set up Python 3.8
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: 3.8

Expand Down
56 changes: 24 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up Python 3.8
uses: actions/setup-python@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'

- name: Install dependencies
run: |
Expand All @@ -46,10 +46,10 @@ jobs:
with:
submodules: true

- name: Set up Python 3.8
uses: actions/setup-python@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'

- name: Install dependencies
run: |
Expand All @@ -71,10 +71,10 @@ jobs:
with:
submodules: true

- name: Set up Python 3.8
uses: actions/setup-python@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'

- name: Install tools
run: |
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
fail-fast: false
max-parallel: 4
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10']

services:
mongo:
Expand All @@ -162,12 +162,13 @@ jobs:
ports:
- 5432:5432
elasticsearch:
image: elasticsearch:6.8.23
image: elasticsearch:7.17.1
ports:
- 9200:9200
- 9300:9300
env:
discovery.type: single-node
xpack.security.enabled: 'false'


steps:
Expand All @@ -177,7 +178,7 @@ jobs:
fetch-depth: 2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -210,16 +211,7 @@ jobs:
run: |
pip install -r requirements-client.txt
- name: Setup environment for AiiDA v1 (Python 3.7)
if: matrix.python-version == 3.7
env:
AIIDA_TEST_BACKEND: django
run: |
reentry scan
.github/aiida/setup_aiida.sh
- name: Setup environment for AiiDA v2 (Python 3.8+)
if: matrix.python-version != 3.7
- name: Setup environment for AiiDA
env:
AIIDA_TEST_BACKEND: psql_dos
run: |
Expand All @@ -229,20 +221,20 @@ jobs:
run: pytest -rs -vvv --cov=./optimade/ --cov-report=xml --cov-append tests/adapters/

- name: Run tests for validator only to assess coverage (mongomock)
if: matrix.python-version == 3.8
if: matrix.python-version == 3.10
run: pytest -rs --cov=./optimade/ --cov-report=xml:validator_cov.xml --cov-append tests/server/test_server_validation.py
env:
OPTIMADE_DATABASE_BACKEND: 'mongomock'

- name: Run tests for validator only to assess coverage (Elasticsearch)
if: matrix.python-version == 3.8
if: matrix.python-version == 3.10
run: pytest -rs --cov=./optimade/ --cov-report=xml:validator_cov.xml --cov-append tests/server/test_server_validation.py
env:
OPTIMADE_DATABASE_BACKEND: 'elastic'
OPTIMADE_INSERT_TEST_DATA: false # Must be specified as previous steps will have already inserted the test data

- name: Run tests for validator only to assess coverage (MongoDB)
if: matrix.python-version == 3.8
if: matrix.python-version == 3.10
run: pytest -rs --cov=./optimade/ --cov-report=xml:validator_cov.xml --cov-append tests/server/test_server_validation.py
env:
OPTIMADE_DATABASE_BACKEND: 'mongodb'
Expand Down Expand Up @@ -277,15 +269,15 @@ jobs:
coverage xml
- name: Upload coverage to Codecov
if: matrix.python-version == 3.8 && github.repository == 'Materials-Consortia/optimade-python-tools'
if: matrix.python-version == '3.10' && github.repository == 'Materials-Consortia/optimade-python-tools'
uses: codecov/codecov-action@v3
with:
name: project
file: ./coverage.xml
flags: project

- name: Upload validator coverage to Codecov
if: matrix.python-version == 3.8 && github.repository == 'Materials-Consortia/optimade-python-tools'
if: matrix.python-version == '3.10' && github.repository == 'Materials-Consortia/optimade-python-tools'
uses: codecov/codecov-action@v3
with:
name: validator
Expand All @@ -300,9 +292,9 @@ jobs:
with:
submodules: true

- uses: actions/setup-python@v3
- uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'

- name: Install dependencies
run: |
Expand All @@ -328,10 +320,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python 3.8
uses: actions/setup-python@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'

- name: Install Python dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_cd_updated_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

- name: Set up Python 3.8
if: env.RELEASE_RUN == 'false'
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: 3.8

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
ref: ${{ env.DEFAULT_REPO_BRANCH }}

- name: Set up Python 3.8
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: 3.8

Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
- name: Fetch PR body
id: pr_body
uses: chuhlomin/render-template@v1.4
uses: chuhlomin/render-template@v1.5
with:
template: .github/utils/single_dependency_pr_body.txt

Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ default_language_version:

repos:
- repo: https://github.com/ambv/black
rev: 22.3.0
rev: 22.6.0
hooks:
- id: black
name: Blacken

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.3.0
hooks:
- id: check-symlinks
- id: check-yaml
Expand Down
18 changes: 0 additions & 18 deletions .readthedocs.yml

This file was deleted.

80 changes: 80 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,89 @@
# Changelog

## [v0.19.1](https://github.com/Materials-Consortia/optimade-python-tools/tree/v0.19.1) (2022-08-08)

[Full Changelog](https://github.com/Materials-Consortia/optimade-python-tools/compare/v0.19.0...v0.19.1)

**Implemented enhancements:**

- Add `from_pymatgen` structure adapter method and concept of ingesters [\#1296](https://github.com/Materials-Consortia/optimade-python-tools/pull/1296) ([ml-evs](https://github.com/ml-evs))
- Add `lru_cache` to many mapper properties [\#1245](https://github.com/Materials-Consortia/optimade-python-tools/pull/1245) ([ml-evs](https://github.com/ml-evs))

**Merged pull requests:**

- Use animated SVG logo for optimade-python-tools landing page [\#1297](https://github.com/Materials-Consortia/optimade-python-tools/pull/1297) ([ml-evs](https://github.com/ml-evs))

## [v0.19.0](https://github.com/Materials-Consortia/optimade-python-tools/tree/v0.19.0) (2022-07-18)

[Full Changelog](https://github.com/Materials-Consortia/optimade-python-tools/compare/v0.18.0...v0.19.0)

This minor release includes several usability improvements for the server and client arising from the OPTIMADE workshop.
This release also drops support for Python 3.7, which should allow us to streamline our dependencies going forward.

**Implemented enhancements:**

- Support for Elasticsearch v7 [\#1216](https://github.com/Materials-Consortia/optimade-python-tools/pull/1216) ([markus1978](https://github.com/markus1978))

**Fixed bugs:**

- Landing page not loading [\#1256](https://github.com/Materials-Consortia/optimade-python-tools/issues/1256)
- Config values are not cached by `@classproperty` [\#1219](https://github.com/Materials-Consortia/optimade-python-tools/issues/1219)
- Prevent internal validator errors when entries are missing ID/type [\#1273](https://github.com/Materials-Consortia/optimade-python-tools/pull/1273) ([ml-evs](https://github.com/ml-evs))
- Improve error handling for client when updating provider list [\#1222](https://github.com/Materials-Consortia/optimade-python-tools/pull/1222) ([ml-evs](https://github.com/ml-evs))

**Closed issues:**

- Internal validator failures [\#1272](https://github.com/Materials-Consortia/optimade-python-tools/issues/1272)
- Use versioned Dockerfiles for CI services to allow dependabot to update them [\#1241](https://github.com/Materials-Consortia/optimade-python-tools/issues/1241)
- Wrong links to available endpoints [\#1214](https://github.com/Materials-Consortia/optimade-python-tools/issues/1214)
- The validator should check for `meta->schema` [\#1209](https://github.com/Materials-Consortia/optimade-python-tools/issues/1209)
- Add configurable `meta->schemas` field to reference server [\#1208](https://github.com/Materials-Consortia/optimade-python-tools/issues/1208)

**Merged pull requests:**

- Bump providers from `fb05359` to `a92e5bc` [\#1267](https://github.com/Materials-Consortia/optimade-python-tools/pull/1267) ([dependabot[bot]](https://github.com/apps/dependabot))
- Add schema parameter when calling meta\_values in landing.py [\#1257](https://github.com/Materials-Consortia/optimade-python-tools/pull/1257) ([JPBergsma](https://github.com/JPBergsma))
- Update `lark` dependency to new name [\#1231](https://github.com/Materials-Consortia/optimade-python-tools/pull/1231) ([ml-evs](https://github.com/ml-evs))
- Use Python 3.10 instead of 3.7 in installation instructions [\#1229](https://github.com/Materials-Consortia/optimade-python-tools/pull/1229) ([JPBergsma](https://github.com/JPBergsma))
- Optimisation: do not re-access mapper properties inside the request loop [\#1223](https://github.com/Materials-Consortia/optimade-python-tools/pull/1223) ([ml-evs](https://github.com/ml-evs))
- Add meta-\>schema validation warning [\#1211](https://github.com/Materials-Consortia/optimade-python-tools/pull/1211) ([ml-evs](https://github.com/ml-evs))
- Add configurable `schema_url` and `index_schema_url` options [\#1210](https://github.com/Materials-Consortia/optimade-python-tools/pull/1210) ([ml-evs](https://github.com/ml-evs))
- Drop support for Python 3.7 [\#1179](https://github.com/Materials-Consortia/optimade-python-tools/pull/1179) ([ml-evs](https://github.com/ml-evs))

## [v0.18.0](https://github.com/Materials-Consortia/optimade-python-tools/tree/v0.18.0) (2022-05-29)

[Full Changelog](https://github.com/Materials-Consortia/optimade-python-tools/compare/v0.17.2...v0.18.0)

This is a feature release that includes the new `optimade.client.OptimadeClient` class, a client capable asynchronously querying multiple OPTIMADE APIs simultaneously.
It also contains a patch for the OPTIMADE models that allows them to be used with more recent FastAPI versions without breaking OpenAPI 3.0 compatibility.
Other changes can be found below.
This release includes improvements to the validator to catch more cases where OPTIMADE APIs are only partially implemented.
Previously, APIs that did not support filtering, pagination or limiting response fields at all (i.e., the query parameter is simply ignored) would pass most validation tests erroneously in some unlucky situations (#1180).

**Implemented enhancements:**

- The validator should use a custom `User-Agent` header [\#1187](https://github.com/Materials-Consortia/optimade-python-tools/issues/1187)
- Suggestion to include an OPTIMADE python API client [\#932](https://github.com/Materials-Consortia/optimade-python-tools/issues/932)
- Implementation of an OPTIMADE client [\#1154](https://github.com/Materials-Consortia/optimade-python-tools/pull/1154) ([ml-evs](https://github.com/ml-evs))

**Fixed bugs:**

- `OptimadeClient` crashes if an index meta-database is down [\#1196](https://github.com/Materials-Consortia/optimade-python-tools/issues/1196)
- Catch connection errors when populating client database list [\#1197](https://github.com/Materials-Consortia/optimade-python-tools/pull/1197) ([ml-evs](https://github.com/ml-evs))

**Merged pull requests:**

- Add a clearer error message on when trying to use client with missing deps [\#1200](https://github.com/Materials-Consortia/optimade-python-tools/pull/1200) ([ml-evs](https://github.com/ml-evs))
- Use a custom `User-Agent` with validator [\#1189](https://github.com/Materials-Consortia/optimade-python-tools/pull/1189) ([ml-evs](https://github.com/ml-evs))
- Syntactic tweaks to models and schemas for compatibility with `fastapi>0.66` [\#1131](https://github.com/Materials-Consortia/optimade-python-tools/pull/1131) ([ml-evs](https://github.com/ml-evs))

## [v0.17.2](https://github.com/Materials-Consortia/optimade-python-tools/tree/v0.17.2) (2022-05-21)

[Full Changelog](https://github.com/Materials-Consortia/optimade-python-tools/compare/v0.17.1...v0.17.2)

This release includes improvements to the validator to catch more cases where OPTIMADE APIs are only partially implemented.
Previously, APIs that did not support filtering, pagination or limiting response fields at all (i.e., the query parameter is simply ignored) would pass most validation tests erroneously in some unlucky situations (#1180).

**Fixed bugs:**

- Server validation incorrectly passes with various unimplemented features [\#1180](https://github.com/Materials-Consortia/optimade-python-tools/issues/1180)
Expand Down
6 changes: 3 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ All contributed Python code, must use the [black](https://github.com/ambv/black)
git clone --recursive git@github.com:Materials-Consortia/optimade-python-tools.git
cd optimade-python-tools

# Ensure a Python>=3.7 (virtual) environment (example below using Anaconda/Miniconda)
conda create -n optimade python=3.7
# Ensure a Python>=3.8 (virtual) environment (example below using Anaconda/Miniconda)
conda create -n optimade python=3.10
conda activate optimade

# Install package and dependencies in editable mode (including "dev" requirements).
Expand Down Expand Up @@ -101,7 +101,7 @@ These commands should be run from a local optimade-python-tools directory.
The following command starts a local Elasticsearch v6 instance, runs the test suite, then stops and deletes the containers (required as the tests insert some data):

```shell
docker run -d --name elasticsearch_test -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:6.8.23 \
docker run -d --name elasticsearch_test -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e "xpack.security.enabled=false" elasticsearch:7.17.1 \
&& sleep 10 \
&& OPTIMADE_DATABASE_BACKEND="elastic" py.test; \
docker container stop elasticsearch_test; docker container rm elasticsearch_test
Expand Down
2 changes: 1 addition & 1 deletion docs/api_reference/models/baseinfo.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# baseinfo

::: optimade.models.baseinfo
rendering:
options:
show_if_no_docstring: true
2 changes: 1 addition & 1 deletion docs/api_reference/models/entries.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# entries

::: optimade.models.entries
rendering:
options:
show_if_no_docstring: true
2 changes: 1 addition & 1 deletion docs/api_reference/models/index_metadb.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# index_metadb

::: optimade.models.index_metadb
rendering:
options:
show_if_no_docstring: true
2 changes: 1 addition & 1 deletion docs/api_reference/models/jsonapi.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# jsonapi

::: optimade.models.jsonapi
rendering:
options:
show_if_no_docstring: true
2 changes: 1 addition & 1 deletion docs/api_reference/models/links.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# links

::: optimade.models.links
rendering:
options:
show_if_no_docstring: true
2 changes: 1 addition & 1 deletion docs/api_reference/models/optimade_json.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# optimade_json

::: optimade.models.optimade_json
rendering:
options:
show_if_no_docstring: true
2 changes: 1 addition & 1 deletion docs/api_reference/models/references.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# references

::: optimade.models.references
rendering:
options:
show_if_no_docstring: true

0 comments on commit b6bdbb2

Please sign in to comment.