Skip to content

Commit fad33cb

Browse files
committed
🔧 Add scripts
1 parent c24269f commit fad33cb

File tree

11 files changed

+73
-0
lines changed

11 files changed

+73
-0
lines changed

scripts/build-docs.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
python -m mkdocs build
4+
5+
cp ./docs/index.md ./README.md

scripts/clean.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh -e
2+
3+
if [ -d 'dist' ] ; then
4+
rm -r dist
5+
fi
6+
if [ -d 'site' ] ; then
7+
rm -r site
8+
fi

scripts/deploy.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
bash scripts/publish.sh
6+
7+
bash scripts/trigger-docker.sh
8+
9+
python scripts/gitter_releases_bot.py

scripts/docs-live.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
mkdocs serve --dev-addr 0.0.0.0:8008

scripts/format-imports.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh -e
2+
set -x
3+
4+
# Sort imports one per line, so autoflake can remove unused imports
5+
isort --recursive --force-single-line-imports --thirdparty typer --apply typer tests docs/src
6+
sh ./scripts/format.sh

scripts/format.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh -e
2+
set -x
3+
4+
autoflake --remove-all-unused-imports --recursive --remove-unused-variables --in-place docs/src/ typer tests --exclude=__init__.py
5+
black typer tests docs/src
6+
isort --multi-line=3 --trailing-comma --force-grid-wrap=0 --combine-as --line-width 88 --recursive --thirdparty typer --apply typer tests docs/src

scripts/lint.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
set -x
5+
6+
mypy typer --disallow-untyped-defs
7+
black typer tests --check
8+
isort --multi-line=3 --trailing-comma --force-grid-wrap=0 --combine-as --line-width 88 --recursive --check-only --thirdparty typer typer tests

scripts/netlify-docs.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
# Install Flit to be able to install all
3+
pip install flit
4+
# Install with Flit
5+
flit install --deps develop
6+
# Finally, run mkdocs
7+
mkdocs build

scripts/publish.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
flit publish

scripts/test-cov-html.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
set -x
5+
6+
bash scripts/test.sh --cov-report=html ${@}

scripts/test.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
set -x
5+
6+
export PYTHONPATH=./docs/src
7+
pytest --cov=typer --cov=tests --cov=docs/src --cov-report=term-missing ${@}
8+
bash ./scripts/lint.sh

0 commit comments

Comments
 (0)