Skip to content

Commit

Permalink
Merge pull request #7 from lcognat/fix-tests-docs
Browse files Browse the repository at this point in the history
Fixes tests docs
  • Loading branch information
Souleymane-T committed Jan 29, 2020
2 parents b1e6c8c + 83f2ce9 commit f08ccf7
Show file tree
Hide file tree
Showing 13 changed files with 65 additions and 121 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-bandit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install bandit
pip install -e ".[security]"
- name: Bandit
run: |
bandit concrete_mailer -r --exclude tests
4 changes: 2 additions & 2 deletions .github/workflows/check-black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black
pip install -e ".[quality]"
- name: Check black
run: |
black --check concrete_mailer
black --check --line-length=79 --skip-string-normalization concrete_mailer
3 changes: 1 addition & 2 deletions .github/workflows/check-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install pylint
pip install -e ".[quality]"
- name: Lint with pylint
run: |
pylint -E concrete_mailer
7 changes: 3 additions & 4 deletions .github/workflows/check-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install pytest codecov mock pytest-cov
pip install -e ".[tests]"
- name: Test with pytest
run: |
pytest -s concrete_mailer --pyargs -q tests --cov --cov-report html --cov-report term --cov-config tests/.coveragerc
pytest -s concrete_mailer --pyargs -q tests --cov --cov-report html --cov-report term
- name: Tests coverage with CodeCov
run: |
codecov
codecov
13 changes: 6 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# How to contribute

We encourage contributing to this project and we thank you for taking the time to contribute.
We encourage contributing to this project and we thank you for taking the time to contribute.
To do so, please follow our contributing guideline:

## 1- Submit an issue
Expand All @@ -25,9 +25,9 @@ To do so, please follow our contributing guideline:
## 3- Submit changes
- Push your changes to your branch on your forked repository
- Open a pull request to the original repository
- Reference the issue you handled in your pull request.
- Reference the issue you handled in your pull request.
:no_entry_sign: **PLEASE DO NOT CLOSE THE ISSUE BY YOURSELF**
- Assign the pull request to one of the repository maintainers.
- Assign the pull request to one of the repository maintainers.
:no_entry_sign: **IF YOU ARE ONE OF THE MAINTAINERS, PLEASE DO NOT ACCEPT YOUR OWN PULL REQUESTS UNLESS YOUR CHANGES WERE REVIEWED AND VALIDATED BY AT LEAST ANOTHER MEMBER OF THE PROJECT**
- The pull request will be reviewed and discussed before any merge.

Expand All @@ -38,8 +38,7 @@ To do so, please follow our contributing guideline:
```shell
python3 -m venv env
source env/bin/activate
pip install concrete-mailer
pip install -r tests/requirements.txt
pip install -e ".[security,quality]"
```

### Ensure black
Expand All @@ -51,13 +50,13 @@ pip install -r tests/requirements.txt
#### format all files:

```shell
black --config pyproject.toml .
black --line-length=79 --skip-string-normalization concrete_mailer
```

#### check if all files ar well formatted:

```shell
black --check --config pyproject.toml .
black --check --line-length=79 --skip-string-normalization concrete_mailer
```

### Ensure lint
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@

## Description

:email: `concrete-mailer` is a python package for sending rich e-mails.
`concrete-mailer` is a python package for sending rich e-mails.

- It automatically embeds the linked image in email inline attachments.
- It avoids emails to end up in SPAM (applying best practices, with no guarantee)
- It automatically converts rich e-mails in plain-text format for receivers who have not enabled HTML format
- It allows sending e-mails with attachements
- It inlines CSS (no header in HTML e-mails)

:warning: It requires an SMTP server.
**warning** It requires an SMTP server.

## Setup the environment

Expand Down
2 changes: 1 addition & 1 deletion concrete_mailer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# coding: utf-8
from __future__ import unicode_literals


Expand Down
23 changes: 0 additions & 23 deletions pyproject.toml

This file was deleted.

47 changes: 47 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,50 @@ install_requires =
premailer>=3.6.1,<4
beautifulsoup4>=4.8.0,<5
jinja2>=2.10.1,<3

[options.extras_require]
tests =
mock
pytest-cov
pytest
codecov
security =
bandit
quality =
pylint
black; python_version >= "3.6"

[coverage:report]
# With regex
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover
skip-test-coverage
# Custom for block
PragmaContextNoCover

# Don't complain about missing debug-only code:
def __repr__
if self\.debug
if settings\.DEBUG

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError
raise RuntimeError

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:

[coverage:run]
omit =
*/tests/*

include =
*concrete_mailer*


[coverage:html]
title = concrete-mailer - Code coverage
directory = ./tests/coverage/
34 changes: 0 additions & 34 deletions tests/.coveragerc

This file was deleted.

5 changes: 2 additions & 3 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@
```shell
python3 -m venv env
source env/bin/activate
pip install concrete-mailer
pip install -r tests/requirements.txt
pip install -e ".[tests]"
```

### Run the tests

Invoke Pytest with the following args:

```shell
pytest -s concrete_mailer --pyargs -q tests --cov --cov-report html --cov-report term --cov-config tests/.coveragerc
pytest -s concrete_mailer --pyargs -q tests --cov --cov-report html --cov-report term
```

You can decide to deactivate coverage
Expand Down
7 changes: 0 additions & 7 deletions tests/requirements.txt

This file was deleted.

35 changes: 0 additions & 35 deletions tests/runtests.py

This file was deleted.

0 comments on commit f08ccf7

Please sign in to comment.