Skip to content

Commit f91cd6d

Browse files
Merge pull request #45 from networktocode/dga-std-update
Update project to support Python 3.6 & 3.9 and update travis to use stages
2 parents 73cad3c + 1383935 commit f91cd6d

File tree

9 files changed

+635
-754
lines changed

9 files changed

+635
-754
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[flake8]
22
# E501: Line length is enforced by Black, so flake8 doesn't need to check it
3-
# W503: Black disagrees with this rule, so disable it
3+
# W503: Black disagrees with this rule, as does PEP 8; Black wins
44
ignore = E501, W503

.gitignore

Lines changed: 158 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,161 @@ dmypy.json
128128
# Pyre type checker
129129
.pyre/
130130

131-
# Temporary files
132-
*.swp
131+
### macOS ###
132+
# General
133+
.DS_Store
134+
.AppleDouble
135+
.LSOverride
136+
137+
# Thumbnails
138+
._*
139+
140+
# Files that might appear in the root of a volume
141+
.DocumentRevisions-V100
142+
.fseventsd
143+
.Spotlight-V100
144+
.TemporaryItems
145+
.Trashes
146+
.VolumeIcon.icns
147+
.com.apple.timemachine.donotpresent
148+
149+
# Directories potentially created on remote AFP share
150+
.AppleDB
151+
.AppleDesktop
152+
Network Trash Folder
153+
Temporary Items
154+
.apdisk
155+
156+
### Windows ###
157+
# Windows thumbnail cache files
158+
Thumbs.db
159+
Thumbs.db:encryptable
160+
ehthumbs.db
161+
ehthumbs_vista.db
162+
163+
# Dump file
164+
*.stackdump
165+
166+
# Folder config file
167+
[Dd]esktop.ini
168+
169+
# Recycle Bin used on file shares
170+
$RECYCLE.BIN/
171+
172+
# Windows Installer files
173+
*.cab
174+
*.msi
175+
*.msix
176+
*.msm
177+
*.msp
178+
179+
# Windows shortcuts
180+
*.lnk
181+
182+
### PyCharm ###
183+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
184+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
185+
186+
# User-specific stuff
187+
.idea/**/workspace.xml
188+
.idea/**/tasks.xml
189+
.idea/**/usage.statistics.xml
190+
.idea/**/dictionaries
191+
.idea/**/shelf
192+
193+
# Generated files
194+
.idea/**/contentModel.xml
195+
196+
# Sensitive or high-churn files
197+
.idea/**/dataSources/
198+
.idea/**/dataSources.ids
199+
.idea/**/dataSources.local.xml
200+
.idea/**/sqlDataSources.xml
201+
.idea/**/dynamic.xml
202+
.idea/**/uiDesigner.xml
203+
.idea/**/dbnavigator.xml
204+
205+
# Gradle
206+
.idea/**/gradle.xml
207+
.idea/**/libraries
208+
209+
# Gradle and Maven with auto-import
210+
# When using Gradle or Maven with auto-import, you should exclude module files,
211+
# since they will be recreated, and may cause churn. Uncomment if using
212+
# auto-import.
213+
# .idea/artifacts
214+
# .idea/compiler.xml
215+
# .idea/jarRepositories.xml
216+
# .idea/modules.xml
217+
# .idea/*.iml
218+
# .idea/modules
219+
# *.iml
220+
# *.ipr
221+
222+
# CMake
223+
cmake-build-*/
224+
225+
# Mongo Explorer plugin
226+
.idea/**/mongoSettings.xml
227+
228+
# File-based project format
229+
*.iws
230+
231+
# IntelliJ
232+
out/
233+
234+
# mpeltonen/sbt-idea plugin
235+
.idea_modules/
236+
237+
# JIRA plugin
238+
atlassian-ide-plugin.xml
239+
240+
# Cursive Clojure plugin
241+
.idea/replstate.xml
242+
243+
# Crashlytics plugin (for Android Studio and IntelliJ)
244+
com_crashlytics_export_strings.xml
245+
crashlytics.properties
246+
crashlytics-build.properties
247+
fabric.properties
248+
249+
# Editor-based Rest Client
250+
.idea/httpRequests
251+
252+
# Android studio 3.1+ serialized cache file
253+
.idea/caches/build_file_checksums.ser
254+
255+
### PyCharm Patch ###
256+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
257+
258+
# *.iml
259+
# modules.xml
260+
# .idea/misc.xml
261+
# *.ipr
262+
263+
# Sonarlint plugin
264+
# https://plugins.jetbrains.com/plugin/7973-sonarlint
265+
.idea/**/sonarlint/
266+
267+
# SonarQube Plugin
268+
# https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
269+
.idea/**/sonarIssues.xml
270+
271+
# Markdown Navigator plugin
272+
# https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
273+
.idea/**/markdown-navigator.xml
274+
.idea/**/markdown-navigator-enh.xml
275+
.idea/**/markdown-navigator/
276+
277+
# Cache file creation bug
278+
# See https://youtrack.jetbrains.com/issue/JBR-2257
279+
.idea/$CACHE_FILE$
280+
281+
# CodeStream plugin
282+
# https://plugins.jetbrains.com/plugin/12206-codestream
283+
.idea/codestream.xml
284+
285+
### vscode ###
286+
.vscode/*
287+
288+
*.code-workspace

.travis.yml

Lines changed: 56 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,68 @@
11
---
2+
# Add additional stages in the order of execution here, and then under the job:include: key
3+
dist: "focal" # Ubuntu 20.04
4+
stages:
5+
- name: "lint"
6+
- name: "build"
7+
- name: "test"
8+
- name: "deploy"
9+
if: "branch = master"
10+
211
language: "python"
3-
services:
4-
- "docker"
512
python:
13+
- 3.6
614
- 3.7
715
- 3.8
16+
- 3.9
17+
18+
services:
19+
- "docker"
820

921
env:
1022
global:
1123
# yamllint disable-line rule:line-length
1224
- 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="
25+
26+
# Script & Before Script for test stage
1327
before_script:
14-
- "pip install invoke"
15-
- "invoke build-test-container -p $TRAVIS_PYTHON_VERSION"
16-
- "curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py > /tmp/get-poetry.py"
17-
- "python /tmp/get-poetry.py -y --version 1.0.2"
18-
- "source $HOME/.poetry/env"
28+
- "pip install invoke poetry toml"
29+
- "poetry install"
1930
script:
20-
- "invoke tests -p $TRAVIS_PYTHON_VERSION"
21-
deploy:
22-
provider: "script"
23-
script: "poetry config pypi-token.pypi $PYPI_TOKEN && poetry publish --build"
24-
skip_cleanup: true
25-
"on":
26-
tags: true
27-
branch: "master"
28-
python: "3.7"
31+
- "invoke pytest --local"
32+
33+
jobs:
34+
include:
35+
- stage: "lint"
36+
env:
37+
- "INVOKE_LOCAL=True"
38+
before_script:
39+
- "pip install invoke poetry toml"
40+
- "poetry install --no-interaction --no-ansi --no-root"
41+
script:
42+
- "invoke black"
43+
- "invoke bandit" # Bandit fails to function on > Py3.8 https://github.com/PyCQA/bandit/issues/639
44+
- "invoke pydocstyle"
45+
- "invoke mypy"
46+
- "invoke flake8"
47+
- "invoke yamllint"
48+
- "invoke pylint"
49+
python: 3.7
50+
51+
- stage: "build"
52+
before_script:
53+
- "pip install invoke poetry toml"
54+
script:
55+
- "invoke build-image --nocache"
56+
- "poetry build"
57+
python: 3.7
58+
59+
- stage: "deploy"
60+
script: "skip"
61+
deploy:
62+
provider: "script"
63+
script: "poetry config pypi-token.pypi $PYPI_TOKEN && poetry publish --build"
64+
skip_cleanup: true
65+
"on":
66+
tags: true
67+
branch: "master"
68+
python: 3.7

.yamllint

Lines changed: 0 additions & 58 deletions
This file was deleted.

.yamllint.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
extends: "default"
3+
rules:
4+
comments: "enable"
5+
empty-values: "enable"
6+
indentation:
7+
indent-sequences: "consistent"
8+
line-length: "disable"
9+
quoted-strings:
10+
quote-type: "double"

Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@ COPY pyproject.toml /local
1010
COPY poetry.lock /local
1111

1212
RUN poetry config virtualenvs.create false \
13-
&& poetry install --no-interaction --no-ansi
13+
&& poetry install --no-interaction --no-ansi --no-root
14+
15+
COPY . /local
16+
RUN poetry install --no-interaction --no-ansi

0 commit comments

Comments
 (0)