-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create a skeleton for django webserver and poetry project.
- Loading branch information
1 parent
20cc0ae
commit 3285d83
Showing
13 changed files
with
1,448 additions
and
1 deletion.
There are no files selected for viewing
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,119 @@ | ||
version: 2.1 | ||
|
||
executors: | ||
python-37: | ||
docker: | ||
- image: circleci/python:3.7 | ||
working_directory: ~/repo | ||
python-38: | ||
docker: | ||
- image: circleci/python:3.8 | ||
working_directory: ~/repo | ||
|
||
commands: | ||
test: | ||
description: "Download and run tests" | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install dependencies | ||
command: poetry install --no-dev | ||
- run: | ||
name: Run unit tests | ||
command: poetry run python -m unittest | ||
test-with-codecov: | ||
description: "Download and run tests with code coverage" | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install dependencies | ||
command: poetry install | ||
- run: | ||
name: Install codecov | ||
command: poetry run pip install codecov | ||
- run: | ||
name: Run unit tests | ||
command: poetry run coverage run -m unittest | ||
- run: | ||
name: Upload coverage to Codecov | ||
command: poetry run codecov | ||
lint: | ||
description: "Lint python files" | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install dependencies | ||
command: poetry install | ||
- run: | ||
name: Check with black | ||
command: poetry run black --check pheme | ||
- run: | ||
name: Check with pylint | ||
command: poetry run pylint --disable=R pheme | ||
deploy: | ||
description: "Upload package to PyPI" | ||
steps: | ||
- checkout | ||
- run: | ||
name: Install dependencies | ||
command: poetry install --no-dev | ||
- run: | ||
name: Install twine | ||
command: poetry run pip install twine | ||
- run: | ||
name: Initialize .pypirc | ||
command: | | ||
echo -e "[distutils]" >> ~/.pypirc | ||
echo -e "index-servers = pypi" >> ~/.pypirc | ||
echo -e "[pypi]" >> ~/.pypirc | ||
echo -e "username = __token__" >> ~/.pypirc | ||
echo -e "password = $PYPI_TOKEN" >> ~/.pypirc | ||
- run: | ||
name: Create and upload distribution to pypi | ||
command: | | ||
rm -rf dist build pheme.egg-info | ||
poetry build | ||
poetry run twine upload dist/* | ||
jobs: | ||
test-38: | ||
executor: python-38 | ||
steps: | ||
- test | ||
test-37: | ||
executor: python-37 | ||
steps: | ||
- test-with-codecov | ||
lint-37: | ||
executor: python-37 | ||
steps: | ||
- lint | ||
deploy-37: | ||
executor: python-37 | ||
steps: | ||
- deploy | ||
|
||
|
||
workflows: | ||
version: 2 | ||
build_and_test: | ||
jobs: | ||
- test-37 | ||
- test-38 | ||
- lint-37 | ||
test_and_deploy: | ||
jobs: | ||
- test-37: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
branches: | ||
ignore: /.*/ | ||
- deploy-37: | ||
requires: | ||
- test-37 | ||
filters: | ||
tags: | ||
only: /.*/ | ||
branches: | ||
ignore: /.*/ |
Oops, something went wrong.