Skip to content

Commit

Permalink
Maintenance: upgrades requirements of packages and web-server (#1696)
Browse files Browse the repository at this point in the history
* Adds info con constraint for isort

* Block upgrade of package and test reqs

* Upgrades deprecated positional argument

Fixes pytest.PytestDeprecationWarning: Passing arguments to pytest.fixture() as positional arguments is deprecated - pass them as a keyword argument instead

* Upgrade to latest pip 20.2.2

* No need for code coverage while testing api specs

* upgrades webserver

* Adds ERD for all pg models

* Adds check to avoid wrong py version

* Fixes reqs after master merge

* Fixes undefined variables

Raised UnboundLocalError: local variable 'log_type' referenced before assignment
  • Loading branch information
pcrespov authored Aug 17, 2020
1 parent 39447f8 commit 5794a0e
Show file tree
Hide file tree
Showing 36 changed files with 862 additions and 181 deletions.
2 changes: 1 addition & 1 deletion api/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def api_specs_info(api_specs_dir):
return info


@pytest.fixture("session")
@pytest.fixture(scope="session")
def all_api_specs_tails(api_specs_dir):
""" Returns openapi/jsonschema spec files path relative to specs_dir
Expand Down
23 changes: 12 additions & 11 deletions api/tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,38 @@ aiohttp==3.6.2 # via -r requirements.in, pytest-aiohttp
async-timeout==3.0.1 # via aiohttp
attrs==19.3.0 # via aiohttp, jsonschema, openapi-core, pytest
chardet==3.0.4 # via aiohttp
coverage==5.2 # via -r requirements.in, pytest-cov
coverage==5.2.1 # via -r requirements.in, pytest-cov
idna-ssl==1.1.0 # via aiohttp
idna==2.10 # via idna-ssl, yarl
importlib-metadata==1.7.0 # via jsonschema, pluggy, pytest
isodate==0.6.0 # via openapi-schema-validator
iniconfig==1.0.1 # via pytest
isodate==0.6.0 # via openapi-core, openapi-schema-validator
jsonschema==3.2.0 # via openapi-schema-validator, openapi-spec-validator
lazy-object-proxy==1.5.0 # via openapi-core
lazy-object-proxy==1.5.1 # via openapi-core
more-itertools==8.4.0 # via openapi-core, pytest
multidict==4.7.6 # via aiohttp, yarl
openapi-core==0.13.3 # via -r requirements.in
openapi-core==0.13.4 # via -r requirements.in
openapi-schema-validator==0.1.1 # via openapi-core
openapi-spec-validator==0.2.8 # via openapi-core
openapi-spec-validator==0.2.9 # via openapi-core
packaging==20.4 # via pytest, pytest-sugar
parse==1.15.0 # via openapi-core
parse==1.16.0 # via openapi-core
pluggy==0.13.1 # via pytest
py==1.9.0 # via pytest
pyparsing==2.4.7 # via packaging
pyrsistent==0.16.0 # via jsonschema
pytest-aiohttp==0.3.0 # via -r requirements.in
pytest-cov==2.10.0 # via -r requirements.in
pytest-cov==2.10.1 # via -r requirements.in
pytest-instafail==0.4.2 # via -r requirements.in
pytest-sugar==0.9.4 # via -r requirements.in
pytest==5.4.3 # via -r requirements.in, pytest-aiohttp, pytest-cov, pytest-instafail, pytest-sugar
pytest==6.0.1 # via -r requirements.in, pytest-aiohttp, pytest-cov, pytest-instafail, pytest-sugar
pyyaml==5.3.1 # via openapi-spec-validator
six==1.15.0 # via isodate, jsonschema, openapi-core, openapi-schema-validator, openapi-spec-validator, packaging
strict-rfc3339==0.7 # via openapi-schema-validator
termcolor==1.1.0 # via pytest-sugar
typing-extensions==3.7.4.2 # via aiohttp
wcwidth==0.2.5 # via pytest
toml==0.10.1 # via pytest
typing-extensions==3.7.4.2 # via aiohttp, yarl
werkzeug==1.0.1 # via openapi-core
yarl==1.4.2 # via aiohttp
yarl==1.5.1 # via aiohttp
zipp==3.1.0 # via importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
Expand Down
2 changes: 1 addition & 1 deletion api/tests/test_individual_openapi_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def change_references_to_schemas(filepath: Path, specs: dict):
specs[key] = file_ref + "#" + section_ref


@pytest.fixture("session")
@pytest.fixture(scope="session")
def converted_specs_testdir(api_specs_dir, all_api_specs_tails, tmpdir_factory):
"""
- All api_specs files are copied into tmpdir
Expand Down
3 changes: 1 addition & 2 deletions ci/github/unit-testing/api.bash
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ install() {
}

test() {
pytest --cov=api --durations=10 --cov-append \
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
pytest --durations=10 \
-v -m "not travis" api/tests
}

Expand Down
2 changes: 1 addition & 1 deletion ci/helpers/ensure_python_pip.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set -euo pipefail
IFS=$'\n\t'

# Pin pip version to a compatible release https://www.python.org/dev/peps/pep-0440/#compatible-release
PIP_VERSION=20.1.1
PIP_VERSION=20.2.2

echo "INFO:" "$(python --version)" "@" "$(command -v python)"

Expand Down
3 changes: 1 addition & 2 deletions ci/travis/unit-testing/api.bash
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ before_script() {
script() {
if bash ci/travis/helpers/test-for-changes.bash "${FOLDER_CHECKS[@]}";
then
pytest --cov=api --durations=10 --cov-append \
--color=yes --cov-report=term-missing --cov-report=xml --cov-config=.coveragerc \
pytest --durations=10 \
-v -m "not travis" api/tests
else
echo "No changes detected. Skipping unit-testing of apihub."
Expand Down
20 changes: 20 additions & 0 deletions packages/postgres-database/doc/database-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,23 @@

- Isolate package with all table schemas per database and service
- Models shall not be implemented inheriting from Base. Use instead [explicit table definitions](https://docs.sqlalchemy.org/en/latest/orm/mapping_styles.html#classical-mappings)

## Entity Relationship Diagram (ERD)

Current models in ``simcore-postgres-database``:

![scripts/create_erd.py-output](img/postgres-database-models.svg)

To produce the diagram above

```bash
make devenv
source .venv/bin/activate

cd packages/postgres-database
make install-dev

cd scripts
pip install eralchemy
python create_erd.py
```
Loading

0 comments on commit 5794a0e

Please sign in to comment.