Skip to content

Update project to support Python 3.6 & 3.9 and update travis to use stages #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Dec 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
924af6d
Update project with latest dev standard and add multi stage travis
dgarros Dec 5, 2020
d56b1c9
Update task.py as well
dgarros Dec 5, 2020
69be8d8
Remove requests_mock since it's not used
dgarros Dec 5, 2020
3c58e97
Fix dockerfile and update for linter
dgarros Dec 5, 2020
5697707
Remove ipython from dependencies and add support for python 3.6
dgarros Dec 5, 2020
8b19cb3
Update pyproject to support ^3.6
dgarros Dec 5, 2020
4bc4214
Update travis file
dgarros Dec 5, 2020
4d1a83e
Add poetry during lint stage
dgarros Dec 5, 2020
691245c
Refactor travis stages to use default python
dgarros Dec 5, 2020
11151c0
Remove env for test stage
dgarros Dec 5, 2020
58e3fce
Fix python version
dgarros Dec 5, 2020
f5b8194
Remove pytest from build stage
dgarros Dec 5, 2020
9ea8fba
Add poetry build to build stage
dgarros Dec 5, 2020
d41469d
remove trailing space
dgarros Dec 5, 2020
f193c7e
Remove build stage
dgarros Dec 6, 2020
76f5e08
Change base image
dgarros Dec 6, 2020
e732537
Add build in stage list
dgarros Dec 6, 2020
34380fb
add poetry to build stage
dgarros Dec 6, 2020
3ebf0b4
Rename stages
dgarros Dec 6, 2020
d935be5
Try to move python matrix under jobs
dgarros Dec 6, 2020
2110aac
Got back to lint, test, build, deploy
dgarros Dec 6, 2020
357ead1
Fix yamlint
dgarros Dec 6, 2020
e84b3c1
reenable 3.8 and 3.9
dgarros Dec 6, 2020
83a182e
Add back mypy and coverage
dgarros Dec 8, 2020
4df4285
Updated lock file
dgarros Dec 8, 2020
1383935
Add mypy to travis and fix doc issues
dgarros Dec 8, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[flake8]
# E501: Line length is enforced by Black, so flake8 doesn't need to check it
# W503: Black disagrees with this rule, so disable it
# W503: Black disagrees with this rule, as does PEP 8; Black wins
ignore = E501, W503
160 changes: 158 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,161 @@ dmypy.json
# Pyre type checker
.pyre/

# Temporary files
*.swp
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

### PyCharm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### PyCharm Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

# Sonarlint plugin
# https://plugins.jetbrains.com/plugin/7973-sonarlint
.idea/**/sonarlint/

# SonarQube Plugin
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
.idea/**/sonarIssues.xml

# Markdown Navigator plugin
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
.idea/**/markdown-navigator.xml
.idea/**/markdown-navigator-enh.xml
.idea/**/markdown-navigator/

# Cache file creation bug
# See https://youtrack.jetbrains.com/issue/JBR-2257
.idea/$CACHE_FILE$

# CodeStream plugin
# https://plugins.jetbrains.com/plugin/12206-codestream
.idea/codestream.xml

### vscode ###
.vscode/*

*.code-workspace
72 changes: 56 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,68 @@
---
# Add additional stages in the order of execution here, and then under the job:include: key
dist: "focal" # Ubuntu 20.04
stages:
- name: "lint"
- name: "build"
- name: "test"
- name: "deploy"
if: "branch = master"

language: "python"
services:
- "docker"
python:
- 3.6
- 3.7
- 3.8
- 3.9

services:
- "docker"

env:
global:
# yamllint disable-line rule:line-length
- secure: "oSEtMKAmz3dlzrFnRLp3D/KgdSFy7XmVv6c3aSP7LXi8L2ljRrqFOB6BU3RQ6hNbSF3/bvpM9I4QKfZmOyId23Pr5UoMzaN8eL+xL8ZLkjZp0ngVZcCeXRvGwcmg4WJvVOnq3T/NoC/zwtsZbUt19yIJVVCEQqc84im90g6cLNMUulxQOvh6M/qgW4AFhAfi7lUFybl/RiWZYhvFchWifYTj7IfvZSDtin4UStJj7UApguqW4SseTZ/bmt18GSkOn9WO0sOaUSkehkT3NEMy97TLY73KgYb3LNrP47C2NPYQyyzJdb0szJ9CcVKtFjBBl5bqN5MGW/fqtqbh84Jq2GhTHNiYBcu6u/CJ+fscWYJkEWo0nNeED/ef8Vwv1M/q68IVeWsNO3+Se41WvOhMRsM8u1ek6+sHyyTNcVpGIUw4phHBsfCNiIlydWr8VpjZv9N3E4KqKRyjtpOoZElY11ZJa5rEL4D0s3JgSug958dYg/vsh+QVivNb9bbC/o9vBFqZGhWzGmNW2F3ezODZ9JcBlf1TEIZf8QPAHEO2SF5XCVRcDyByefqW28pOzwgk9Acl1/zIh5fiH/9ZAemlxjr17t4DQQbeQ/wbF6Gsmn0cYYoxjWMSrLqMD7TRQOTAYcxWAOKN/hCK/K6DS96r2CW5pU506zKMvezrskDmmX0="

# Script & Before Script for test stage
before_script:
- "pip install invoke"
- "invoke build-test-container -p $TRAVIS_PYTHON_VERSION"
- "curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py > /tmp/get-poetry.py"
- "python /tmp/get-poetry.py -y --version 1.0.2"
- "source $HOME/.poetry/env"
- "pip install invoke poetry toml"
- "poetry install"
script:
- "invoke tests -p $TRAVIS_PYTHON_VERSION"
deploy:
provider: "script"
script: "poetry config pypi-token.pypi $PYPI_TOKEN && poetry publish --build"
skip_cleanup: true
"on":
tags: true
branch: "master"
python: "3.7"
- "invoke pytest --local"

jobs:
include:
- stage: "lint"
env:
- "INVOKE_LOCAL=True"
before_script:
- "pip install invoke poetry toml"
- "poetry install --no-interaction --no-ansi --no-root"
script:
- "invoke black"
- "invoke bandit" # Bandit fails to function on > Py3.8 https://github.com/PyCQA/bandit/issues/639
- "invoke pydocstyle"
- "invoke mypy"
- "invoke flake8"
- "invoke yamllint"
- "invoke pylint"
python: 3.7

- stage: "build"
before_script:
- "pip install invoke poetry toml"
script:
- "invoke build-image --nocache"
- "poetry build"
python: 3.7

- stage: "deploy"
script: "skip"
deploy:
provider: "script"
script: "poetry config pypi-token.pypi $PYPI_TOKEN && poetry publish --build"
skip_cleanup: true
"on":
tags: true
branch: "master"
python: 3.7
58 changes: 0 additions & 58 deletions .yamllint

This file was deleted.

10 changes: 10 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
extends: "default"
rules:
comments: "enable"
empty-values: "enable"
indentation:
indent-sequences: "consistent"
line-length: "disable"
quoted-strings:
quote-type: "double"
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ COPY pyproject.toml /local
COPY poetry.lock /local

RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi
&& poetry install --no-interaction --no-ansi --no-root

COPY . /local
RUN poetry install --no-interaction --no-ansi
Loading