Skip to content

Commit

Permalink
Initial (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
cariad authored Nov 27, 2021
1 parent a81a7b0 commit 11c4eeb
Show file tree
Hide file tree
Showing 87 changed files with 3,948 additions and 2 deletions.
215 changes: 215 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,215 @@
version: 2.1

orbs:
codecov: codecov/codecov@3.0.0

jobs:
cache:
docker:
- image: cimg/python:3.10.0
resource_class: xlarge
steps:
- checkout
- restore_cache:
keys:
- pipenv-{{ checksum "Pipfile.lock" }}
- pipenv-
- run: pipenv sync --dev
- save_cache:
key: pipenv-{{ checksum "Pipfile.lock" }}
paths:
- .venv

lint_black:
docker:
- image: cimg/python:3.10.0
resource_class: xlarge
steps:
- checkout
- restore_cache:
keys:
- pipenv-{{ checksum "Pipfile.lock" }}
- pipenv-
- run: pipenv sync --dev
- run: pipenv run ./scripts/lint-black.sh

lint_flake8:
docker:
- image: cimg/python:3.10.0
resource_class: xlarge
steps:
- checkout
- restore_cache:
keys:
- pipenv-{{ checksum "Pipfile.lock" }}
- pipenv-
- run: pipenv sync --dev
- run: pipenv run ./scripts/lint-flake8.sh

lint_isort:
docker:
- image: cimg/python:3.10.0
resource_class: xlarge
steps:
- checkout
- restore_cache:
keys:
- pipenv-{{ checksum "Pipfile.lock" }}
- pipenv-
- run: pipenv sync --dev
- run: pipenv run ./scripts/lint-isort.sh

lint_package_types:
docker:
- image: cimg/python:3.10.0
resource_class: xlarge
steps:
- checkout
- restore_cache:
keys:
- pipenv-{{ checksum "Pipfile.lock" }}
- pipenv-
- restore_cache:
keys:
- mypy-package-{{ .Branch }}
- mypy-package-main
- run: pipenv sync --dev
- run: pipenv run ./scripts/lint-package-types.sh
- save_cache:
key: mypy-package-{{ .Branch }}
paths:
- .mypy_cache

lint_shell:
docker:
- image: cimg/python:3.10.0
resource_class: xlarge
steps:
- checkout
- restore_cache:
keys:
- pipenv-{{ checksum "Pipfile.lock" }}
- pipenv-
- run: pipenv sync --dev
- run: pipenv run ./scripts/lint-shell.sh

lint_test_types:
docker:
- image: cimg/python:3.10.0
resource_class: xlarge
steps:
- checkout
- restore_cache:
keys:
- pipenv-{{ checksum "Pipfile.lock" }}
- pipenv-
- restore_cache:
keys:
- mypy-test-{{ .Branch }}
- mypy-test-main
- run: pipenv sync --dev
- run: pipenv run ./scripts/lint-test-types.sh
- save_cache:
key: mypy-test-{{ .Branch }}
paths:
- .mypy_cache

lint_yaml:
docker:
- image: cimg/python:3.10.0
resource_class: xlarge
steps:
- checkout
- restore_cache:
keys:
- pipenv-{{ checksum "Pipfile.lock" }}
- pipenv-
- run: pipenv sync --dev
- run: pipenv run ./scripts/lint-yaml.sh

test:
docker:
- image: cimg/python:3.10.0
resource_class: xlarge
steps:
- checkout
- restore_cache:
keys:
- pipenv-{{ checksum "Pipfile.lock" }}
- pipenv-
- run: pipenv sync --dev
- run: pipenv run ./scripts/test.sh
- codecov/upload:
file: coverage.xml

build:
docker:
- image: cimg/python:3.10.0
resource_class: xlarge
steps:
- checkout
- restore_cache:
keys:
- pipenv-{{ checksum "Pipfile.lock" }}
- pipenv-
- run: pipenv sync --dev
- run: pipenv run ./scripts/build.sh
- run: pip install dist/*
- run: if [[ -z "${CIRCLE_TAG}" ]]; then circleci-agent step halt; fi
- run: pipenv run twine upload dist/*

workflows:
default:
jobs:
- cache:
context:
- python
filters:
branches:
only: /.*/
- lint_black:
context:
- python
- lint_flake8:
context:
- python
- lint_isort:
context:
- python
- lint_package_types:
context:
- python
- lint_shell:
context:
- python
- lint_test_types:
context:
- python
- lint_yaml:
context:
- python
- test:
context:
- python
filters:
branches:
only: /.*/
tags:
only: /.*/
- build:
context:
- python
filters:
branches:
only: /.*/
tags:
only: /.*/
requires:
- lint_black
- lint_flake8
- lint_isort
- lint_package_types
- lint_shell
- lint_test_types
- lint_yaml
- test
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
exclude = .venv,dist
ignore = E501, W503
max-line-length = 88
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: cariad
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
__pycache__
.coverage
asking.egg-info
coverage.xml
dist
12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"cSpell.words": [
"ansiwrap",
"epilog",
"falsiness",
"jonathaneunice",
"mypy",
"pyyaml",
"ruamel",
"xlarge"
]
}
9 changes: 9 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends: default

ignore: |
.venv
rules:
document-start: disable
line-length:
max: 88
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include asking/VERSION
30 changes: 30 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[dev-packages]
black = "==21.10b0"
edition = "==1.0.0a11"
flake8 = "*"
isort = "*"
mypy = "*"
pytest = "*"
pytest-cov = "*"
shellcheck-py = "*"
twine = "*"
types-pyyaml = "~=6.0"
yamllint = "*"

[packages]
ansiwrap = "~=0.8"
cline = "~=1.1"
pyyaml = "~=6.0"

[requires]
python_version = "3.10"

[scripts]
build = "./scripts/build.sh"
lint = "./scripts/lint.sh"
test = "./scripts/test.sh"
Loading

0 comments on commit 11c4eeb

Please sign in to comment.