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

Move CICD from Travis to Github Actions #1367

Merged
merged 5 commits into from
Jun 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI/CD pipeline
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pip
pip install tox tox-gh-actions setuptools coveralls
Comment on lines +21 to +22
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think would be nice if we considered to pin those versions. Those packages may release major versions with breaking changes that can break Connexion CI/CD pipeline in an unfortunate moment. I know we have more maintainers now, but if we have multiple PRs, we need to coordinate with external contributors to ask them to rebase their PRs or commit to each PR to fix the pipeline. It might be wise to just pin the versions here and avoid the headache. We can still update the versions whenever we need, of course.

- name: Test with tox
run: tox
- name: Coveralls
run: coveralls --service github
env:
COVERALLS_PARALLEL: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: test-${{ matrix.python-version }}

finish-coveralls:
needs: test
runs-on: ubuntu-latest
steps:
- name: Install coveralls
run: pip install coveralls
- name: Coveralls Finished
run: coveralls --service github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Connexion
:alt: Join the chat at https://gitter.im/zalando/connexion
:target: https://gitter.im/zalando/connexion?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge

.. image:: https://travis-ci.org/zalando/connexion.svg?branch=master
:target: https://travis-ci.org/zalando/connexion
:alt: Travis CI build status
.. image:: https://github.com/zalando/connexion/actions/workflows/pipeline.yml/badge.svg
:alt: Build status
:target: https://github.com/zalando/connexion/actions/workflows/pipeline.yml

.. image:: https://coveralls.io/repos/zalando/connexion/badge.svg?branch=master
:target: https://coveralls.io/r/zalando/connexion?branch=master
Expand Down
3 changes: 2 additions & 1 deletion connexion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ def _required_lib(exc, *args, **kwargs):


try:
from flask import request # NOQA

from .apis.flask_api import FlaskApi, context # NOQA
from .apps.flask_app import FlaskApp
from flask import request # NOQA
except ImportError as e: # pragma: no cover
_flask_not_installed_error = not_installed_error(e)
FlaskApi = _flask_not_installed_error
Expand Down
6 changes: 3 additions & 3 deletions connexion/apis/aiohttp_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
from aiohttp import web
from aiohttp.web_exceptions import HTTPNotFound, HTTPPermanentRedirect
from aiohttp.web_middlewares import normalize_path_middleware
from werkzeug.exceptions import HTTPException as werkzeug_HTTPException

from connexion.apis.abstract import AbstractAPI
from connexion.exceptions import ProblemException
from connexion.handlers import AuthErrorHandler
from connexion.jsonifier import JSONEncoder, Jsonifier
from connexion.lifecycle import ConnexionRequest, ConnexionResponse
from connexion.problem import problem
from connexion.utils import yamldumper
from connexion.security import AioHttpSecurityHandlerFactory
from werkzeug.exceptions import HTTPException as werkzeug_HTTPException

from connexion.utils import yamldumper

logger = logging.getLogger('connexion.apis.aiohttp_api')

Expand Down
5 changes: 3 additions & 2 deletions connexion/apis/flask_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@

import flask
import werkzeug.exceptions
from werkzeug.local import LocalProxy

from connexion.apis import flask_utils
from connexion.apis.abstract import AbstractAPI
from connexion.handlers import AuthErrorHandler
from connexion.jsonifier import Jsonifier
from connexion.lifecycle import ConnexionRequest, ConnexionResponse
from connexion.utils import is_json_mimetype, yamldumper
from connexion.security import FlaskSecurityHandlerFactory
from werkzeug.local import LocalProxy
from connexion.utils import is_json_mimetype, yamldumper

logger = logging.getLogger('connexion.apis.flask_api')

