~lyndsysimon/columnist

76bcf5807851545207faf6e8545eec75888ec6c5 — Lyndsy Simon 5 years ago bb73a55
Add Flake8, GitLab CI
A .gitlab-ci.yml => .gitlab-ci.yml +12 -0
@@ 0,0 1,12 @@
image: python:3.7

stages:
  - test

test:
  before_script:
  - pip install pipenv
  - pipenv install --dev
  script:
  - pipenv run flake8
  - pipenv run pytest

M Pipfile => Pipfile +1 -0
@@ 6,6 6,7 @@ name = "pypi"
[dev-packages]
pytest = "*"
ipdb = "*"
"flake8" = "*"

[packages]
sqlalchemy = "*"

M Pipfile.lock => Pipfile.lock +57 -28
@@ 1,7 1,7 @@
{
    "_meta": {
        "hash": {
            "sha256": "479d9a27379aafec83b4b5c84d7720ad4719a9d2cb64beb8616bb75438147691"
            "sha256": "852b867488b346afb0d2622840a1f59a50f6864697b7ade697bce95ae7a8b3ba"
        },
        "pipfile-spec": 6,
        "requires": {


@@ 18,10 18,10 @@
    "default": {
        "sqlalchemy": {
            "hashes": [
                "sha256:72325e67fb85f6e9ad304c603d83626d1df684fdf0c7ab1f0352e71feeab69d8"
                "sha256:c5951d9ef1d5404ed04bae5a16b60a0779087378928f997a294d1229c6ca4d3e"
            ],
            "index": "pypi",
            "version": "==1.2.10"
            "version": "==1.2.12"
        }
    },
    "develop": {


@@ 35,17 35,17 @@
        },
        "atomicwrites": {
            "hashes": [
                "sha256:240831ea22da9ab882b551b31d4225591e5e447a68c5e188db5b89ca1d487585",
                "sha256:a24da68318b08ac9c9c45029f4a10371ab5b20e4226738e150e6e7c571630ae6"
                "sha256:0312ad34fcad8fac3704d441f7b317e50af620823353ec657a53e981f92920c0",
                "sha256:ec9ae8adaae229e4f8446952d204a3e4b5fdd2d099f9be3aaf556120135fb3ee"
            ],
            "version": "==1.1.5"
            "version": "==1.2.1"
        },
        "attrs": {
            "hashes": [
                "sha256:4b90b09eeeb9b88c35bc642cbac057e45a5fd85367b985bd2809c62b7b939265",
                "sha256:e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b"
                "sha256:10cbf6e27dbce8c30807caf056c8eb50917e0eaafe86347671b57254006c3e69",
                "sha256:ca4be454458f9dec299268d472aaa5a11f67a4ff70093396e1ceae9c76cf4bbb"
            ],
            "version": "==18.1.0"
            "version": "==18.2.0"
        },
        "backcall": {
            "hashes": [


@@ 61,6 61,14 @@
            ],
            "version": "==4.3.0"
        },
        "flake8": {
            "hashes": [
                "sha256:7253265f7abd8b313e3892944044a365e3f4ac3fcdcfb4298f55ee9ddf188ba0",
                "sha256:c7841163e2b576d435799169b78703ad6ac1bbb0f199994fc05f700b2a90ea37"
            ],
            "index": "pypi",
            "version": "==3.5.0"
        },
        "ipdb": {
            "hashes": [
                "sha256:7081c65ed7bfe7737f83fa4213ca8afd9617b42ff6b3f1daf9a3419839a2a00a"


@@ 70,10 78,10 @@
        },
        "ipython": {
            "hashes": [
                "sha256:007dcd929c14631f83daff35df0147ea51d1af420da303fd078343878bd5fb62",
                "sha256:b0f2ef9eada4a68ef63ee10b6dde4f35c840035c50fd24265f8052c98947d5a4"
                "sha256:47b17ea874454a5c2eacc2732b04a750d260b01ba479323155ac8a39031f5535",
                "sha256:9fed506c3772c875a3048bc134a25e6f5e997b1569b2636f6a5d891f34cbfd46"
            ],
            "version": "==6.5.0"
            "version": "==7.0.1"
        },
        "ipython-genutils": {
            "hashes": [


@@ 84,10 92,17 @@
        },
        "jedi": {
            "hashes": [
                "sha256:b409ed0f6913a701ed474a614a3bb46e6953639033e31f769ca7581da5bd1ec1",
                "sha256:c254b135fb39ad76e78d4d8f92765ebc9bf92cbc76f49e97ade1d5f5121e1f6f"
                "sha256:0191c447165f798e6a730285f2eee783fff81b0d3df261945ecb80983b5c3ca7",
                "sha256:b7493f73a2febe0dc33d51c99b474547f7f6c0b2c8fb2b21f453eef204c12148"
            ],
            "version": "==0.13.1"
        },
        "mccabe": {
            "hashes": [
                "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42",
                "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"
            ],
            "version": "==0.12.1"
            "version": "==0.6.1"
        },
        "more-itertools": {
            "hashes": [


@@ 114,10 129,10 @@
        },
        "pickleshare": {
            "hashes": [
                "sha256:84a9257227dfdd6fe1b4be1319096c20eb85ff1e82c7932f36efccfe1b09737b",
                "sha256:c9a2541f25aeabc070f12f452e1f2a8eae2abd51e1cd19e8430402bdf4c1d8b5"
                "sha256:87683d47965c1da65cdacaf31c8441d12b8044cdec9aca500cd78fc2c683afca",
                "sha256:9649af414d74d4df115d5d718f82acb59c9d418196b7b4290ed47a12ce62df56"
            ],
            "version": "==0.7.4"
            "version": "==0.7.5"
        },
        "pluggy": {
            "hashes": [


@@ 128,11 143,11 @@
        },
        "prompt-toolkit": {
            "hashes": [
                "sha256:1df952620eccb399c53ebb359cc7d9a8d3a9538cb34c5a1344bdbeb29fbcc381",
                "sha256:3f473ae040ddaa52b52f97f6b4a493cfa9f5920c255a12dc56a7d34397a398a4",
                "sha256:858588f1983ca497f1cf4ffde01d978a3ea02b01c8a26a8bbc5cd2e66d816917"
                "sha256:5eff0c9fd652384ecfe730bbcdf3658868725c6928fbf608d9338834d7a974b6",
                "sha256:81da9ecf6ca6806a549697529af8ec3ac5b739c13ac14607218e650db1b53131",
                "sha256:c67c1c264d8a0d9e1070e9272bacee00f76c81daab7bc4bf09ff991bd1e224a7"
            ],
            "version": "==1.0.15"
            "version": "==2.0.5"
        },
        "ptyprocess": {
            "hashes": [


@@ 143,10 158,24 @@
        },
        "py": {
            "hashes": [
                "sha256:3fd59af7435864e1a243790d322d763925431213b6b8529c6ca71081ace3bbf7",
                "sha256:e31fb2767eb657cbde86c454f02e99cb846d3cd9d61b318525140214fdc0e98e"
                "sha256:06a30435d058473046be836d3fc4f27167fd84c45b99704f2fb5509ef61f9af1",
                "sha256:50402e9d1c9005d759426988a492e0edaadb7f4e68bcddfea586bc7432d009c6"
            ],
            "version": "==1.6.0"
        },
        "pycodestyle": {
            "hashes": [
                "sha256:682256a5b318149ca0d2a9185d365d8864a768a28db66a84a2ea946bcc426766",
                "sha256:6c4245ade1edfad79c3446fadfc96b0de2759662dc29d07d80a6f27ad1ca6ba9"
            ],
            "version": "==2.3.1"
        },
        "pyflakes": {
            "hashes": [
                "sha256:08bd6a50edf8cffa9fa09a463063c425ecaaf10d1eb0335a7e8b1401aef89e6f",
                "sha256:8d616a382f243dbf19b54743f280b80198be0bca3a5396f1d2e1fca6223e8805"
            ],
            "version": "==1.5.4"
            "version": "==1.6.0"
        },
        "pygments": {
            "hashes": [


@@ 157,11 186,11 @@
        },
        "pytest": {
            "hashes": [
                "sha256:86a8dbf407e437351cef4dba46736e9c5a6e3c3ac71b2e942209748e76ff2086",
                "sha256:e74466e97ac14582a8188ff4c53e6cc3810315f342f6096899332ae864c1d432"
                "sha256:7e258ee50338f4e46957f9e09a0f10fb1c2d05493fa901d113a8dafd0790de4e",
                "sha256:9332147e9af2dcf46cd7ceb14d5acadb6564744ddff1fe8c17f0ce60ece7d9a2"
            ],
            "index": "pypi",
            "version": "==3.7.1"
            "version": "==3.8.2"
        },
        "simplegeneric": {
            "hashes": [

M README.rst => README.rst +6 -0
@@ 1,6 1,10 @@
Columnist
=========

==========     =================
``master``     |gitlab_ci_badge|
==========     =================

Quickstart
----------



@@ 50,3 54,5 @@ features include:
  - [ ] Django ORM
  - [ ] raw SQL
  - [ ] arbitrary iterables

.. |gitlab_ci_badge| image:: https://gitlab.com/lyndsysimon/columnist/badges/master/pipeline.svg

M columnist/__init__.py => columnist/__init__.py +2 -2
@@ 1,5 1,5 @@
from .report import Report
from .column import column
from .report import Report  # NOQA: F401
from .column import column  # NOQA: F401


name = 'columnist'

M setup.py => setup.py +1 -1
@@ 10,7 10,7 @@ with open('README.rst', 'r') as f:

setup(
    name=columnist.name,
    version=colument.version,
    version=columnist.version,
    author='Lyndsy Simon',
    author_email='lyndsy@lyndsysimon.com',
    description='Simplify creating reports on SQLAlchemy models',

M tests/conftest.py => tests/conftest.py +0 -1
@@ 2,7 2,6 @@ import os.path
import sys

from .db import Base
from .db import Model
from .db import engine
from .db import session


M tests/test_formatters.py => tests/test_formatters.py +0 -1
@@ 1,5 1,4 @@
import datetime
import textwrap

import pytest


M tests/test_report.py => tests/test_report.py +2 -2
@@ 58,8 58,8 @@ class TestReport:
    def test_columns(self):
        """Methods with the @column decorator are tracked"""
        assert len(MockReport.columns) == 2
        for column in MockReport.columns:
            assert isinstance(column, ColumnDescriptor)
        for col in MockReport.columns:
            assert isinstance(col, ColumnDescriptor)

    def test_query(self, records):
        """Query returns all expected rows"""