-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
bandit
, pylint
, safety
, mypy
, and pyproject.toml
- coll…
…ection factory (#119) Add/remove pre-commit hooks: Remove: `flake8` Add: `bandit`, `pylint`, `mypy`, `pytest-plugins` (local) Update `black` hook to the latest version. Run and satisfy the new tools. Use `typing.TYPE_CHECKING` throughout. Since FastAPI depends on pydantic and relies on the type definitions to function, the routers cannot use `TYPE_CHECKING`. However, it is used to the extent it can be done. Create a factory for entry-endpoint resource collections. In order to avoid cyclic imports and clean up the code, an entry-endpoint resource collection factory has been implemented. It updates a global dictionary, where the key is the MongoDB collection name configured and retrieved from `CONFIG`. The value is then an asynchronous MongoDB collection similar to the `MongoCollection` class in OPTIMADE Python tools. With this, the `*_COLLECTIONS` can be removed throughout as well. Add new CI job for `pylint` and `safety`. `pylint` relies on having access to imported packages. It is therefore skipped in the `pre-commit` job and given its own. Make sure to import types for building docs. This is done by setting the environment variable `MKDOCS_BUILD` when building the docs. It is discarded after the build. Don't use doc-strings through from `optimade`: There was an issue with this, where a local API reference was made, which couldn't be resolved when building these docs. Use `pyproject.toml` throughout (remove `setup.cfg`). Add `invoke` task to update pytest config plugins. The task updates the `required_plugins` config option for `pytest` with the versions specified in `requirements_dev.txt`. It is implemented as a `pre-commit` hook as well with the id `pytest-plugins`.
- Loading branch information
Showing
52 changed files
with
1,259 additions
and
687 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
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,14 @@ | ||
logs/ | ||
# Tools | ||
.coverage | ||
htmlcov/ | ||
.mypy* | ||
.pytest* | ||
|
||
# Python | ||
*.egg* | ||
|
||
# Application | ||
logs/ | ||
|
||
# Documentation | ||
site/ |
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
This file was deleted.
Oops, something went wrong.
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
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
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,3 +1,4 @@ | ||
"""Specific OPTIMADE Gateway Python exceptions.""" | ||
__all__ = ("OptimadeGatewayError",) | ||
|
||
|
||
|
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
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.