Expand Down
2 changes: 1 addition & 1 deletion connexion/apps/flask_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ def run(self, port=None, server=None, debug=None, host=None, **options): # prag
self.app.run(self.host, port=self.port, debug=self.debug, **options)
elif self.server == 'tornado':
try:
import tornado.wsgi
import tornado.httpserver
import tornado.ioloop
import tornado.wsgi
except ImportError:
raise Exception('tornado library not installed')
wsgi_container = tornado.wsgi.WSGIContainer(self.app)
Expand Down
3 changes: 2 additions & 1 deletion connexion/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
from os import path

import click
import connexion
from clickclick import AliasedGroup, fatal_error

import connexion
from connexion.mock import MockResolver

logger = logging.getLogger('connexion.cli')
Expand Down
2 changes: 2 additions & 0 deletions connexion/decorators/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import time

from werkzeug.exceptions import HTTPException

from connexion.exceptions import ProblemException

try:
import uwsgi_metrics
HAS_UWSGI_METRICS = True # pragma: no cover
Expand Down
4 changes: 2 additions & 2 deletions connexion/decorators/uri_parsing.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Decorators to split query and path parameters
import abc
import functools
import json
import logging
import re
import json
from .. import utils

from .. import utils
from .decorator import BaseDecorator

logger = logging.getLogger('connexion.decorators.uri_parsing')
Expand Down
3 changes: 2 additions & 1 deletion connexion/decorators/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
from jsonschema.validators import extend
from werkzeug.datastructures import FileStorage

from ..exceptions import ExtraParameterProblem, BadRequestProblem, UnsupportedMediaTypeProblem
from ..exceptions import (BadRequestProblem, ExtraParameterProblem,
UnsupportedMediaTypeProblem)
from ..http_facts import FORM_CONTENT_TYPES
from ..json_schema import Draft4RequestValidator, Draft4ResponseValidator
from ..utils import all_json, boolean, is_json_mimetype, is_null, is_nullable
Expand Down
1 change: 1 addition & 0 deletions connexion/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import warnings

from jsonschema.exceptions import ValidationError
from werkzeug.exceptions import Forbidden, Unauthorized

Expand Down
2 changes: 1 addition & 1 deletion connexion/handlers.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging

from .operations.secure import SecureOperation
from .exceptions import AuthenticationProblem, ResolverProblem
from .operations.secure import SecureOperation

logger = logging.getLogger('connexion.handlers')

Expand Down
3 changes: 1 addition & 2 deletions connexion/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
from typing import Optional # NOQA

try:
from swagger_ui_bundle import (swagger_ui_2_path,
swagger_ui_3_path)
from swagger_ui_bundle import swagger_ui_2_path, swagger_ui_3_path
except ImportError:
swagger_ui_2_path = swagger_ui_3_path = None

Expand Down
1 change: 0 additions & 1 deletion connexion/resolver.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import logging
import re
import sys

