Commit 2b6f0bcd authored by nimrod's avatar nimrod
Browse files

Migrate to GitLab.

- Replace tox tests with pre-commit hooks.
- Replace Travis CI with GitLab CI.
- Address issues from checks.
- Format with Black.
- Release with GitLab CI.
- Update documentation.
parent 56687605
Loading
Loading
Loading
Loading
Loading

.gitlab-ci.yml

0 → 100644
+45 −0
Original line number Diff line number Diff line
---
stages:
  - test
  - release

pre-commit:
  stage: test
  image: adarnimrod/ci-images:pre-commit
  variables: &variables
    XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache"
  script:
    - pre-commit run -a
  cache: &cache
    paths:
      - .cache/

upload:
  stage: release
  image: python:3.6
  before_script:
    - pip install twine
  script:
    - mv "$pypirc" $HOME/.pypirc
    - python setup.py bdist_wheel
    - twine upload dist/*
  variables: *variables
  cache: *cache
  rules:
    - if: $CI_COMMIT_TAG
  artifacts:
    paths:
      - dist/*.whl

release:
  stage: release
  image: registry.gitlab.com/gitlab-org/release-cli:latest
  script:
    - !!str true
  rules:
    - if: $CI_COMMIT_TAG
  release:
    name: Release $CI_COMMIT_TAG
    tag_name: $CI_COMMIT_TAG
    ref: $CI_COMMIT_TAG
    description: Release $CI_COMMIT_TAG
+87 −10
Original line number Diff line number Diff line
-   repo: git://github.com/pre-commit/pre-commit-hooks
    sha: v0.7.1
# vim:ff=unix ts=2 sw=2 ai expandtab
---
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v3.4.0
    hooks:
    -   id: check-added-large-files
    -   id: check-json
    -   id: check-xml
    -   id: check-yaml
      - id: check-executables-have-shebangs
      - id: check-merge-conflict
      - id: trailing-whitespace

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

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

  - repo: https://github.com/myint/rstcheck.git
    rev: master
    hooks:
      - id: rstcheck

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

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

  - repo: https://github.com/PyCQA/prospector
    rev: 1.3.1
    hooks:
      - id: prospector
        args:
          - |-
            --max-line-length=79
          - |-
            --with-tool=pyroma
          - |-
            --with-tool=bandit
          - |-
            --without-tool=pep257
          - |-
            --doc-warnings
          - |-
            --test-warnings
          - |-
            --full-pep8
          - |-
            --strictness=high
          - |-
            --no-autodetect
        additional_dependencies:
          - bandit
          - pyroma

  - repo: https://gitlab.com/pycqa/flake8.git
    rev: 3.8.4
    hooks:
      - id: flake8
    -   id: check-symlinks
        args:
          - |-
            --doctests
        additional_dependencies:
          - flake8-bugbear


  - repo: https://github.com/Yelp/detect-secrets
    rev: v0.14.3
    hooks:
      - id: detect-secrets

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

.travis.yml

deleted100644 → 0
+0 −26
Original line number Diff line number Diff line
---
language: python
python: ["2.7", "3.3", "3.4", "3.5", "3.6"]
dist: trusty
sudo: false
cache:
  - pip
matrix:
  include:
    - python: "3.5"
      env: TOXENV=docs
    - python: "2.7"
      env: TOXENV=pre-commit
    - python: "3.5"
      env: TOXENV=pre-commit
    - python: "3.5"
      env: TOXENV=bandit

install:
    - pip install tox-travis | cat

script:
  - tox

notifications:
  email: false
+1 −1
Original line number Diff line number Diff line
recursive-include eb-prune *.py
exclude .pre-commit-config.yaml
exclude .travis.yml
exclude .gitlab-ci.yml
include *.rst
include *.txt
include VERSION
+9 −15
Original line number Diff line number Diff line
eb-prune
########

.. image:: https://travis-ci.org/adarnimrod/eb-prune.svg?branch=master
    :target: https://travis-ci.org/adarnimrod/eb-prune
.. image:: https://git.shore.co.il/nimrod/eb-prune/badges/master/pipeline.svg
    :target: https://git.shore.co.il/nimrod/eb-prune/-/commits/master

A CLI tool to prune old versions of Elastic Beanstalk.

@@ -42,16 +42,16 @@ file).
Testing
-------

Tests require Python 2.7, Python 3.3 or later and Tox and are run by running
:code:`tox`. Also, Travis CI is used to test on multiple Python versions for
every push.
Various linters are configured with `pre-commit <https://pre-commit.com/>`_.
Those are run in CI in `GitLab
<https://git.shore.co.il/nimrod/eb-prune/-/pipelines>`_. To run locally, install
pre-commit and run it.

Release
-------

Releases require Python 2.7 or Python 3.3 or later and Tox. To release a new
version bump the version in the :code:`VERSION` file and run :code:`tox -e
release`.
Update the version in :code:`VERSION`, commit, tag and push. GitLab will do the
rest.

Author
------
@@ -59,10 +59,4 @@ Author
Nimrod Adar, `contact me <nimrod@shore.co.il>`_ or visit my `website
<https://www.shore.co.il/>`_. Patches are welcome via `git send-email
<http://git-scm.com/book/en/v2/Git-Commands-Email>`_. The repository is located
at: https://www.shore.co.il/git/.

TODO
----

- Release to PyPI on tagged commits from Travis CI.
- Add tests using moto.
at: https://git.shore.co.il/explore.
Loading