diff --git a/.flake8 b/.flake8 index ab5af1a..607f57e 100644 --- a/.flake8 +++ b/.flake8 @@ -1,2 +1,4 @@ [flake8] exclude = bin,lib +max-line-length = 88 +extend-ignore = E203 diff --git a/.travis.yml b/.travis.yml index ecc2c00..8740e6f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: python python: - - "2.7" - #- "3.5" + - "3.9" script: - make test after_success: diff --git a/polycules.py b/polycules.py index 30e6da9..e724455 100644 --- a/polycules.py +++ b/polycules.py @@ -50,18 +50,16 @@ def migrate(): for filename in sorted(os.listdir(migrations_dir)): if filename[-3:] != "sql": continue - migration_number = int(filename[:3]) + migration_number = int(filename.split("-", 1)[0]) if migration_number <= current_migration: print("migration {} already applied".format(migration_number)) continue - with open(os.path.join(migrations_dir, filename), "rb") as f: + with open(os.path.join(migrations_dir, filename), "r") as f: try: db.cursor().executescript(f.read()) except Exception as e: print("Got {} - maybe already applied?".format(e)) - finally: - pass - if filename[:3] == "003": + if migration_number == 3: hashify.migrate(db) diff --git a/requirements.txt b/requirements.txt index b95304e..5f23404 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,8 +9,10 @@ chardet==3.0.4 click==7.1.2 colorama==0.4.3 contextlib2==0.6.0 +coverage==5.5 distlib==0.3.0 distro==1.4.0 +flake8==3.9.2 Flask==1.1.2 html5lib==1.0.1 idna==2.8 @@ -21,12 +23,16 @@ jsonschema==3.2.0 lockfile==0.12.2 Markdown==3.2.2 MarkupSafe==1.1.1 +mccabe==0.6.1 msgpack==0.6.2 +nose==1.3.7 packaging==20.3 pathspec==0.8.0 pep517==0.8.2 progress==1.5 +pycodestyle==2.7.0 pycparser==2.20 +pyflakes==2.3.1 pyparsing==2.4.6 pyrsistent==0.16.0 pytoml==0.1.21