-
Notifications
You must be signed in to change notification settings - Fork 186
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
Revamp development workflow #622
Merged
pradyunsg
merged 9 commits into
pythonindia:master
from
pradyunsg:revamp-development-workflow
Mar 10, 2020
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
416bba0
Drop outdated Docker configuration
pradyunsg 43b5ebb
Drop the MkDocs configuration
pradyunsg 12e2a15
Move CoC to .github
pradyunsg 80bc485
Remove spam.csv
pradyunsg 5ed8ffd
Adopt nox and get rid of requirements-dev.txt
pradyunsg 2f58f90
Rework Travis CI setup
pradyunsg 3e8c345
Make flake8 happy
pradyunsg 1132663
HACK: Install pinned celery in Travis CI
pradyunsg 6a6b487
Update .travis.yml
pradyunsg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,63 @@ | ||
language: python | ||
sudo: false | ||
python: | ||
- '2.7' | ||
- '3.4' | ||
- '3.5' | ||
# System information | ||
os: linux | ||
addons: | ||
postgresql: "9.3" | ||
services: | ||
- redis | ||
|
||
cache: | ||
directories: | ||
- $HOME/.pip-cache/ | ||
language: python | ||
python: 3.5 | ||
cache: pip | ||
|
||
# Use a two-stage approach, to minimize CI time on failures. | ||
stages: | ||
- primary | ||
- secondary | ||
|
||
env: DJANGO_SETTINGS_MODULE="settings.test_settings" | ||
|
||
jobs: | ||
include: | ||
# Basic Checks | ||
- stage: primary | ||
env: NOXSESSION=lint-3.5 | ||
- env: NOXSESSION=test-3.5 | ||
# - env: NOXSESSION=docs | ||
|
||
- stage: secondary | ||
env: NOXSESSION=test-3.6 | ||
python: 3.6 | ||
## Commented out, due to: Pinned psycopg2 not being compatible. | ||
# - env: NOXSESSION=test-3.7 | ||
# python: 3.7 | ||
## Commented out, due to: | ||
## 1. Pinned celery version not being compatible. | ||
## 2. Pinned Django version not being compatible with newer celery. | ||
## 3. Current codebase needing quite a few changes to be compatible | ||
## with newer Django. | ||
# - env: NOXSESSION=test-3.7 | ||
# python: 3.7 | ||
|
||
install: | ||
- pip install pip==9.0.1 | ||
- pip install -r requirements-dev.txt --allow-all-external | ||
- pip install coveralls | ||
- pip install --upgrade pytest | ||
# Get the latest pip | ||
- python -m pip install --upgrade pip | ||
# Reinstall pip, using the latest pip | ||
- python -m pip install --force-reinstall pip | ||
|
||
env: | ||
- DJANGO_SETTINGS_MODULE="settings.test_settings" | ||
# Install the CI dependencies | ||
- python -m pip install celery==3.1.20 # pin from requirements.txt | ||
- python -m pip install nox | ||
- python -m pip install coveralls | ||
|
||
before_script: | ||
- celery -A junction worker -l info & | ||
pradyunsg marked this conversation as resolved.
Show resolved
Hide resolved
|
||
script: | ||
- flake8 | ||
- pytest --cov -v --tb=native | ||
- coverage report -m | ||
|
||
- nox | ||
after_success: | ||
coveralls | ||
- coveralls | ||
|
||
notifications: | ||
email: | ||
on_success: change # [always|never|change] | ||
on_failure: always # [always|never|change] | ||
|
||
services: | ||
- redis-server | ||
|
||
before_script: | ||
- celery -A junction worker -l info & |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
"""Automation using nox. | ||
""" | ||
|
||
import nox | ||
|
||
|
||
@nox.session(python=["3.5", "3.6", "3.7", "3.8"]) | ||
def test(session): | ||
session.install("-r", "requirements.txt") | ||
session.install("-r", "tools/requirements-test.txt") | ||
|
||
session.run("pytest", "--cov", "-v", "--tb=native") | ||
session.run("coverage", "report", "-m") | ||
|
||
|
||
@nox.session(python=["3.5", "3.6", "3.7", "3.8"]) | ||
def lint(session): | ||
session.install("-r", "tools/requirements-lint.txt") | ||
session.run( | ||
"flake8", | ||
"--max-complexity=24", | ||
"--statistics", | ||
"--benchmark", | ||
"--ignore=E5,F4", | ||
"junction/" | ||
) | ||
# TODO: Add tests/ to the arguments above. | ||
|
||
|
||
@nox.session(python="3.5") | ||
def docs(session): | ||
session.install("-r", "tools/requirements-docs.txt") | ||
|
||
def get_sphinx_build_command(kind): | ||
return [ | ||
"sphinx-build", | ||
"-W", | ||
"-c", "docs/", # see note above | ||
"-d", "docs/build/_doctrees/" + kind, | ||
"-b", kind, | ||
"docs/" + kind, | ||
"docs/_build/" + kind, | ||
] | ||
|
||
session.run(*get_sphinx_build_command("html")) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason for choosing 3.5?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works -- every other version seems to have some issue with the outdated-and-pinned dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. Okay. Will keep a note to update this in future if needed.