Skip to content

Commit

Permalink
Drop nox in favor of plain scripts (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
florimondmanca authored Nov 3, 2019
1 parent 85f9355 commit b33ba33
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 56 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Tooling.
.coverage
.nox/
venv*/
.python-version

Expand Down
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ jobs:
include:
- python: 3.7
name: "Check"
install: pip install --upgrade nox
script: nox -s check
script: scripts/check

script:
- scripts/test
Expand Down
47 changes: 0 additions & 47 deletions noxfile.py

This file was deleted.

3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
-e .

autoflake
black
fastapi==0.*
flake8
Expand All @@ -8,7 +9,7 @@ flake8-comprehensions
isort
httpx
mypy
nox
pytest
pytest-asyncio
pytest-cov
seed-isort-config
14 changes: 14 additions & 0 deletions scripts/check
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh -e

export PREFIX=""
if [ -d 'venv' ] ; then
export PREFIX="venv/bin/"
fi
export SOURCE_FILES="src/ddtrace_asgi tests"

set -x

${PREFIX}black --check --diff --target-version=py36 $SOURCE_FILES
${PREFIX}flake8 $SOURCE_FILES
${PREFIX}mypy $SOURCE_FILES
${PREFIX}isort --check --diff --project=ddtrace_asgi --recursive $SOURCE_FILES
14 changes: 14 additions & 0 deletions scripts/lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh -e

export PREFIX=""
if [ -d 'venv' ] ; then
export PREFIX="venv/bin/"
fi
export SOURCE_FILES="src/ddtrace_asgi tests"

set -x

${PREFIX}autoflake --in-place --recursive $SOURCE_FILES
${PREFIX}seed-isort-config --application-directories=ddtrace_asgi
${PREFIX}isort --project=ddtrace_asgi --recursive --apply $SOURCE_FILES
${PREFIX}black --target-version=py36 $SOURCE_FILES
5 changes: 1 addition & 4 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ if [ -d 'venv' ] ; then
export PREFIX="venv/bin/"
fi

export VERSION_SCRIPT="import sys; print('%s.%s' % sys.version_info[0:2])"
export PYTHON_VERSION=`${PREFIX}python -c "$VERSION_SCRIPT"`

set -x

${PREFIX}nox -s test-${PYTHON_VERSION}
${PREFIX}pytest $@
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ combine_as_imports = True
force_grid_wrap = 0
include_trailing_comma = True
known_first_party = ddtrace_asgi,tests
known_third_party = ddtrace,fastapi,httpx,nox,pytest,setuptools,starlette
known_third_party = ddtrace,fastapi,httpx,pytest,setuptools,starlette
line_length = 88
multi_line_output = 3

Expand Down

0 comments on commit b33ba33

Please sign in to comment.