diff --git a/.github/workflows/ci-checks.yml b/.github/workflows/ci-checks.yml index c9918f2..c2dfafd 100644 --- a/.github/workflows/ci-checks.yml +++ b/.github/workflows/ci-checks.yml @@ -10,17 +10,17 @@ jobs: black: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: psf/black@stable pylint: runs-on: ubuntu-latest name: "pylint" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: "Set up Python 3" - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: '3.11' - name: "Install dependencies" run: | pip install --upgrade pip @@ -34,11 +34,11 @@ jobs: runs-on: ubuntu-latest name: "flake8" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: "Set up Python 3" - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: '3.11' - name: "Install dependencies" run: "pip install flake8" - name: "Run flake8!" @@ -52,11 +52,11 @@ jobs: with: username: ${{ secrets.TEST_DOCKER_USERNAME }} password: ${{ secrets.TEST_DOCKER_PASSWORD }} - - uses: actions/checkout@v2 - - name: "Set up Python 3.8" - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - name: "Set up Python 3.11" + uses: actions/setup-python@v4 with: - python-version: "3.8" + python-version: "3.11" - name: "Install dependencies" run: | pip install --upgrade pip @@ -79,16 +79,16 @@ jobs: needs: [black, pylint, flake8, pytest-manager] strategy: matrix: - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: [3.6, 3.7, 3.8, 3.9, 3.11] steps: - name: Login to Docker Hub uses: docker/login-action@v1 with: username: ${{ secrets.TEST_DOCKER_USERNAME }} password: ${{ secrets.TEST_DOCKER_PASSWORD }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: "Set up Python ${{ matrix.python-version }}" - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: "${{ matrix.python-version }}" - name: "Install dependencies" @@ -114,11 +114,11 @@ jobs: runs-on: ubuntu-latest needs: [pytest-sdk] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: "Set up Python 3" - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: '3.11' - name: "Install dependencies" run: | pip install --upgrade pip diff --git a/.github/workflows/docker_image_release.yml b/.github/workflows/docker_image_release.yml index 52853d4..5ae1968 100644 --- a/.github/workflows/docker_image_release.yml +++ b/.github/workflows/docker_image_release.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Login to DockerHub uses: docker/login-action@v1 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index f67a9c9..1d03f7c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -11,11 +11,11 @@ jobs: name: Build and push docs to GH pages runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - name: "Set up Python 3" - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.x' - name: "Install dependencies" diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 7915032..09bdbd0 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -9,7 +9,7 @@ jobs: name: Push examples to another repository runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Copy start_manager script to examples directory run: | cp start_manager examples/start_manager diff --git a/.github/workflows/provision.yml b/.github/workflows/provision.yml index 25d221c..786a7d0 100644 --- a/.github/workflows/provision.yml +++ b/.github/workflows/provision.yml @@ -33,7 +33,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Copy BASH script via ssh uses: appleboy/scp-action@master diff --git a/.github/workflows/pypi-upload.yml b/.github/workflows/pypi-upload.yml index a38096e..843e29b 100644 --- a/.github/workflows/pypi-upload.yml +++ b/.github/workflows/pypi-upload.yml @@ -10,9 +10,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.x' - name: Install dependencies diff --git a/daeploy/_service/service.py b/daeploy/_service/service.py index 19d2a7f..d71c0d2 100644 --- a/daeploy/_service/service.py +++ b/daeploy/_service/service.py @@ -276,7 +276,6 @@ def timed_task_decorator(func: Callable) -> Callable: is_coroutine = asyncio.iscoroutinefunction(func) async def timer(): - # Sleep before first call if required if wait_first: await asyncio.sleep(seconds) diff --git a/examples/status_code_example/service.py b/examples/status_code_example/service.py index ba895ad..0acc343 100644 --- a/examples/status_code_example/service.py +++ b/examples/status_code_example/service.py @@ -10,7 +10,6 @@ @service.entrypoint(status_code=201) def create_new_dict(dict_name: str, content: dict): - if STORAGE_DICTS.get(dict_name, False): raise HTTPException(status_code=409, detail=f"{dict_name} already exists") diff --git a/manager/routers/dashboard_api.py b/manager/routers/dashboard_api.py index 8cc6982..cb6c822 100644 --- a/manager/routers/dashboard_api.py +++ b/manager/routers/dashboard_api.py @@ -117,7 +117,6 @@ def build_tabs(): ) # pylint: disable=unused-argument def update_content(tab_switch, interval, n_clicks): - # Clearing notifications changed_id = [p["prop_id"] for p in dash.callback_context.triggered][0] if "clear-notifications-button" in changed_id: diff --git a/manager/routers/service_api.py b/manager/routers/service_api.py index 35a059e..92957b2 100644 --- a/manager/routers/service_api.py +++ b/manager/routers/service_api.py @@ -310,7 +310,6 @@ def kill_service(service: BaseService, remove_image: bool = True): @ROUTER.put("/~assign") @check_service_exists_json_body def assign_main_service(service: BaseService): - try: service_db.assign_main_version(service.name, service.version) except DatabaseNoMatchException as exc: diff --git a/requirements_manager.txt b/requirements_manager.txt index d1b47a4..110c584 100644 --- a/requirements_manager.txt +++ b/requirements_manager.txt @@ -1,14 +1,14 @@ -fastapi==0.78.0 -uvicorn==0.16.0 +fastapi==0.109.0 +uvicorn==0.26.0 docker==5.0.3 aiodocker==0.21.0 semver==2.13.0 python-multipart==0.0.5 toml==0.10.2 -sqlalchemy==1.3.22 +sqlalchemy==2.0.25 dash==2.4.1 -pyjwt==2.4.0 -bcrypt==3.2.0 -jinja2==3.0.3 -cookiecutter==1.7.3 -cryptography==3.3.2 +pyjwt==2.8.0 +bcrypt==4.1.2 +jinja2==3.1.3 +cookiecutter==2.5.0 +cryptography==41.0.7 diff --git a/requirements_sdk.txt b/requirements_sdk.txt index 4ffd8b0..3e0297b 100644 --- a/requirements_sdk.txt +++ b/requirements_sdk.txt @@ -11,4 +11,5 @@ sqlalchemy aiofiles pytest pandas -docker \ No newline at end of file +docker +ipython \ No newline at end of file diff --git a/tests/e2e_test/e2e_test.py b/tests/e2e_test/e2e_test.py index bebb0b6..304e1fa 100644 --- a/tests/e2e_test/e2e_test.py +++ b/tests/e2e_test/e2e_test.py @@ -189,7 +189,6 @@ def test_version_command_cli(dummy_manager, cli_auth_login): def test_manager_restart_ok(dummy_manager, headers): - assert requests.get("http://localhost", headers=headers).status_code == 200 dummy_manager.restart() diff --git a/tests/manager_test/auth_test.py b/tests/manager_test/auth_test.py index 13c3e7a..7998c15 100644 --- a/tests/manager_test/auth_test.py +++ b/tests/manager_test/auth_test.py @@ -32,13 +32,11 @@ def test_login_page(exclude_middleware): def test_verification_without_auth(database): - response = client.get("/auth/verify", allow_redirects=False) assert response.status_code == 200 def test_failed_login(database, auth_enabled): - # Login response = client.post( "/auth/login", @@ -53,7 +51,6 @@ def test_failed_login(database, auth_enabled): def test_cookie_token(database, auth_enabled): - # No access from beginning response = client.get("/auth/verify", allow_redirects=False) assert response.status_code == 303 @@ -80,7 +77,6 @@ def test_cookie_token(database, auth_enabled): def test_API_token(clear_cookies, database, auth_enabled): - # No access from beginning response = client.get( "/auth/verify", diff --git a/tests/manager_test/endpoint_test.py b/tests/manager_test/endpoint_test.py index 4098bcb..e95cc54 100644 --- a/tests/manager_test/endpoint_test.py +++ b/tests/manager_test/endpoint_test.py @@ -496,7 +496,6 @@ async def test_service_logs_no_streaming( f"/services/~logs?name={service_name}&version={service_version}&follow=False", stream=False, ) as response: - assert response.status_code == 200 assert response.text == "Log1 Log2 Log3 " mocked_docker_connection.service_logs.assert_called_with( diff --git a/tests/manager_test/local_docker_connection_test.py b/tests/manager_test/local_docker_connection_test.py index 98791e3..3300735 100644 --- a/tests/manager_test/local_docker_connection_test.py +++ b/tests/manager_test/local_docker_connection_test.py @@ -38,7 +38,6 @@ def local_docker_connection(): def test_starting_new_service(local_docker_connection): - url = local_docker_connection.create_service( image="traefik/whoami:latest", name="test", @@ -56,7 +55,6 @@ def test_starting_new_service(local_docker_connection): def test_start_image_service_with_run_args(local_docker_connection): - local_docker_connection.create_service( image="traefik/whoami:latest", name="test", @@ -85,7 +83,6 @@ def test_start_image_service_with_run_args(local_docker_connection): def test_starting_two_service_different_version(local_docker_connection): - first_url = local_docker_connection.create_service( image="traefik/whoami:latest", name="test", @@ -162,7 +159,6 @@ def test_with_failing_services_port_allocation(local_docker_connection): def test_with_failing_services_restart(local_docker_connection): - client = docker.from_env() local_docker_connection.create_service( @@ -196,7 +192,6 @@ def test_with_failing_services_restart(local_docker_connection): @pytest.mark.asyncio async def test_service_logs(local_docker_connection): - local_docker_connection.create_service( image="traefik/whoami:latest", name="test", diff --git a/tests/sdk_test/daeploy_test.py b/tests/sdk_test/daeploy_test.py index d16c186..e71b36f 100644 --- a/tests/sdk_test/daeploy_test.py +++ b/tests/sdk_test/daeploy_test.py @@ -224,7 +224,6 @@ def test_get_paramter_by_api(): service.add_parameter("myparameter", 10) with TestClient(service.app) as client: - response = client.get( "/~parameters/myparameter", headers={"accept": "application/json"} ) @@ -256,7 +255,6 @@ def test_update_parameter(): service.add_parameter("myparameter", 10) with TestClient(service.app) as client: - req = {"value": 1000} response = client.post( @@ -271,7 +269,6 @@ def test_internal_parameter(): service.add_parameter("myparameter", 10, expose=False) with TestClient(service.app) as client: - req = {"value": 1000} response = client.post( @@ -287,7 +284,6 @@ def test_set_parameter(): service.set_parameter("myparameter", 20) with TestClient(service.app) as client: - response = client.get( "/~parameters/myparameter", headers={"accept": "application/json"} ) @@ -677,7 +673,6 @@ def long_running_func(): def test_database_table_creation(database): - timestamp = datetime.datetime.utcnow() db.write_to_ts("float", 1.0, timestamp) db.write_to_ts("text", "1", timestamp) @@ -694,7 +689,6 @@ def test_database_table_creation(database): def test_jsonable_type_db(database): - timestamp = datetime.datetime.utcnow() db.write_to_ts("dict", {"a": 4}, timestamp) await_database_queue() @@ -703,7 +697,6 @@ def test_jsonable_type_db(database): def test_continuous_storing_of_and_reading_of_variables(database): - for i in range(200): timestamp = datetime.datetime.utcnow() db.write_to_ts("float", float(i), timestamp) @@ -735,7 +728,6 @@ def test_edge_case_type_storing(database): def test_read_timerange(database): - before = datetime.datetime.utcnow() mid = None