Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 52 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,73 @@ version: 2
jobs:
build:
docker:
- image: circleci/python:3.6.1
- image: circleci/python:3.7.1
environment:
CC_TEST_REPORTER_ID: 183b3f0cc4e8fcd87c0395a30578d3d4211441cbf90f7704ba2dce64fa7774be
steps:
- checkout
- run:
command: |
sudo apt install python-pip
sudo pip install -U pip pipenv
name: Install OS dependencies
command: make setup-os
- run:
name: Install Code Climate Test Reporter Tool
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- run:
command: |
pipenv --python python3.6
pipenv install --dev
name: Install package dependencies
command: make setup
- run:
command: |
./cc-test-reporter before-build
./cc-test-reporter before-build
- run:
name: Run unit tests
command: make test
- run:
name: Upload test coverage to Code Climate
command: |
pipenv run pytest
./cc-test-reporter format-coverage coverage/coverage.xml -t coverage.py
./cc-test-reporter format-coverage coverage.xml -t coverage.py
./cc-test-reporter upload-coverage
- run:
command: |
pipenv run flake8
- run:
command: |
pipenv run safety check
./cc-test-reporter after-build -t coverage.py
- run:
command: make check
- store_artifacts:
path: coverage
destination: coverage

destination: htmlcov
path: htmlcov
deploy:
docker:
- image: circleci/python:3.7.1
steps:
- checkout
- run:
name: Install OS dependencies
command: make setup-os
- run:
name: Install package dependencies
command: make setup
- run:
name: init .pypirc
command: |
echo -e "[pypi]" >> ~/.pypirc
echo -e "repository = https://upload.pypi.org/legacy/"
- run:
name: Publish Package on Pypi
command: make release
workflows:
version: 2
build_and_deploy:
jobs:
- build:
filters:
tags:
only: /.*/
- deploy:
requires:
- build
filters:
tags:
only: /[0-9]+(\.[0-9]+)*/
branches:
ignore: /.*/
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.PHONY: setup-os
setup-os:
sudo apt install python-pip
sudo pip install -U pip pipenv

.PHONY: setup
setup:
pipenv --rm || true
pipenv --python python3.7
pipenv install --dev

.PHONY: test
test:
pipenv run pytest

.PHONY: check
check:
pipenv run flake8
pipenv run safety check

.PHONY: build
build:
rm -rf dist
pipenv run python setup.py sdist bdist_wheel

.PHONY: release
release: build
pipenv run twine upload dist/* || true
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ safety = "~=1.8.4"
python-json-logger = "~= 0.1.9"

[requires]
python_version = "3.6"
python_version = "3.7"
85 changes: 41 additions & 44 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[pytest]
addopts = -v -s --cov=python_log_sanitizer --cov-report html:coverage --cov-report term --cov-report xml:coverage/coverage.xml
addopts = -v -s --cov=python_log_sanitizer --cov-report html --cov-report term --cov-report xml
12 changes: 9 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
from setuptools import setup
from setuptools import setup, find_packages

__VERSION__ = "0.0.1"
with open("README.md", "r") as output:
long_description = output.read()


__VERSION__ = "0.0.2"

setup(
name="python_log_sanitizer",
version=__VERSION__,
description="Log Sanitizer",
long_description=long_description,
long_description_content_type="text/markdown",
url="http://github.com/rai200890/python_log_sanitizer",
author="Raissa Ferreira",
author_email="rai200890@gmail.com",
license="MIT",
packages=["python_log_sanitizer"],
packages=find_packages(),
python_requires=">=3.4.*",
install_requires=[],
classifiers=[
Expand Down