Skip to content

Commit

Permalink
initial django setup
Browse files Browse the repository at this point in the history
create a skeleton for django webserver and poetry project.
  • Loading branch information
nichtsfrei committed Aug 12, 2020
1 parent 20cc0ae commit 3285d83
Show file tree
Hide file tree
Showing 13 changed files with 1,448 additions and 1 deletion.
119 changes: 119 additions & 0 deletions .circleci/config.yml
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: /.*/
Loading

0 comments on commit 3285d83

Please sign in to comment.