import connexion.utils as utils
Expand Down
6 changes: 4 additions & 2 deletions connexion/security/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""isort:skip_file"""

# abstract
from .security_handler_factory import AbstractSecurityHandlerFactory # NOQA
from .async_security_handler_factory import AbstractAsyncSecurityHandlerFactory # NOQA
from .security_handler_factory import AbstractSecurityHandlerFactory # NOQA

# concrete
from .flask_security_handler_factory import FlaskSecurityHandlerFactory # NOQA
from .aiohttp_security_handler_factory import AioHttpSecurityHandlerFactory # NOQA
from .flask_security_handler_factory import FlaskSecurityHandlerFactory # NOQA
1 change: 0 additions & 1 deletion connexion/security/aiohttp_security_handler_factory.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import asyncio
import logging

import aiohttp
Expand Down
3 changes: 1 addition & 2 deletions connexion/security/security_handler_factory.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import abc
import base64
import functools
import http.cookies
import logging
import os
import textwrap

import http.cookies

from ..decorators.parameter import inspect_function_arguments
from ..exceptions import (ConnexionException, OAuthProblem,
OAuthResponseProblem, OAuthScopeProblem)
Expand Down
2 changes: 1 addition & 1 deletion connexion/spec.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import abc
import copy
import pathlib
from urllib.parse import urlsplit

import jinja2
import yaml
from openapi_spec_validator.exceptions import OpenAPIValidationError
from urllib.parse import urlsplit

from .exceptions import InvalidSpecification
from .json_schema import resolve_refs
Expand Down
2 changes: 1 addition & 1 deletion examples/openapi3/helloworld_aiohttp/hello.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

import connexion
from aiohttp import web
import connexion


async def post_greeting(name):
Expand Down
3 changes: 0 additions & 3 deletions requirements-aiohttp.txt

This file was deleted.

4 changes: 0 additions & 4 deletions requirements-all.txt

This file was deleted.

12 changes: 0 additions & 12 deletions requirements-devel.txt

This file was deleted.

16 changes: 8 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,20 @@ def read_version(package):
version = read_version('connexion')

install_requires = [
'clickclick>=1.2',
'jsonschema>=2.5.1',
'PyYAML>=5.1',
'requests>=2.9.1',
'inflection>=0.3.1',
'openapi-spec-validator>=0.2.4',
'clickclick>=1.2,<21',
'jsonschema>=2.5.1,<4',
'PyYAML>=5.1,<6',
'requests>=2.9.1,<3',
'inflection>=0.3.1,<0.6',
'openapi-spec-validator>=0.2.4,<2',
'werkzeug>=1.0,<2.0',
]

swagger_ui_require = 'swagger-ui-bundle>=0.0.2'
flask_require = 'flask>=1.0.4'
aiohttp_require = [
'aiohttp>=2.3.10',
'aiohttp-jinja2>=0.14.0'
'aiohttp>=2.3.10,<4',
'aiohttp-jinja2>=0.14.0,<2'
]

tests_require = [
Expand Down
4 changes: 1 addition & 3 deletions tests/aiohttp/test_aiohttp_api_secure.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import asyncio
import base64
from unittest.mock import MagicMock

import pytest
from mock import MagicMock

from connexion import AioHttpApp


Expand Down
4 changes: 2 additions & 2 deletions tests/aiohttp/test_aiohttp_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from unittest import mock

import pytest

from conftest import TEST_FOLDER
from connexion import AioHttpApp
from connexion.exceptions import ConnexionException

from conftest import TEST_FOLDER


@pytest.fixture
def web_run_app_mock(monkeypatch):
Expand Down
3 changes: 1 addition & 2 deletions tests/aiohttp/test_aiohttp_errors.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import asyncio

import pytest

import aiohttp.test_utils
import pytest
from connexion import AioHttpApp
from connexion.apis.aiohttp_api import HTTPStatus

Expand Down
2 changes: 1 addition & 1 deletion tests/aiohttp/test_aiohttp_simple_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

import pytest
import yaml
from connexion import AioHttpApp

from conftest import TEST_FOLDER
from connexion import AioHttpApp

try:
import ujson as json
Expand Down
1 change: 0 additions & 1 deletion tests/aiohttp/test_get_response.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import json

import pytest

from aiohttp import web
from connexion.apis.aiohttp_api import AioHttpApi
from connexion.lifecycle import ConnexionResponse
Expand Down
8 changes: 4 additions & 4 deletions tests/api/test_bootstrap.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import json
from unittest import mock

import jinja2
from unittest import mock
import pytest
import yaml
from openapi_spec_validator.loaders import ExtendedSafeLoader

from conftest import TEST_FOLDER, build_app_from_fixture
from connexion import App
from connexion.exceptions import InvalidSpecification
from connexion.http_facts import METHODS
from openapi_spec_validator.loaders import ExtendedSafeLoader

from conftest import TEST_FOLDER, build_app_from_fixture

SPECS = ["swagger.yaml", "openapi.yaml"]

Expand Down
1 change: 0 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import sys

import pytest

from connexion import App
from connexion.security import FlaskSecurityHandlerFactory

Expand Down
Loading