diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 00000000..7ebfc590 --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,37 @@ +name: CodeCov + +on: [push, pull_request] + +jobs: + coverage: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + python-version: [ 3.7, 3.8, 3.9, ] # latest release minus two + requirements-file: [ + dj22_cms37.txt, + dj22_cms38.txt, + dj30_cms37.txt, + dj30_cms38.txt, + dj31_cms38.txt, + ] + os: [ + ubuntu-20.04, + ] + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '2' + + - name: Setup Python + uses: actions/setup-python@master + with: + python-version: ${{ matrix.python-version }} + - name: Generate Report + run: | + pip install -r tests/requirements/${{ matrix.requirements-file }} + coverage run setup.py test + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v1 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..721b2ca6 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,38 @@ +name: Lint + +on: [push] + +jobs: + flake8: + name: flake8 + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install flate8 + run: pip install --upgrade flake8 + - name: Run flake8 + uses: liskin/gh-problem-matcher-wrap@v1 + with: + linters: flake8 + run: flake8 + + isort: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - run: python -m pip install isort + - name: isort + uses: liskin/gh-problem-matcher-wrap@v1 + with: + linters: isort + run: isort -c -rc -df djangocms_bootstrap4 diff --git a/.gitignore b/.gitignore index 560c3a09..1e7fc9c1 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ __pycache__/ build/ dist/ env/ +.venv/ /~ /node_modules diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d5efac84..00000000 --- a/.travis.yml +++ /dev/null @@ -1,42 +0,0 @@ -language: python - -dist: xenial - -matrix: - include: - - python: 3.5 - env: TOX_ENV='flake8' - - python: 3.5 - env: TOX_ENV='isort' - # Django 2.2 - - python: 3.5 - env: DJANGO='dj22' CMS='cms37' - - python: 3.6 - env: DJANGO='dj22' CMS='cms37' - - python: 3.7 - env: DJANGO='dj22' CMS='cms37' - - python: 3.8 - env: DJANGO='dj22' CMS='cms37' - # Django 3.0, always run the lowest supported version - - python: 3.6 - env: DJANGO='dj30' CMS='cms37' - # Django 3.1, always run the lowest supported version - - python: 3.6 - env: DJANGO='dj31' CMS='cms38' - allow_failures: - - python: 3.6 - env: DJANGO='dj31' CMS='cms38' - -install: - - pip install coverage isort tox - - "if [[ $TRAVIS_PYTHON_VERSION == '3.5' ]]; then export PY_VER=py35; fi" - - "if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then export PY_VER=py36; fi" - - "if [[ $TRAVIS_PYTHON_VERSION == '3.7' ]]; then export PY_VER=py37; fi" - - "if [[ $TRAVIS_PYTHON_VERSION == '3.8' ]]; then export PY_VER=py37; fi" - - "if [[ ${DJANGO}z != 'z' ]]; then export TOX_ENV=$PY_VER-$DJANGO-$CMS; fi" - -script: - - tox -e $TOX_ENV - -after_success: - - bash <(curl -s https://codecov.io/bash) diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 00000000..3f1fb35d --- /dev/null +++ b/setup.cfg @@ -0,0 +1,28 @@ +[flake8] +max-line-length = 119 +exclude = + *.egg-info, + .eggs, + .git, + .settings, + .tox, + build, + data, + dist, + docs, + *migrations*, + requirements, + tmp + +[isort] +line_length = 79 +skip = manage.py, *migrations*, .tox, .eggs, data +include_trailing_comma = true +multi_line_output = 5 +not_skip = __init__.py +lines_after_imports = 2 +default_section = THIRDPARTY +sections = FUTURE, STDLIB, DJANGO, CMS, THIRDPARTY, FIRSTPARTY, LIB, LOCALFOLDER +known_first_party = djangocms_bootstrap4 +known_cms = cms, menus +known_django = django diff --git a/tests/requirements.txt b/tests/requirements/base.txt similarity index 61% rename from tests/requirements.txt rename to tests/requirements/base.txt index 77295764..66157f2d 100644 --- a/tests/requirements.txt +++ b/tests/requirements/base.txt @@ -1,6 +1,9 @@ +coverage django-app-helper +django-treebeard<4.5 tox coverage isort flake8 pyflakes>=2.1 +wheel diff --git a/tests/requirements/dj22_cms37.txt b/tests/requirements/dj22_cms37.txt new file mode 100644 index 00000000..6b96a102 --- /dev/null +++ b/tests/requirements/dj22_cms37.txt @@ -0,0 +1,4 @@ +-r base.txt + +Django>=2.2,<3.0 +django-cms>=3.7,<3.8 diff --git a/tests/requirements/dj22_cms38.txt b/tests/requirements/dj22_cms38.txt new file mode 100644 index 00000000..22c4fef2 --- /dev/null +++ b/tests/requirements/dj22_cms38.txt @@ -0,0 +1,4 @@ +-r base.txt + +Django>=2.2,<3.0 +django-cms>=3.8,<3.9 diff --git a/tests/requirements/dj30_cms37.txt b/tests/requirements/dj30_cms37.txt new file mode 100644 index 00000000..edcfd450 --- /dev/null +++ b/tests/requirements/dj30_cms37.txt @@ -0,0 +1,4 @@ +-r base.txt + +Django>=3.0,<3.1 +django-cms>=3.7,<3.8 diff --git a/tests/requirements/dj30_cms38.txt b/tests/requirements/dj30_cms38.txt new file mode 100644 index 00000000..7bc3c0be --- /dev/null +++ b/tests/requirements/dj30_cms38.txt @@ -0,0 +1,4 @@ +-r base.txt + +Django>=3.0,<3.1 +django-cms>=3.8,<3.9 diff --git a/tests/requirements/dj31_cms38.txt b/tests/requirements/dj31_cms38.txt new file mode 100644 index 00000000..d17fdb42 --- /dev/null +++ b/tests/requirements/dj31_cms38.txt @@ -0,0 +1,4 @@ +-r base.txt + +Django>=3.1,<3.2 +django-cms>=3.8,<3.9 diff --git a/tox.ini b/tox.ini index e8613892..6c92ce4e 100644 --- a/tox.ini +++ b/tox.ini @@ -39,7 +39,7 @@ known_django = django [testenv] deps = - -r{toxinidir}/tests/requirements.txt + -r{toxinidir}/tests/requirements/base.txt dj22: Django>=2.2,<3.0 dj30: Django>=3.0,<3.1 dj31: Django>=3.1,<3.2