Commit f7e954a8 authored by nimrod's avatar nimrod
Browse files

Merge branch 'ft/gitlab-ci'

parents 27cbbe0a 77229090
Loading
Loading
Loading
Loading
Loading

.gitlab-ci.yml

0 → 100644
+69 −0
Original line number Diff line number Diff line
---
stages:
  - lint
  - test

pre-commit:
  stage: lint
  image: adarnimrod/ci-images:pre-commit
  variables: &variables
    XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache"
    PIPENV_VENV_IN_PROJECT: "1"
    LANG: C.UTF-8
  before_script:
    - apt-get update
    - apt-get install -y libdbus-1-dev
    - pipenv install --dev && rm pyproject.toml
  script:
    - pipenv run lint
  cache: &cache
    key: "$CI_JOB_NAME"
    paths:
      - .cache/
      - .venv/

test:
  stage: test
  image: $project:$version-slim
  allow_failure: true
  before_script:
    - apt-get update
    - >-
      apt-get install -y
      bats
      build-essential
      git
      libdbus-1-dev
      libffi-dev
      libglib2.0-dev
      libssl-dev
    - |-
      if [ "$project" = 'pypy' ]
      then
        ln -sf /opt/pypy/bin/pypy "/usr/local/bin/python$version"
      fi
    - pip install pipenv
    - pipenv install --dev --python=$version
  script:
    - pipenv run bats
    - pipenv run check
    - pipenv run doctest
    - pipenv run build
  variables:
    <<: *variables
    PIPENV_SKIP_LOCK: 1
  cache: *cache
  parallel:
    matrix:
      - project: python
        version:
          - "2.7"
          - "3.6"
          - "3.7"
          - "3.8"
          - "3.9"
      - project: pypy
        version:
          - "2.7"
          - "3.6"
          - "3.7"
+19 −8
Original line number Diff line number Diff line
@@ -2,25 +2,30 @@
---
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v2.2.3
    rev: v3.3.0
    hooks:
      - id: check-added-large-files
      - id: check-merge-conflict
      - id: check-toml
        files: Pipfile
      - id: detect-private-key
      - id: trailing-whitespace

  - repo: https://github.com/ambv/black
    rev: 18.9b0
    rev: 20.8b1
    hooks:
      - id: black
        args:
          - |
              --line-length=79

  - repo: https://github.com/Lucas-C/pre-commit-hooks-markup
    rev: v1.0.0
    hooks:
      - id: rst-linter

  - repo: https://github.com/PyCQA/prospector
    rev: 1.1.6.4
    rev: 1.3.1
    hooks:
      - id: prospector
        args:
@@ -33,8 +38,9 @@ repos:
        additional_dependencies:
          - pyroma
          - dodgy

  - repo: https://gitlab.com/pycqa/flake8
    rev: 3.7.7
    rev: 3.8.4
    hooks:
      - id: flake8
        args:
@@ -42,28 +48,33 @@ repos:
            --max-line-length=79
        additional_dependencies:
          - flake8-bugbear

  - repo: https://github.com/pre-commit/mirrors-pylint
    rev: v2.3.1
    rev: v2.6.0
    hooks:
      - id: pylint
        args:
          - |-
            --disable=R0801

  - repo: https://github.com/adrienverge/yamllint
    rev: v1.16.0
    rev: v1.25.0
    hooks:
      - id: yamllint

  - repo: https://github.com/PyCQA/bandit
    rev: 1.6.1
    rev: 1.6.2
    hooks:
      - id: bandit

  - repo: https://github.com/amperser/proselint/
    rev: 0.10.2
    hooks:
      - id: proselint
        types: [plain-text]
        exclude: LICENSE|requirements

  - repo: https://github.com/mgedmin/check-manifest
    rev: "0.39"
    rev: '0.45'
    hooks:
      - id: check-manifest

.travis.yml

deleted100644 → 0
+0 −43
Original line number Diff line number Diff line
# vim:ff=unix ts=2 sw=2 ai expandtab
---
language: python
python:
  - "2.7"
  - "3.5"
  - "3.6"
  - "3.7"
dist: xenial
sudo: false
cache:
  - pip
  - $HOME/.pre-commit

matrix:
  include:
    - python: "3.7"
      env:
        PIPENV_IGNORE_VIRTUALENVS: "1"
      install:
        - pipenv install --dev
      addons:
        apt:
          packages:
            - libdbus-1-dev
            - libglib2.0-dev
      script:
        - pipenv run lint
        - pipenv run check

install:
  - git clone --depth 1 https://github.com/bats-core/bats-core "$HOME/bats"
  - pip install . | cat

env:
  PATH: "$PATH:$HOME/bats/bin:$HOME/.local/bin"

script:
  - bats -t tests/
  - python -m doctest template/*.py

notifications:
  email: false
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@ recursive-include template *.py
include *.rst
include *.txt
exclude .pre-commit-config.yaml
exclude .travis.yml
exclude .gitlab-ci.yml
exclude .gitignore
exclude Pipfile*
exclude tests
+3 −10
Original line number Diff line number Diff line
@@ -5,22 +5,15 @@ verify_ssl = true

[dev-packages]
pre-commit = "*"
bumpversion = "*"
bumpversion = {version = "*", markers="python_version >= '3.6'"}
twine = "*"
dbus-python = "*"
keyring = "*"
template = {editable = true,path = "."}

[packages]

[requires]
python_version = "3.7"

[scripts]
lint = "pre-commit run --all-files"
build = "sh -c 'git clean -fdX && python setup.py bdist_wheel'"
build = "python setup.py bdist_wheel"
clean = "git clean -fdX"
upload = "sh -c 'git clean -fdX && python setup.py bdist_wheel && twine upload -s dist/*'"
upload = "sh -c 'twine upload -s dist/*'"
bats = "bats -t tests/"
check = "sh -c 'rm -rf dist/ && python setup.py bdist_wheel && twine check dist/*'"
doctest = "sh -c 'python -m doctest template/*.py'"
Loading