From bbcced9dc1afb8f0f05cf83c8e5966f4705b6b71 Mon Sep 17 00:00:00 2001 From: renzon Date: Mon, 30 Apr 2018 11:13:17 -0300 Subject: [PATCH 01/99] Suportado python 3 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 99946f208..843aad63d 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ Nesse curso é ensinado como contribuir com projetos de código aberto Link para o curso [Python Pro](https://www.python.pro.br/) +Suportada versão 3 de Python + Tópicos a serem abordados: 1. Git 2. Virtualenv From 20c0a67bbd99b9e47b950f9753fb72a8423ef0ea Mon Sep 17 00:00:00 2001 From: renzon Date: Mon, 30 Apr 2018 16:53:08 -0300 Subject: [PATCH 02/99] =?UTF-8?q?Criada=20fun=C3=A7=C3=A3o=20para=20buscar?= =?UTF-8?q?=20avatar=20de=20usu=C3=A1rio=20no=20github?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #11 --- libpythonpro/__init__.py | 0 libpythonpro/github_api.py | 17 +++++++++++++++++ requirements.txt | 5 +++++ 3 files changed, 22 insertions(+) create mode 100644 libpythonpro/__init__.py create mode 100644 libpythonpro/github_api.py create mode 100644 requirements.txt diff --git a/libpythonpro/__init__.py b/libpythonpro/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/libpythonpro/github_api.py b/libpythonpro/github_api.py new file mode 100644 index 000000000..7d29e4e68 --- /dev/null +++ b/libpythonpro/github_api.py @@ -0,0 +1,17 @@ +import requests + + +def buscar_avatar(usuario): + """ + Busca o avatar de um usuário no Github + + :param usuario: str com o nome de usuário no github + :return: str com o link do avatar + """ + url = f'https://api.github.com/users/{usuario}' + resp = requests.get(url) + return resp.json()['avatar_url'] + + +if __name__ == '__main__': + print(buscar_avatar('renzon')) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 000000000..585fa8413 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +certifi==2018.4.16 +chardet==3.0.4 +idna==2.6 +requests==2.18.4 +urllib3==1.22 From 740c9d3646602d171d42a16e8c13ef85bc8fa156 Mon Sep 17 00:00:00 2001 From: renzon Date: Mon, 30 Apr 2018 17:17:15 -0300 Subject: [PATCH 03/99] =?UTF-8?q?Adcionada=20flake8=20como=20depend=C3=AAn?= =?UTF-8?q?cia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #12 --- .flake8 | 3 +++ README.md | 15 +++++++++++++++ requirements-dev.txt | 5 +++++ 3 files changed, 23 insertions(+) create mode 100644 .flake8 create mode 100644 requirements-dev.txt diff --git a/.flake8 b/.flake8 new file mode 100644 index 000000000..796971547 --- /dev/null +++ b/.flake8 @@ -0,0 +1,3 @@ +[flake8] +max-line-length = 120 +exclude=.venv \ No newline at end of file diff --git a/README.md b/README.md index 843aad63d..bec08ee59 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,21 @@ Link para o curso [Python Pro](https://www.python.pro.br/) Suportada versão 3 de Python +Para instalar: + +```console +python3 -m venv .venv +source .venv/bin/activate +pip install -r requirements-dev.txt +``` + +Para conferir qualidade de código: + +```console +flake8 + +``` + Tópicos a serem abordados: 1. Git 2. Virtualenv diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 000000000..a9fca4b76 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,5 @@ +flake8==3.5.0 +mccabe==0.6.1 +pycodestyle==2.3.1 +pyflakes==1.6.0 +-r requirements.txt \ No newline at end of file From 0d9cd7d4e3bfa961e81097803dcc3583190076e0 Mon Sep 17 00:00:00 2001 From: renzon Date: Mon, 30 Apr 2018 17:30:17 -0300 Subject: [PATCH 04/99] Configurado Travis CI close #13 --- .travis.yml | 8 ++++++++ README.md | 2 ++ 2 files changed, 10 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..59e09ad83 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +language: python +python: + - 3.6 + - 2.7 +install: + - pip install -r requirements-dev.txt +script: + - flake8 \ No newline at end of file diff --git a/README.md b/README.md index bec08ee59..980f7db5c 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ Nesse curso é ensinado como contribuir com projetos de código aberto Link para o curso [Python Pro](https://www.python.pro.br/) +[![Build Status](https://travis-ci.org/pythonprobr/libpythonpro.svg?branch=master)](https://travis-ci.org/pythonprobr/libpythonpro) + Suportada versão 3 de Python Para instalar: From 126c34e70e68a361f1a0f69f59c1acc5e54adaa7 Mon Sep 17 00:00:00 2001 From: renzon Date: Mon, 30 Apr 2018 17:34:12 -0300 Subject: [PATCH 05/99] Retirando python 2 do .travis close #13 --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 59e09ad83..cd7f5649e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: python python: - 3.6 - - 2.7 install: - pip install -r requirements-dev.txt script: From f8b72618746afce88612966e496e3bdf00d703eb Mon Sep 17 00:00:00 2001 From: renzon Date: Mon, 30 Apr 2018 17:36:00 -0300 Subject: [PATCH 06/99] Removendo detalhes de dependencias durante o build close #13 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cd7f5649e..3a1469e52 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,6 @@ language: python python: - 3.6 install: - - pip install -r requirements-dev.txt + - pip install -q -r requirements-dev.txt script: - flake8 \ No newline at end of file From 2f74079ec0e642d912c54ce2824177522f6d1a57 Mon Sep 17 00:00:00 2001 From: renzon Date: Sat, 5 May 2018 06:25:14 -0300 Subject: [PATCH 07/99] Fazendo downgrade da lib requests --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 585fa8413..86431e80a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ certifi==2018.4.16 chardet==3.0.4 idna==2.6 -requests==2.18.4 +requests==2.18.3 urllib3==1.22 From 06b97842f0a58854d835a0b68d297fba10e356a7 Mon Sep 17 00:00:00 2001 From: renzon Date: Sat, 5 May 2018 06:36:18 -0300 Subject: [PATCH 08/99] Integrado com PyUp --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 980f7db5c..2af950ccc 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ Nesse curso é ensinado como contribuir com projetos de código aberto Link para o curso [Python Pro](https://www.python.pro.br/) [![Build Status](https://travis-ci.org/pythonprobr/libpythonpro.svg?branch=master)](https://travis-ci.org/pythonprobr/libpythonpro) +[![Updates](https://pyup.io/repos/github/pythonprobr/libpythonpro/shield.svg)](https://pyup.io/repos/github/pythonprobr/libpythonpro/) +[![Python 3](https://pyup.io/repos/github/pythonprobr/libpythonpro/python-3-shield.svg)](https://pyup.io/repos/github/pythonprobr/libpythonpro/) Suportada versão 3 de Python From a8bf1ae4dd2708f6636d7c1167834c07b5d84fa9 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sat, 5 May 2018 06:39:02 -0300 Subject: [PATCH 09/99] Update requests from 2.18.3 to 2.18.4 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 86431e80a..585fa8413 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ certifi==2018.4.16 chardet==3.0.4 idna==2.6 -requests==2.18.3 +requests==2.18.4 urllib3==1.22 From 332f139429c41d4f9c088a8bb1261500b4fcadff Mon Sep 17 00:00:00 2001 From: renzon Date: Sun, 6 May 2018 13:09:45 -0300 Subject: [PATCH 10/99] Criado setup.py, pronto para release 0.1 close #18 --- libpythonpro/__init__.py | 1 + setup.py | 140 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 setup.py diff --git a/libpythonpro/__init__.py b/libpythonpro/__init__.py index e69de29bb..11d27f8c7 100644 --- a/libpythonpro/__init__.py +++ b/libpythonpro/__init__.py @@ -0,0 +1 @@ +__version__ = '0.1' diff --git a/setup.py b/setup.py new file mode 100644 index 000000000..c5fa366d4 --- /dev/null +++ b/setup.py @@ -0,0 +1,140 @@ +import codecs +import os +import sys + +from distutils.util import convert_path +from fnmatch import fnmatchcase +from setuptools import setup, find_packages + + +def read(fname): + return codecs.open(os.path.join(os.path.dirname(__file__), fname)).read() + + +# Provided as an attribute, so you can append to these instead +# of replicating them: +standard_exclude = ["*.py", "*.pyc", "*$py.class", "*~", ".*", "*.bak"] +standard_exclude_directories = [ + ".*", "CVS", "_darcs", "./build", "./dist", "EGG-INFO", "*.egg-info" +] + + +# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org) +# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php +# Note: you may want to copy this into your setup.py file verbatim, as +# you can't import this from another package, when you don't know if +# that package is installed yet. +def find_package_data( + where=".", + package="", + exclude=standard_exclude, + exclude_directories=standard_exclude_directories, + only_in_packages=True, + show_ignored=False): + """ + Return a dictionary suitable for use in ``package_data`` + in a distutils ``setup.py`` file. + + The dictionary looks like:: + + {"package": [files]} + + Where ``files`` is a list of all the files in that package that + don"t match anything in ``exclude``. + + If ``only_in_packages`` is true, then top-level directories that + are not packages won"t be included (but directories under packages + will). + + Directories matching any pattern in ``exclude_directories`` will + be ignored; by default directories with leading ``.``, ``CVS``, + and ``_darcs`` will be ignored. + + If ``show_ignored`` is true, then all the files that aren"t + included in package data are shown on stderr (for debugging + purposes). + + Note patterns use wildcards, or can be exact paths (including + leading ``./``), and all searching is case-insensitive. + """ + out = {} + stack = [(convert_path(where), "", package, only_in_packages)] + while stack: + where, prefix, package, only_in_packages = stack.pop(0) + for name in os.listdir(where): + fn = os.path.join(where, name) + if os.path.isdir(fn): + bad_name = False + for pattern in exclude_directories: + if (fnmatchcase(name, pattern) + or fn.lower() == pattern.lower()): + bad_name = True + if show_ignored: + print >> sys.stderr, ( + "Directory %s ignored by pattern %s" + % (fn, pattern)) + break + if bad_name: + continue + if (os.path.isfile(os.path.join(fn, "__init__.py")) + and not prefix): + if not package: + new_package = name + else: + new_package = package + "." + name + stack.append((fn, "", new_package, False)) + else: + stack.append((fn, prefix + name + "/", package, only_in_packages)) + elif package or not only_in_packages: + # is a file + bad_name = False + for pattern in exclude: + if (fnmatchcase(name, pattern) + or fn.lower() == pattern.lower()): + bad_name = True + if show_ignored: + print >> sys.stderr, ( + "File %s ignored by pattern %s" + % (fn, pattern)) + break + if bad_name: + continue + out.setdefault(package, []).append(prefix + name) + return out + + +PACKAGE = "libpythonpro" +NAME = PACKAGE +DESCRIPTION = "Módulo para exemplificar construção de projetos Python no curso PyTools" +AUTHOR = "Renzo Nuccitelli" +AUTHOR_EMAIL = "renzo@python.pro.br" +URL = "https://github.com/pythonprobr/libpythonpro" +VERSION = __import__(PACKAGE).__version__ + +setup( + name=NAME, + version=VERSION, + description=DESCRIPTION, + long_description=read('README.md'), + long_description_content_type='text/markdown', + author=AUTHOR, + author_email=AUTHOR_EMAIL, + license=read('LICENSE'), + url=URL, + packages=find_packages(exclude=["tests.*", "tests"]), + package_data=find_package_data(PACKAGE, only_in_packages=False), + classifiers=[ + "Development Status :: 2 - Pre-Alpha", + "Environment :: Console", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3.6", + "Framework :: Pytest", + ], + install_requires=[ + 'requests' + ], + zip_safe=False, +) From 08e245ec3c34bdf7567b36b2f4371c0f8809a6d0 Mon Sep 17 00:00:00 2001 From: renzon Date: Sun, 6 May 2018 15:20:52 -0300 Subject: [PATCH 11/99] =?UTF-8?q?Consertado=20bug=20na=20instala=C3=A7?= =?UTF-8?q?=C3=A3o=20via=20PyPi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Esse é o release da versão 0.2 --- MANIFEST.in | 2 ++ libpythonpro/__init__.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 000000000..74215c3ee --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,2 @@ +include README.md +include LICENSE \ No newline at end of file diff --git a/libpythonpro/__init__.py b/libpythonpro/__init__.py index 11d27f8c7..b650ceb08 100644 --- a/libpythonpro/__init__.py +++ b/libpythonpro/__init__.py @@ -1 +1 @@ -__version__ = '0.1' +__version__ = '0.2' From 4673d49ddb2c5446c90c6fd001a39e0852d6ca76 Mon Sep 17 00:00:00 2001 From: renzon Date: Sat, 12 May 2018 08:55:55 -0300 Subject: [PATCH 12/99] Inserido teste com pytest close #21 --- .travis.yml | 3 ++- libpythonpro/tests/__init__.py | 0 libpythonpro/tests/test_exemplo.py | 2 ++ requirements-dev.txt | 8 ++++++++ 4 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 libpythonpro/tests/__init__.py create mode 100644 libpythonpro/tests/test_exemplo.py diff --git a/.travis.yml b/.travis.yml index 3a1469e52..1d9431375 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,4 +4,5 @@ python: install: - pip install -q -r requirements-dev.txt script: - - flake8 \ No newline at end of file + - flake8 + - pytest libpythonpro \ No newline at end of file diff --git a/libpythonpro/tests/__init__.py b/libpythonpro/tests/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/libpythonpro/tests/test_exemplo.py b/libpythonpro/tests/test_exemplo.py new file mode 100644 index 000000000..78cd50236 --- /dev/null +++ b/libpythonpro/tests/test_exemplo.py @@ -0,0 +1,2 @@ +def test_int(): + assert 1 == 1 diff --git a/requirements-dev.txt b/requirements-dev.txt index a9fca4b76..d7d25f1e2 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,4 +2,12 @@ flake8==3.5.0 mccabe==0.6.1 pycodestyle==2.3.1 pyflakes==1.6.0 + +# Deps do pytest +py==1.5.3 +more-itertools==4.1.0 +six==1.11.0 +attrs==18.1.0 +pluggy==0.6.0 +pytest==3.5.1 -r requirements.txt \ No newline at end of file From a63945744f63848c622294103dd374687db66ad4 Mon Sep 17 00:00:00 2001 From: renzon Date: Sat, 12 May 2018 09:36:22 -0300 Subject: [PATCH 13/99] =?UTF-8?q?Acresecentada=20cobertura=20de=20c=C3=B3d?= =?UTF-8?q?igo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #23 --- .travis.yml | 6 ++++-- README.md | 1 + requirements-dev.txt | 6 ++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1d9431375..0944b0b06 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,9 @@ language: python python: - 3.6 install: - - pip install -q -r requirements-dev.txt + - pip install -q -r requirements-dev.txt codecov script: - flake8 - - pytest libpythonpro \ No newline at end of file + - pytest libpythonpro --cov=libpythonpro +after_success: + - codecov \ No newline at end of file diff --git a/README.md b/README.md index 2af950ccc..cf235dd67 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Link para o curso [Python Pro](https://www.python.pro.br/) [![Build Status](https://travis-ci.org/pythonprobr/libpythonpro.svg?branch=master)](https://travis-ci.org/pythonprobr/libpythonpro) [![Updates](https://pyup.io/repos/github/pythonprobr/libpythonpro/shield.svg)](https://pyup.io/repos/github/pythonprobr/libpythonpro/) [![Python 3](https://pyup.io/repos/github/pythonprobr/libpythonpro/python-3-shield.svg)](https://pyup.io/repos/github/pythonprobr/libpythonpro/) +[![codecov](https://codecov.io/gh/pythonprobr/libpythonpro/branch/master/graph/badge.svg)](https://codecov.io/gh/pythonprobr/libpythonpro) Suportada versão 3 de Python diff --git a/requirements-dev.txt b/requirements-dev.txt index d7d25f1e2..d08fc4414 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -10,4 +10,10 @@ six==1.11.0 attrs==18.1.0 pluggy==0.6.0 pytest==3.5.1 + + +#Converage +coverage==4.5.1 +pytest-cov==2.5.1 + -r requirements.txt \ No newline at end of file From 7169f89e27a49459224ea0904f96211feadbf6ae Mon Sep 17 00:00:00 2001 From: renzon Date: Sat, 12 May 2018 16:04:11 -0300 Subject: [PATCH 14/99] =?UTF-8?q?C=C3=B3digo=20sobre=20TDD=20e=20Baby=20St?= =?UTF-8?q?eps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libpythonpro/spam/__init__.py | 0 libpythonpro/spam/enviador_de_email.py | 3 +++ libpythonpro/tests/test_spam/__init__.py | 0 .../tests/test_spam/test_enviador_de_email.py | 17 +++++++++++++++++ 4 files changed, 20 insertions(+) create mode 100644 libpythonpro/spam/__init__.py create mode 100644 libpythonpro/spam/enviador_de_email.py create mode 100644 libpythonpro/tests/test_spam/__init__.py create mode 100644 libpythonpro/tests/test_spam/test_enviador_de_email.py diff --git a/libpythonpro/spam/__init__.py b/libpythonpro/spam/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/libpythonpro/spam/enviador_de_email.py b/libpythonpro/spam/enviador_de_email.py new file mode 100644 index 000000000..684f833d5 --- /dev/null +++ b/libpythonpro/spam/enviador_de_email.py @@ -0,0 +1,3 @@ +class Enviador: + def enviar(self, remetente, destinatario, assunto, corpo): + return 'renzo@python.pro.br' diff --git a/libpythonpro/tests/test_spam/__init__.py b/libpythonpro/tests/test_spam/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/libpythonpro/tests/test_spam/test_enviador_de_email.py b/libpythonpro/tests/test_spam/test_enviador_de_email.py new file mode 100644 index 000000000..325b5a393 --- /dev/null +++ b/libpythonpro/tests/test_spam/test_enviador_de_email.py @@ -0,0 +1,17 @@ +from libpythonpro.spam.enviador_de_email import Enviador + + +def test_criar_enviador_de_email(): + enviador = Enviador() + assert enviador is not None + + +def test_remetente(): + enviador = Enviador() + resultado = enviador.enviar( + 'renzo@python.pro.br', + 'luciano@python.pro.br', + 'Cursos Python Pro', + 'Primeira turma Guido Von Rossum aberta.' + ) + assert 'renzo@python.pro.br' in resultado From e88f4e56f85a05ff7d8746690488187bf45e5729 Mon Sep 17 00:00:00 2001 From: renzon Date: Mon, 14 May 2018 20:46:53 -0300 Subject: [PATCH 15/99] =?UTF-8?q?C=C3=B3digo=20sobre=20TDD=20e=20Baby=20St?= =?UTF-8?q?eps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libpythonpro/spam/enviador_de_email.py | 2 +- .../tests/test_spam/test_enviador_de_email.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/libpythonpro/spam/enviador_de_email.py b/libpythonpro/spam/enviador_de_email.py index 684f833d5..b1ce285b7 100644 --- a/libpythonpro/spam/enviador_de_email.py +++ b/libpythonpro/spam/enviador_de_email.py @@ -1,3 +1,3 @@ class Enviador: def enviar(self, remetente, destinatario, assunto, corpo): - return 'renzo@python.pro.br' + return remetente diff --git a/libpythonpro/tests/test_spam/test_enviador_de_email.py b/libpythonpro/tests/test_spam/test_enviador_de_email.py index 325b5a393..817a1f52a 100644 --- a/libpythonpro/tests/test_spam/test_enviador_de_email.py +++ b/libpythonpro/tests/test_spam/test_enviador_de_email.py @@ -1,3 +1,5 @@ +import pytest + from libpythonpro.spam.enviador_de_email import Enviador @@ -6,12 +8,16 @@ def test_criar_enviador_de_email(): assert enviador is not None -def test_remetente(): +@pytest.mark.parametrize( + 'destinatario', + ['foo@bar.com.br', 'renzo@python.pro.br'] +) +def test_remetente(destinatario): enviador = Enviador() resultado = enviador.enviar( - 'renzo@python.pro.br', + destinatario, 'luciano@python.pro.br', 'Cursos Python Pro', 'Primeira turma Guido Von Rossum aberta.' ) - assert 'renzo@python.pro.br' in resultado + assert destinatario in resultado From 5f8d6b16c2e0d66a4e9db2d60af53df226db80c6 Mon Sep 17 00:00:00 2001 From: renzon Date: Wed, 16 May 2018 14:57:43 -0300 Subject: [PATCH 16/99] Consertando nome de parametro em teste de remetente --- libpythonpro/tests/test_spam/test_enviador_de_email.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libpythonpro/tests/test_spam/test_enviador_de_email.py b/libpythonpro/tests/test_spam/test_enviador_de_email.py index 817a1f52a..20100797c 100644 --- a/libpythonpro/tests/test_spam/test_enviador_de_email.py +++ b/libpythonpro/tests/test_spam/test_enviador_de_email.py @@ -9,15 +9,15 @@ def test_criar_enviador_de_email(): @pytest.mark.parametrize( - 'destinatario', + 'remetente', ['foo@bar.com.br', 'renzo@python.pro.br'] ) -def test_remetente(destinatario): +def test_remetente(remetente): enviador = Enviador() resultado = enviador.enviar( - destinatario, + remetente, 'luciano@python.pro.br', 'Cursos Python Pro', 'Primeira turma Guido Von Rossum aberta.' ) - assert destinatario in resultado + assert remetente in resultado From c991b9b9741d809d31f43862c08e92429030cac7 Mon Sep 17 00:00:00 2001 From: renzon Date: Wed, 16 May 2018 16:23:36 -0300 Subject: [PATCH 17/99] =?UTF-8?q?Criado=20teste=20de=20exce=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libpythonpro/spam/enviador_de_email.py | 6 ++++++ .../tests/test_spam/test_enviador_de_email.py | 17 ++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/libpythonpro/spam/enviador_de_email.py b/libpythonpro/spam/enviador_de_email.py index b1ce285b7..fa0952223 100644 --- a/libpythonpro/spam/enviador_de_email.py +++ b/libpythonpro/spam/enviador_de_email.py @@ -1,3 +1,9 @@ class Enviador: def enviar(self, remetente, destinatario, assunto, corpo): + if '@' not in remetente: + raise EmailInvalido(f'Email de remetente inválido: {remetente}') return remetente + + +class EmailInvalido(Exception): + pass diff --git a/libpythonpro/tests/test_spam/test_enviador_de_email.py b/libpythonpro/tests/test_spam/test_enviador_de_email.py index 20100797c..1be6631bd 100644 --- a/libpythonpro/tests/test_spam/test_enviador_de_email.py +++ b/libpythonpro/tests/test_spam/test_enviador_de_email.py @@ -1,6 +1,6 @@ import pytest -from libpythonpro.spam.enviador_de_email import Enviador +from libpythonpro.spam.enviador_de_email import Enviador, EmailInvalido def test_criar_enviador_de_email(): @@ -21,3 +21,18 @@ def test_remetente(remetente): 'Primeira turma Guido Von Rossum aberta.' ) assert remetente in resultado + + +@pytest.mark.parametrize( + 'remetente', + ['', 'renzo'] +) +def test_remetente_invalido(remetente): + enviador = Enviador() + with pytest.raises(EmailInvalido): + enviador.enviar( + remetente, + 'luciano@python.pro.br', + 'Cursos Python Pro', + 'Primeira turma Guido Von Rossum aberta.' + ) From 6759e31c4e11aa0b9723a9808cd14c241c08a464 Mon Sep 17 00:00:00 2001 From: renzon Date: Wed, 16 May 2018 16:54:35 -0300 Subject: [PATCH 18/99] =?UTF-8?q?Criado=20c=C3=B3digo=20base=20de=20teste?= =?UTF-8?q?=20de=20usu=C3=A1rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libpythonpro/tests/test_spam/test_usuarios.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 libpythonpro/tests/test_spam/test_usuarios.py diff --git a/libpythonpro/tests/test_spam/test_usuarios.py b/libpythonpro/tests/test_spam/test_usuarios.py new file mode 100644 index 000000000..37214fa2a --- /dev/null +++ b/libpythonpro/tests/test_spam/test_usuarios.py @@ -0,0 +1,21 @@ +def test_salvar_usuario(): + conexao = Conexao() + sessao = conexao.gerar_sessao() + usuario = Usuario(nome='Renzo') + sessao.salvar(usuario) + assert isinstance(usuario.id, int) + sessao.roll_back() + sessao.fechar() + conexao.fechar() + + +def test_listar_usuarios(): + conexao = Conexao() + sessao = conexao.gerar_sessao() + usuarios = [Usuario(nome='Renzo'), Usuario(nome='Luciano')] + for usuario in usuarios: + sessao.salvar(usuario) + assert usuario == sessao.listar() + sessao.roll_back() + sessao.fechar() + conexao.fechar() From f7c587bc48d10ec4377b3292211306ec9f2d0acc Mon Sep 17 00:00:00 2001 From: renzon Date: Wed, 16 May 2018 17:11:10 -0300 Subject: [PATCH 19/99] =?UTF-8?q?Implementada=20vers=C3=A3o=20Inicial=20de?= =?UTF-8?q?=20Conexao,=20Sessao=20e=20Usuario?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libpythonpro/spam/db.py | 25 +++++++++++++++++++ libpythonpro/spam/modelos.py | 4 +++ libpythonpro/tests/test_spam/test_usuarios.py | 6 ++++- 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 libpythonpro/spam/db.py create mode 100644 libpythonpro/spam/modelos.py diff --git a/libpythonpro/spam/db.py b/libpythonpro/spam/db.py new file mode 100644 index 000000000..a09dc2359 --- /dev/null +++ b/libpythonpro/spam/db.py @@ -0,0 +1,25 @@ +class Sessao: + contador = 0 + usuarios = [] + + def salvar(self, usuario): + Sessao.contador += 1 + usuario.id = Sessao.contador + self.usuarios.append(usuario) + + def listar(self): + return self.usuarios + + def roll_back(self): + pass + + def fechar(self): + pass + + +class Conexao: + def gerar_sessao(self): + return Sessao() + + def fechar(self): + pass \ No newline at end of file diff --git a/libpythonpro/spam/modelos.py b/libpythonpro/spam/modelos.py new file mode 100644 index 000000000..f34d39cc0 --- /dev/null +++ b/libpythonpro/spam/modelos.py @@ -0,0 +1,4 @@ +class Usuario: + def __init__(self, nome): + self.nome = nome + self.id = None \ No newline at end of file diff --git a/libpythonpro/tests/test_spam/test_usuarios.py b/libpythonpro/tests/test_spam/test_usuarios.py index 37214fa2a..1eb86d16b 100644 --- a/libpythonpro/tests/test_spam/test_usuarios.py +++ b/libpythonpro/tests/test_spam/test_usuarios.py @@ -1,3 +1,7 @@ +from libpythonpro.spam.db import Conexao +from libpythonpro.spam.modelos import Usuario + + def test_salvar_usuario(): conexao = Conexao() sessao = conexao.gerar_sessao() @@ -15,7 +19,7 @@ def test_listar_usuarios(): usuarios = [Usuario(nome='Renzo'), Usuario(nome='Luciano')] for usuario in usuarios: sessao.salvar(usuario) - assert usuario == sessao.listar() + assert usuarios == sessao.listar() sessao.roll_back() sessao.fechar() conexao.fechar() From 13aefe494644dbe152f198f274cffed72c7e2649 Mon Sep 17 00:00:00 2001 From: renzon Date: Wed, 16 May 2018 17:16:10 -0300 Subject: [PATCH 20/99] Implementedo roll_back para propiciar isolamento de testes --- libpythonpro/spam/db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpythonpro/spam/db.py b/libpythonpro/spam/db.py index a09dc2359..a2f3fdaba 100644 --- a/libpythonpro/spam/db.py +++ b/libpythonpro/spam/db.py @@ -11,7 +11,7 @@ def listar(self): return self.usuarios def roll_back(self): - pass + self.usuarios.clear() def fechar(self): pass From c172a8c82919f1fd2e1060dc368bb73bc85256ee Mon Sep 17 00:00:00 2001 From: renzon Date: Wed, 16 May 2018 19:15:31 -0300 Subject: [PATCH 21/99] Extraidas Fixtures para facilitar escrita de testes --- libpythonpro/tests/test_spam/test_usuarios.py | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/libpythonpro/tests/test_spam/test_usuarios.py b/libpythonpro/tests/test_spam/test_usuarios.py index 1eb86d16b..050f69f58 100644 --- a/libpythonpro/tests/test_spam/test_usuarios.py +++ b/libpythonpro/tests/test_spam/test_usuarios.py @@ -1,25 +1,34 @@ +import pytest + from libpythonpro.spam.db import Conexao from libpythonpro.spam.modelos import Usuario -def test_salvar_usuario(): - conexao = Conexao() - sessao = conexao.gerar_sessao() +@pytest.fixture +def conexao(): + # Setup + conexao_obj = Conexao() + yield conexao_obj + # Tear Down + conexao_obj.fechar() + + +@pytest.fixture +def sessao(conexao): + sessao_obj = conexao.gerar_sessao() + yield sessao_obj + sessao_obj.roll_back() + sessao_obj.fechar() + + +def test_salvar_usuario(sessao): usuario = Usuario(nome='Renzo') sessao.salvar(usuario) assert isinstance(usuario.id, int) - sessao.roll_back() - sessao.fechar() - conexao.fechar() -def test_listar_usuarios(): - conexao = Conexao() - sessao = conexao.gerar_sessao() +def test_listar_usuarios(sessao): usuarios = [Usuario(nome='Renzo'), Usuario(nome='Luciano')] for usuario in usuarios: sessao.salvar(usuario) assert usuarios == sessao.listar() - sessao.roll_back() - sessao.fechar() - conexao.fechar() From fbbd1126c3d2fb71c9649eb80a1ca16311d7a7a8 Mon Sep 17 00:00:00 2001 From: renzon Date: Wed, 16 May 2018 19:25:30 -0300 Subject: [PATCH 22/99] =?UTF-8?q?Alterada=20conex=C3=A3o=20para=20escopo?= =?UTF-8?q?=20de=20m=C3=B3dulo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libpythonpro/spam/db.py | 6 ++++++ libpythonpro/tests/test_spam/test_usuarios.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libpythonpro/spam/db.py b/libpythonpro/spam/db.py index a2f3fdaba..df9f5d658 100644 --- a/libpythonpro/spam/db.py +++ b/libpythonpro/spam/db.py @@ -1,3 +1,6 @@ +from time import sleep + + class Sessao: contador = 0 usuarios = [] @@ -18,6 +21,9 @@ def fechar(self): class Conexao: + def __init__(self): + sleep(10) + def gerar_sessao(self): return Sessao() diff --git a/libpythonpro/tests/test_spam/test_usuarios.py b/libpythonpro/tests/test_spam/test_usuarios.py index 050f69f58..453f35ac5 100644 --- a/libpythonpro/tests/test_spam/test_usuarios.py +++ b/libpythonpro/tests/test_spam/test_usuarios.py @@ -4,7 +4,7 @@ from libpythonpro.spam.modelos import Usuario -@pytest.fixture +@pytest.fixture(scope='session') def conexao(): # Setup conexao_obj = Conexao() From 376bdace4cd580e424ad378bf966df6531c1263f Mon Sep 17 00:00:00 2001 From: renzon Date: Sat, 19 May 2018 17:50:24 -0300 Subject: [PATCH 23/99] Expostas fixtures em arquivo conftest.py --- libpythonpro/spam/db.py | 2 +- libpythonpro/spam/main.py | 7 +++++++ libpythonpro/tests/test_spam/conftest.py | 20 +++++++++++++++++++ .../test_envio_para_base_de_usuarios.py | 11 ++++++++++ libpythonpro/tests/test_spam/test_usuarios.py | 20 ------------------- 5 files changed, 39 insertions(+), 21 deletions(-) create mode 100644 libpythonpro/spam/main.py create mode 100644 libpythonpro/tests/test_spam/conftest.py create mode 100644 libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py diff --git a/libpythonpro/spam/db.py b/libpythonpro/spam/db.py index df9f5d658..8256b7210 100644 --- a/libpythonpro/spam/db.py +++ b/libpythonpro/spam/db.py @@ -22,7 +22,7 @@ def fechar(self): class Conexao: def __init__(self): - sleep(10) + sleep(1) def gerar_sessao(self): return Sessao() diff --git a/libpythonpro/spam/main.py b/libpythonpro/spam/main.py new file mode 100644 index 000000000..f2bc4afd0 --- /dev/null +++ b/libpythonpro/spam/main.py @@ -0,0 +1,7 @@ +class EnviadorDeSpam: + def __init__(self, sessao, enviador): + self.sessao = sessao + self.enviador = enviador + + def enviar_emails(self, remetente, assunto, corpo): + pass \ No newline at end of file diff --git a/libpythonpro/tests/test_spam/conftest.py b/libpythonpro/tests/test_spam/conftest.py new file mode 100644 index 000000000..5b1066901 --- /dev/null +++ b/libpythonpro/tests/test_spam/conftest.py @@ -0,0 +1,20 @@ +import pytest + +from libpythonpro.spam.db import Conexao + + +@pytest.fixture(scope='session') +def conexao(): + # Setup + conexao_obj = Conexao() + yield conexao_obj + # Tear Down + conexao_obj.fechar() + + +@pytest.fixture +def sessao(conexao): + sessao_obj = conexao.gerar_sessao() + yield sessao_obj + sessao_obj.roll_back() + sessao_obj.fechar() \ No newline at end of file diff --git a/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py b/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py new file mode 100644 index 000000000..4a35ebe9d --- /dev/null +++ b/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py @@ -0,0 +1,11 @@ +from libpythonpro.spam.enviador_de_email import Enviador +from libpythonpro.spam.main import EnviadorDeSpam + + +def test_envio_de_spam(sessao): + enviador_de_spam = EnviadorDeSpam(sessao, Enviador()) + enviador_de_spam.enviar_emails( + 'renzo@python.pro.br', + 'Curso Python Pro', + 'Confira os módulos fantásticos' + ) diff --git a/libpythonpro/tests/test_spam/test_usuarios.py b/libpythonpro/tests/test_spam/test_usuarios.py index 453f35ac5..de33c9776 100644 --- a/libpythonpro/tests/test_spam/test_usuarios.py +++ b/libpythonpro/tests/test_spam/test_usuarios.py @@ -1,26 +1,6 @@ -import pytest - -from libpythonpro.spam.db import Conexao from libpythonpro.spam.modelos import Usuario -@pytest.fixture(scope='session') -def conexao(): - # Setup - conexao_obj = Conexao() - yield conexao_obj - # Tear Down - conexao_obj.fechar() - - -@pytest.fixture -def sessao(conexao): - sessao_obj = conexao.gerar_sessao() - yield sessao_obj - sessao_obj.roll_back() - sessao_obj.fechar() - - def test_salvar_usuario(sessao): usuario = Usuario(nome='Renzo') sessao.salvar(usuario) From 97b12148e3179030cd2e1b9250a4b52ae3427981 Mon Sep 17 00:00:00 2001 From: renzon Date: Sat, 19 May 2018 19:47:21 -0300 Subject: [PATCH 24/99] Consertada pep8 --- libpythonpro/spam/db.py | 2 +- libpythonpro/spam/modelos.py | 2 +- libpythonpro/tests/test_spam/conftest.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libpythonpro/spam/db.py b/libpythonpro/spam/db.py index 8256b7210..ce90ca60b 100644 --- a/libpythonpro/spam/db.py +++ b/libpythonpro/spam/db.py @@ -28,4 +28,4 @@ def gerar_sessao(self): return Sessao() def fechar(self): - pass \ No newline at end of file + pass diff --git a/libpythonpro/spam/modelos.py b/libpythonpro/spam/modelos.py index f34d39cc0..60cb0068e 100644 --- a/libpythonpro/spam/modelos.py +++ b/libpythonpro/spam/modelos.py @@ -1,4 +1,4 @@ class Usuario: def __init__(self, nome): self.nome = nome - self.id = None \ No newline at end of file + self.id = None diff --git a/libpythonpro/tests/test_spam/conftest.py b/libpythonpro/tests/test_spam/conftest.py index 5b1066901..a16f3970a 100644 --- a/libpythonpro/tests/test_spam/conftest.py +++ b/libpythonpro/tests/test_spam/conftest.py @@ -17,4 +17,4 @@ def sessao(conexao): sessao_obj = conexao.gerar_sessao() yield sessao_obj sessao_obj.roll_back() - sessao_obj.fechar() \ No newline at end of file + sessao_obj.fechar() From 8fe60eb100fb101c56cd48f7ac478becf2d8f17f Mon Sep 17 00:00:00 2001 From: renzon Date: Sat, 19 May 2018 20:15:23 -0300 Subject: [PATCH 25/99] =?UTF-8?q?Alterado=20c=C3=B3digo=20de=20produ=C3=A7?= =?UTF-8?q?=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libpythonpro/spam/enviador_de_email.py | 4 ++++ libpythonpro/spam/main.py | 8 ++++++- libpythonpro/spam/modelos.py | 3 ++- .../test_envio_para_base_de_usuarios.py | 23 +++++++++++++++++-- libpythonpro/tests/test_spam/test_usuarios.py | 7 ++++-- 5 files changed, 39 insertions(+), 6 deletions(-) diff --git a/libpythonpro/spam/enviador_de_email.py b/libpythonpro/spam/enviador_de_email.py index fa0952223..61788d657 100644 --- a/libpythonpro/spam/enviador_de_email.py +++ b/libpythonpro/spam/enviador_de_email.py @@ -1,7 +1,11 @@ class Enviador: + def __init__(self): + self.qtd_email_enviados = 0 + def enviar(self, remetente, destinatario, assunto, corpo): if '@' not in remetente: raise EmailInvalido(f'Email de remetente inválido: {remetente}') + self.qtd_email_enviados += 1 return remetente diff --git a/libpythonpro/spam/main.py b/libpythonpro/spam/main.py index f2bc4afd0..f81821ae4 100644 --- a/libpythonpro/spam/main.py +++ b/libpythonpro/spam/main.py @@ -4,4 +4,10 @@ def __init__(self, sessao, enviador): self.enviador = enviador def enviar_emails(self, remetente, assunto, corpo): - pass \ No newline at end of file + for usuario in self.sessao.listar(): + self.enviador.enviar( + remetente, + usuario.email, + assunto, + corpo + ) diff --git a/libpythonpro/spam/modelos.py b/libpythonpro/spam/modelos.py index 60cb0068e..093b35a2a 100644 --- a/libpythonpro/spam/modelos.py +++ b/libpythonpro/spam/modelos.py @@ -1,4 +1,5 @@ class Usuario: - def __init__(self, nome): + def __init__(self, nome, email): + self.email = email self.nome = nome self.id = None diff --git a/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py b/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py index 4a35ebe9d..34b502c48 100644 --- a/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py +++ b/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py @@ -1,11 +1,30 @@ +import pytest + from libpythonpro.spam.enviador_de_email import Enviador from libpythonpro.spam.main import EnviadorDeSpam +from libpythonpro.spam.modelos import Usuario -def test_envio_de_spam(sessao): - enviador_de_spam = EnviadorDeSpam(sessao, Enviador()) +@pytest.mark.parametrize( + 'usuarios', + [ + [ + Usuario(nome='Renzo', email='renzo@python.pro.br'), + Usuario(nome='Luciano', email='renzo@python.pro.br') + ], + [ + Usuario(nome='Renzo', email='renzo@python.pro.br') + ] + ] +) +def test_qde_de_spam(sessao, usuarios): + for usuario in usuarios: + sessao.salvar(usuario) + enviador = Enviador() + enviador_de_spam = EnviadorDeSpam(sessao, enviador) enviador_de_spam.enviar_emails( 'renzo@python.pro.br', 'Curso Python Pro', 'Confira os módulos fantásticos' ) + assert len(usuarios) == enviador.qtd_email_enviados diff --git a/libpythonpro/tests/test_spam/test_usuarios.py b/libpythonpro/tests/test_spam/test_usuarios.py index de33c9776..09b523445 100644 --- a/libpythonpro/tests/test_spam/test_usuarios.py +++ b/libpythonpro/tests/test_spam/test_usuarios.py @@ -2,13 +2,16 @@ def test_salvar_usuario(sessao): - usuario = Usuario(nome='Renzo') + usuario = Usuario(nome='Renzo', email='renzo@python.pro.br') sessao.salvar(usuario) assert isinstance(usuario.id, int) def test_listar_usuarios(sessao): - usuarios = [Usuario(nome='Renzo'), Usuario(nome='Luciano')] + usuarios = [ + Usuario(nome='Renzo', email='renzo@python.pro.br'), + Usuario(nome='Luciano', email='renzo@python.pro.br') + ] for usuario in usuarios: sessao.salvar(usuario) assert usuarios == sessao.listar() From a328baba94bb3e40d400dc9a90101f419eca7dbc Mon Sep 17 00:00:00 2001 From: renzon Date: Sat, 19 May 2018 20:28:21 -0300 Subject: [PATCH 26/99] Implementado Mock manual para Enviador --- libpythonpro/spam/enviador_de_email.py | 4 --- .../test_envio_para_base_de_usuarios.py | 31 ++++++++++++++++++- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/libpythonpro/spam/enviador_de_email.py b/libpythonpro/spam/enviador_de_email.py index 61788d657..fa0952223 100644 --- a/libpythonpro/spam/enviador_de_email.py +++ b/libpythonpro/spam/enviador_de_email.py @@ -1,11 +1,7 @@ class Enviador: - def __init__(self): - self.qtd_email_enviados = 0 - def enviar(self, remetente, destinatario, assunto, corpo): if '@' not in remetente: raise EmailInvalido(f'Email de remetente inválido: {remetente}') - self.qtd_email_enviados += 1 return remetente diff --git a/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py b/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py index 34b502c48..0e3a929b6 100644 --- a/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py +++ b/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py @@ -5,6 +5,17 @@ from libpythonpro.spam.modelos import Usuario +class EnviadorMock(Enviador): + def __init__(self): + super().__init__() + self.qtd_email_enviados = 0 + self.parametros_de_envio = None + + def enviar(self, remetente, destinatario, assunto, corpo): + self.parametros_de_envio = (remetente, destinatario, assunto, corpo) + self.qtd_email_enviados += 1 + + @pytest.mark.parametrize( 'usuarios', [ @@ -20,7 +31,7 @@ def test_qde_de_spam(sessao, usuarios): for usuario in usuarios: sessao.salvar(usuario) - enviador = Enviador() + enviador = EnviadorMock() enviador_de_spam = EnviadorDeSpam(sessao, enviador) enviador_de_spam.enviar_emails( 'renzo@python.pro.br', @@ -28,3 +39,21 @@ def test_qde_de_spam(sessao, usuarios): 'Confira os módulos fantásticos' ) assert len(usuarios) == enviador.qtd_email_enviados + + +def test_parametros_de_spam(sessao): + usuario = Usuario(nome='Renzo', email='renzo@python.pro.br') + sessao.salvar(usuario) + enviador = EnviadorMock() + enviador_de_spam = EnviadorDeSpam(sessao, enviador) + enviador_de_spam.enviar_emails( + 'luciano@python.pro.br', + 'Curso Python Pro', + 'Confira os módulos fantásticos' + ) + assert enviador.parametros_de_envio == ( + 'luciano@python.pro.br', + 'renzo@python.pro.br', + 'Curso Python Pro', + 'Confira os módulos fantásticos' + ) From 9883b39719371878c04b6c39153f8ca07fd1fd19 Mon Sep 17 00:00:00 2001 From: renzon Date: Sat, 19 May 2018 20:35:39 -0300 Subject: [PATCH 27/99] =?UTF-8?q?Trocado=20mock=20manual=20para=20c=C3=B3d?= =?UTF-8?q?igo=20de=20mock=20da=20biblioteca=20padrao?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test_envio_para_base_de_usuarios.py | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py b/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py index 0e3a929b6..eaecf15ad 100644 --- a/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py +++ b/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py @@ -1,3 +1,5 @@ +from unittest.mock import Mock + import pytest from libpythonpro.spam.enviador_de_email import Enviador @@ -5,17 +7,6 @@ from libpythonpro.spam.modelos import Usuario -class EnviadorMock(Enviador): - def __init__(self): - super().__init__() - self.qtd_email_enviados = 0 - self.parametros_de_envio = None - - def enviar(self, remetente, destinatario, assunto, corpo): - self.parametros_de_envio = (remetente, destinatario, assunto, corpo) - self.qtd_email_enviados += 1 - - @pytest.mark.parametrize( 'usuarios', [ @@ -31,27 +22,27 @@ def enviar(self, remetente, destinatario, assunto, corpo): def test_qde_de_spam(sessao, usuarios): for usuario in usuarios: sessao.salvar(usuario) - enviador = EnviadorMock() + enviador = Mock() enviador_de_spam = EnviadorDeSpam(sessao, enviador) enviador_de_spam.enviar_emails( 'renzo@python.pro.br', 'Curso Python Pro', 'Confira os módulos fantásticos' ) - assert len(usuarios) == enviador.qtd_email_enviados + assert len(usuarios) == enviador.enviar.call_count def test_parametros_de_spam(sessao): usuario = Usuario(nome='Renzo', email='renzo@python.pro.br') sessao.salvar(usuario) - enviador = EnviadorMock() + enviador = Mock() enviador_de_spam = EnviadorDeSpam(sessao, enviador) enviador_de_spam.enviar_emails( 'luciano@python.pro.br', 'Curso Python Pro', 'Confira os módulos fantásticos' ) - assert enviador.parametros_de_envio == ( + enviador.enviar.assert_called_once_with( 'luciano@python.pro.br', 'renzo@python.pro.br', 'Curso Python Pro', From f5561cdd65200b9264c00c4e72b99e2558f32fae Mon Sep 17 00:00:00 2001 From: renzon Date: Sun, 20 May 2018 08:01:14 -0300 Subject: [PATCH 28/99] =?UTF-8?q?M=C3=B3dulo=20e=20Import=20como=20Objeto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libpythonpro/github_api.py | 4 ---- libpythonpro/tests/test_spam/test_github_api.py | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 libpythonpro/tests/test_spam/test_github_api.py diff --git a/libpythonpro/github_api.py b/libpythonpro/github_api.py index 7d29e4e68..8b0fbafb9 100644 --- a/libpythonpro/github_api.py +++ b/libpythonpro/github_api.py @@ -11,7 +11,3 @@ def buscar_avatar(usuario): url = f'https://api.github.com/users/{usuario}' resp = requests.get(url) return resp.json()['avatar_url'] - - -if __name__ == '__main__': - print(buscar_avatar('renzon')) diff --git a/libpythonpro/tests/test_spam/test_github_api.py b/libpythonpro/tests/test_spam/test_github_api.py new file mode 100644 index 000000000..9e96c3dad --- /dev/null +++ b/libpythonpro/tests/test_spam/test_github_api.py @@ -0,0 +1,14 @@ +from unittest.mock import Mock + +from libpythonpro import github_api + + +def test_buscar_avatar(): + resp_mock = Mock() + resp_mock.json.return_value = { + 'login': 'renzo', 'id': 402714, + 'avatar_url': 'https://avatars3.githubusercontent.com/u/402714?v=4', + } + github_api.requests.get = Mock(return_value=resp_mock) + url = github_api.buscar_avatar('renzo') + assert 'https://avatars3.githubusercontent.com/u/402714?v=4' == url From ae87981fcdbb062866aa836fd1483e7cc86d4e2c Mon Sep 17 00:00:00 2001 From: renzon Date: Sun, 20 May 2018 20:25:59 -0300 Subject: [PATCH 29/99] Isolado Import manualmente --- .../tests/test_spam/test_github_api.py | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/libpythonpro/tests/test_spam/test_github_api.py b/libpythonpro/tests/test_spam/test_github_api.py index 9e96c3dad..0c6f10bd7 100644 --- a/libpythonpro/tests/test_spam/test_github_api.py +++ b/libpythonpro/tests/test_spam/test_github_api.py @@ -1,14 +1,29 @@ from unittest.mock import Mock +import pytest + from libpythonpro import github_api -def test_buscar_avatar(): +@pytest.fixture +def avatar_url(): resp_mock = Mock() + url = 'https://avatars3.githubusercontent.com/u/402714?v=4' resp_mock.json.return_value = { 'login': 'renzo', 'id': 402714, - 'avatar_url': 'https://avatars3.githubusercontent.com/u/402714?v=4', + 'avatar_url': url, } + get_original = github_api.requests.get github_api.requests.get = Mock(return_value=resp_mock) + yield url + github_api.requests.get = get_original + + +def test_buscar_avatar(avatar_url): url = github_api.buscar_avatar('renzo') - assert 'https://avatars3.githubusercontent.com/u/402714?v=4' == url + assert avatar_url == url + + +def test_buscar_avatar_integracao(): + url = github_api.buscar_avatar('renzon') + assert 'https://avatars3.githubusercontent.com/u/3457115?v=4' == url From 75ebce4bc160320ba55134ed377e8ac36385b60d Mon Sep 17 00:00:00 2001 From: renzon Date: Sun, 20 May 2018 23:00:32 -0300 Subject: [PATCH 30/99] Utilizado Pytest Mock --- libpythonpro/tests/test_spam/test_github_api.py | 9 ++++----- requirements-dev.txt | 2 ++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libpythonpro/tests/test_spam/test_github_api.py b/libpythonpro/tests/test_spam/test_github_api.py index 0c6f10bd7..21ce9c5d0 100644 --- a/libpythonpro/tests/test_spam/test_github_api.py +++ b/libpythonpro/tests/test_spam/test_github_api.py @@ -6,17 +6,16 @@ @pytest.fixture -def avatar_url(): +def avatar_url(mocker): resp_mock = Mock() url = 'https://avatars3.githubusercontent.com/u/402714?v=4' resp_mock.json.return_value = { 'login': 'renzo', 'id': 402714, 'avatar_url': url, } - get_original = github_api.requests.get - github_api.requests.get = Mock(return_value=resp_mock) - yield url - github_api.requests.get = get_original + get_mock = mocker.patch('libpythonpro.github_api.requests.get') + get_mock.return_value = resp_mock + return url def test_buscar_avatar(avatar_url): diff --git a/requirements-dev.txt b/requirements-dev.txt index d08fc4414..e0e7dfde8 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -16,4 +16,6 @@ pytest==3.5.1 coverage==4.5.1 pytest-cov==2.5.1 +pytest-mock-1.10.0 + -r requirements.txt \ No newline at end of file From 70dedffc32d191a7ce983fe92595b9a304ed65fe Mon Sep 17 00:00:00 2001 From: Herbert Parentes Fortes Neto Date: Sun, 20 May 2018 14:25:17 -0300 Subject: [PATCH 31/99] Atualizar 'print >> sys.stderr' para Python 3 close #25 --- setup.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index c5fa366d4..874d5bcbe 100644 --- a/setup.py +++ b/setup.py @@ -70,9 +70,8 @@ def find_package_data( or fn.lower() == pattern.lower()): bad_name = True if show_ignored: - print >> sys.stderr, ( - "Directory %s ignored by pattern %s" - % (fn, pattern)) + print("Directory %s ignored by pattern %s" % + (fn, pattern), file=sys.stderr) break if bad_name: continue @@ -93,9 +92,8 @@ def find_package_data( or fn.lower() == pattern.lower()): bad_name = True if show_ignored: - print >> sys.stderr, ( - "File %s ignored by pattern %s" - % (fn, pattern)) + print("File %s ignored by pattern %s" % + (fn, pattern), file=sys.stderr) break if bad_name: continue From ac565e513083f2f64c9d46bafa37e5239fe3c5a4 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Sat, 5 May 2018 06:38:58 -0300 Subject: [PATCH 32/99] Update pycodestyle from 2.3.1 to 2.4.0 --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index e0e7dfde8..459e7cf9b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,6 @@ flake8==3.5.0 mccabe==0.6.1 -pycodestyle==2.3.1 +pycodestyle==2.4.0 pyflakes==1.6.0 # Deps do pytest From 76b213cab36a0172b1ba695347ad61b400e64528 Mon Sep 17 00:00:00 2001 From: alisonamerico Date: Thu, 7 Jun 2018 19:56:44 -0300 Subject: [PATCH 33/99] =?UTF-8?q?Acrescentado=20espa=C3=A7o=20no=20README?= =?UTF-8?q?=20apenas=20para=20praticar=20contribui=C3=A7=C3=A3o=20em=20pro?= =?UTF-8?q?jetos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index cf235dd67..89d9110bf 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # libpythonpro + Módulo para exemplificar construção de projetos Python no curso PyTools Nesse curso é ensinado como contribuir com projetos de código aberto From f5219e34f8af83650430bc2f95ef0a19623ac2f3 Mon Sep 17 00:00:00 2001 From: renzon Date: Fri, 21 Jun 2019 20:45:46 -0300 Subject: [PATCH 34/99] =?UTF-8?q?Alterado=20gestor=20de=20depend=C3=AAncia?= =?UTF-8?q?s=20para=20pipenv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #123 --- .travis.yml | 5 +- Pipfile | 17 ++ Pipfile.lock | 233 ++++++++++++++++++ .../tests/test_spam/test_enviador_de_email.py | 2 +- .../test_envio_para_base_de_usuarios.py | 1 - requirements-dev.txt | 21 -- requirements.txt | 5 - 7 files changed, 254 insertions(+), 30 deletions(-) create mode 100644 Pipfile create mode 100644 Pipfile.lock delete mode 100644 requirements-dev.txt delete mode 100644 requirements.txt diff --git a/.travis.yml b/.travis.yml index 0944b0b06..6694375b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,9 @@ language: python python: - - 3.6 + - 3.7 install: - - pip install -q -r requirements-dev.txt codecov + - pip install -q pipenv codecov + - pipenv sync --dev script: - flake8 - pytest libpythonpro --cov=libpythonpro diff --git a/Pipfile b/Pipfile new file mode 100644 index 000000000..af5c7333d --- /dev/null +++ b/Pipfile @@ -0,0 +1,17 @@ +[[source]] +name = "pypi" +url = "https://pypi.org/simple" +verify_ssl = true + +[dev-packages] +flake8 = "*" +pytest = "*" +coverage = "*" +pytest-cov = "*" +pytest-mock = "*" + +[packages] +requests = "*" + +[requires] +python_version = "3.7" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 000000000..8a647ca6f --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,233 @@ +{ + "_meta": { + "hash": { + "sha256": "36b4d15ab997722625c5463b1a4e8164dfc3dd1788d6e7e90b62a7d7b5ed6a50" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.7" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "certifi": { + "hashes": [ + "sha256:046832c04d4e752f37383b628bc601a7ea7211496b4638f6514d0e5b9acc4939", + "sha256:945e3ba63a0b9f577b1395204e13c3a231f9bc0223888be653286534e5873695" + ], + "version": "==2019.6.16" + }, + "chardet": { + "hashes": [ + "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", + "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" + ], + "version": "==3.0.4" + }, + "idna": { + "hashes": [ + "sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407", + "sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c" + ], + "version": "==2.8" + }, + "requests": { + "hashes": [ + "sha256:11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4", + "sha256:9cf5292fcd0f598c671cfc1e0d7d1a7f13bb8085e9a590f48c010551dc6c4b31" + ], + "index": "pypi", + "version": "==2.22.0" + }, + "urllib3": { + "hashes": [ + "sha256:b246607a25ac80bedac05c6f282e3cdaf3afb65420fd024ac94435cabe6e18d1", + "sha256:dbe59173209418ae49d485b87d1681aefa36252ee85884c31346debd19463232" + ], + "version": "==1.25.3" + } + }, + "develop": { + "atomicwrites": { + "hashes": [ + "sha256:03472c30eb2c5d1ba9227e4c2ca66ab8287fbfbbda3888aa93dc2e28fc6811b4", + "sha256:75a9445bac02d8d058d5e1fe689654ba5a6556a1dfd8ce6ec55a0ed79866cfa6" + ], + "version": "==1.3.0" + }, + "attrs": { + "hashes": [ + "sha256:69c0dbf2ed392de1cb5ec704444b08a5ef81680a61cb899dc08127123af36a79", + "sha256:f0b870f674851ecbfbbbd364d6b5cbdff9dcedbc7f3f5e18a6891057f21fe399" + ], + "version": "==19.1.0" + }, + "coverage": { + "hashes": [ + "sha256:3684fabf6b87a369017756b551cef29e505cb155ddb892a7a29277b978da88b9", + "sha256:39e088da9b284f1bd17c750ac672103779f7954ce6125fd4382134ac8d152d74", + "sha256:3c205bc11cc4fcc57b761c2da73b9b72a59f8d5ca89979afb0c1c6f9e53c7390", + "sha256:465ce53a8c0f3a7950dfb836438442f833cf6663d407f37d8c52fe7b6e56d7e8", + "sha256:48020e343fc40f72a442c8a1334284620f81295256a6b6ca6d8aa1350c763bbe", + "sha256:5296fc86ab612ec12394565c500b412a43b328b3907c0d14358950d06fd83baf", + "sha256:5f61bed2f7d9b6a9ab935150a6b23d7f84b8055524e7be7715b6513f3328138e", + "sha256:68a43a9f9f83693ce0414d17e019daee7ab3f7113a70c79a3dd4c2f704e4d741", + "sha256:6b8033d47fe22506856fe450470ccb1d8ba1ffb8463494a15cfc96392a288c09", + "sha256:7ad7536066b28863e5835e8cfeaa794b7fe352d99a8cded9f43d1161be8e9fbd", + "sha256:7bacb89ccf4bedb30b277e96e4cc68cd1369ca6841bde7b005191b54d3dd1034", + "sha256:839dc7c36501254e14331bcb98b27002aa415e4af7ea039d9009409b9d2d5420", + "sha256:8f9a95b66969cdea53ec992ecea5406c5bd99c9221f539bca1e8406b200ae98c", + "sha256:932c03d2d565f75961ba1d3cec41ddde00e162c5b46d03f7423edcb807734eab", + "sha256:988529edadc49039d205e0aa6ce049c5ccda4acb2d6c3c5c550c17e8c02c05ba", + "sha256:998d7e73548fe395eeb294495a04d38942edb66d1fa61eb70418871bc621227e", + "sha256:9de60893fb447d1e797f6bf08fdf0dbcda0c1e34c1b06c92bd3a363c0ea8c609", + "sha256:9e80d45d0c7fcee54e22771db7f1b0b126fb4a6c0a2e5afa72f66827207ff2f2", + "sha256:a545a3dfe5082dc8e8c3eb7f8a2cf4f2870902ff1860bd99b6198cfd1f9d1f49", + "sha256:a5d8f29e5ec661143621a8f4de51adfb300d7a476224156a39a392254f70687b", + "sha256:aca06bfba4759bbdb09bf52ebb15ae20268ee1f6747417837926fae990ebc41d", + "sha256:bb23b7a6fd666e551a3094ab896a57809e010059540ad20acbeec03a154224ce", + "sha256:bfd1d0ae7e292105f29d7deaa9d8f2916ed8553ab9d5f39ec65bcf5deadff3f9", + "sha256:c62ca0a38958f541a73cf86acdab020c2091631c137bd359c4f5bddde7b75fd4", + "sha256:c709d8bda72cf4cd348ccec2a4881f2c5848fd72903c185f363d361b2737f773", + "sha256:c968a6aa7e0b56ecbd28531ddf439c2ec103610d3e2bf3b75b813304f8cb7723", + "sha256:df785d8cb80539d0b55fd47183264b7002077859028dfe3070cf6359bf8b2d9c", + "sha256:f406628ca51e0ae90ae76ea8398677a921b36f0bd71aab2099dfed08abd0322f", + "sha256:f46087bbd95ebae244a0eda01a618aff11ec7a069b15a3ef8f6b520db523dcf1", + "sha256:f8019c5279eb32360ca03e9fac40a12667715546eed5c5eb59eb381f2f501260", + "sha256:fc5f4d209733750afd2714e9109816a29500718b32dd9a5db01c0cb3a019b96a" + ], + "index": "pypi", + "version": "==4.5.3" + }, + "entrypoints": { + "hashes": [ + "sha256:589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19", + "sha256:c70dd71abe5a8c85e55e12c19bd91ccfeec11a6e99044204511f9ed547d48451" + ], + "version": "==0.3" + }, + "flake8": { + "hashes": [ + "sha256:859996073f341f2670741b51ec1e67a01da142831aa1fdc6242dbf88dffbe661", + "sha256:a796a115208f5c03b18f332f7c11729812c8c3ded6c46319c59b53efd3819da8" + ], + "index": "pypi", + "version": "==3.7.7" + }, + "importlib-metadata": { + "hashes": [ + "sha256:6dfd58dfe281e8d240937776065dd3624ad5469c835248219bd16cf2e12dbeb7", + "sha256:cb6ee23b46173539939964df59d3d72c3e0c1b5d54b84f1d8a7e912fe43612db" + ], + "version": "==0.18" + }, + "mccabe": { + "hashes": [ + "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", + "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" + ], + "version": "==0.6.1" + }, + "more-itertools": { + "hashes": [ + "sha256:2112d2ca570bb7c3e53ea1a35cd5df42bb0fd10c45f0fb97178679c3c03d64c7", + "sha256:c3e4748ba1aad8dba30a4886b0b1a2004f9a863837b8654e7059eebf727afa5a" + ], + "markers": "python_version > '2.7'", + "version": "==7.0.0" + }, + "packaging": { + "hashes": [ + "sha256:0c98a5d0be38ed775798ece1b9727178c4469d9c3b4ada66e8e6b7849f8732af", + "sha256:9e1cbf8c12b1f1ce0bb5344b8d7ecf66a6f8a6e91bcb0c84593ed6d3ab5c4ab3" + ], + "version": "==19.0" + }, + "pluggy": { + "hashes": [ + "sha256:0825a152ac059776623854c1543d65a4ad408eb3d33ee114dff91e57ec6ae6fc", + "sha256:b9817417e95936bf75d85d3f8767f7df6cdde751fc40aed3bb3074cbcb77757c" + ], + "version": "==0.12.0" + }, + "py": { + "hashes": [ + "sha256:64f65755aee5b381cea27766a3a147c3f15b9b6b9ac88676de66ba2ae36793fa", + "sha256:dc639b046a6e2cff5bbe40194ad65936d6ba360b52b3c3fe1d08a82dd50b5e53" + ], + "version": "==1.8.0" + }, + "pycodestyle": { + "hashes": [ + "sha256:95a2219d12372f05704562a14ec30bc76b05a5b297b21a5dfe3f6fac3491ae56", + "sha256:e40a936c9a450ad81df37f549d676d127b1b66000a6c500caa2b085bc0ca976c" + ], + "version": "==2.5.0" + }, + "pyflakes": { + "hashes": [ + "sha256:17dbeb2e3f4d772725c777fabc446d5634d1038f234e77343108ce445ea69ce0", + "sha256:d976835886f8c5b31d47970ed689944a0262b5f3afa00a5a7b4dc81e5449f8a2" + ], + "version": "==2.1.1" + }, + "pyparsing": { + "hashes": [ + "sha256:1873c03321fc118f4e9746baf201ff990ceb915f433f23b395f5580d1840cb2a", + "sha256:9b6323ef4ab914af344ba97510e966d64ba91055d6b9afa6b30799340e89cc03" + ], + "version": "==2.4.0" + }, + "pytest": { + "hashes": [ + "sha256:4a784f1d4f2ef198fe9b7aef793e9fa1a3b2f84e822d9b3a64a181293a572d45", + "sha256:926855726d8ae8371803f7b2e6ec0a69953d9c6311fa7c3b6c1b929ff92d27da" + ], + "index": "pypi", + "version": "==4.6.3" + }, + "pytest-cov": { + "hashes": [ + "sha256:2b097cde81a302e1047331b48cadacf23577e431b61e9c6f49a1170bbe3d3da6", + "sha256:e00ea4fdde970725482f1f35630d12f074e121a23801aabf2ae154ec6bdd343a" + ], + "index": "pypi", + "version": "==2.7.1" + }, + "pytest-mock": { + "hashes": [ + "sha256:43ce4e9dd5074993e7c021bb1c22cbb5363e612a2b5a76bc6d956775b10758b7", + "sha256:5bf5771b1db93beac965a7347dc81c675ec4090cb841e49d9d34637a25c30568" + ], + "index": "pypi", + "version": "==1.10.4" + }, + "six": { + "hashes": [ + "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", + "sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73" + ], + "version": "==1.12.0" + }, + "wcwidth": { + "hashes": [ + "sha256:3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e", + "sha256:f4ebe71925af7b40a864553f761ed559b43544f8f71746c2d756c7fe788ade7c" + ], + "version": "==0.1.7" + }, + "zipp": { + "hashes": [ + "sha256:8c1019c6aad13642199fbe458275ad6a84907634cc9f0989877ccc4a2840139d", + "sha256:ca943a7e809cc12257001ccfb99e3563da9af99d52f261725e96dfe0f9275bc3" + ], + "version": "==0.5.1" + } + } +} diff --git a/libpythonpro/tests/test_spam/test_enviador_de_email.py b/libpythonpro/tests/test_spam/test_enviador_de_email.py index 1be6631bd..c72a0bbe9 100644 --- a/libpythonpro/tests/test_spam/test_enviador_de_email.py +++ b/libpythonpro/tests/test_spam/test_enviador_de_email.py @@ -1,6 +1,6 @@ import pytest -from libpythonpro.spam.enviador_de_email import Enviador, EmailInvalido +from libpythonpro.spam.enviador_de_email import EmailInvalido, Enviador def test_criar_enviador_de_email(): diff --git a/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py b/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py index eaecf15ad..d2db43893 100644 --- a/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py +++ b/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py @@ -2,7 +2,6 @@ import pytest -from libpythonpro.spam.enviador_de_email import Enviador from libpythonpro.spam.main import EnviadorDeSpam from libpythonpro.spam.modelos import Usuario diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 459e7cf9b..000000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,21 +0,0 @@ -flake8==3.5.0 -mccabe==0.6.1 -pycodestyle==2.4.0 -pyflakes==1.6.0 - -# Deps do pytest -py==1.5.3 -more-itertools==4.1.0 -six==1.11.0 -attrs==18.1.0 -pluggy==0.6.0 -pytest==3.5.1 - - -#Converage -coverage==4.5.1 -pytest-cov==2.5.1 - -pytest-mock-1.10.0 - --r requirements.txt \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 585fa8413..000000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -certifi==2018.4.16 -chardet==3.0.4 -idna==2.6 -requests==2.18.4 -urllib3==1.22 From e3cebd3c7a1d5321163172a82b136be8983d2afa Mon Sep 17 00:00:00 2001 From: renzon Date: Sat, 22 Jun 2019 00:09:35 -0300 Subject: [PATCH 35/99] =?UTF-8?q?Atualizada=20configura=C3=A7=C3=A3o=20do?= =?UTF-8?q?=20pyup=20de=20acordo=20com=20pipenv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #125 --- .pyup.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .pyup.yml diff --git a/.pyup.yml b/.pyup.yml new file mode 100644 index 000000000..551ae40dd --- /dev/null +++ b/.pyup.yml @@ -0,0 +1,3 @@ +requirements: + - Pipfile + - Pipfile.lock \ No newline at end of file From 8762c955bfee431b155f078dc6040bed7c17c4be Mon Sep 17 00:00:00 2001 From: renzon Date: Sat, 22 Jun 2019 00:31:47 -0300 Subject: [PATCH 36/99] =?UTF-8?q?Update=20de=20vers=C3=A3o=20antiga=20do?= =?UTF-8?q?=20requests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Pipfile | 2 +- Pipfile.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Pipfile b/Pipfile index af5c7333d..90f906a65 100644 --- a/Pipfile +++ b/Pipfile @@ -11,7 +11,7 @@ pytest-cov = "*" pytest-mock = "*" [packages] -requests = "*" +requests = "<2.22.0" [requires] python_version = "3.7" diff --git a/Pipfile.lock b/Pipfile.lock index 8a647ca6f..41af19546 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "36b4d15ab997722625c5463b1a4e8164dfc3dd1788d6e7e90b62a7d7b5ed6a50" + "sha256": "78166f5c6ed7113c593545f55a974a7d04cb0bc31ebdee23ed23dd2f3e5aa57d" }, "pipfile-spec": 6, "requires": { @@ -39,18 +39,18 @@ }, "requests": { "hashes": [ - "sha256:11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4", - "sha256:9cf5292fcd0f598c671cfc1e0d7d1a7f13bb8085e9a590f48c010551dc6c4b31" + "sha256:502a824f31acdacb3a35b6690b5fbf0bc41d63a24a45c4004352b0242707598e", + "sha256:7bf2a778576d825600030a110f3c0e3e8edc51dfaafe1c146e39a2027784957b" ], "index": "pypi", - "version": "==2.22.0" + "version": "==2.21.0" }, "urllib3": { "hashes": [ - "sha256:b246607a25ac80bedac05c6f282e3cdaf3afb65420fd024ac94435cabe6e18d1", - "sha256:dbe59173209418ae49d485b87d1681aefa36252ee85884c31346debd19463232" + "sha256:2393a695cd12afedd0dcb26fe5d50d0cf248e5a66f75dbd89a3d4eb333a61af4", + "sha256:a637e5fae88995b256e3409dc4d52c2e2e0ba32c42a6365fee8bbd2238de3cfb" ], - "version": "==1.25.3" + "version": "==1.24.3" } }, "develop": { From 117e0b130e71acced040be136c22bbb0afacafdd Mon Sep 17 00:00:00 2001 From: renzon Date: Sat, 22 Jun 2019 00:37:52 -0300 Subject: [PATCH 37/99] Update da lib requests --- Pipfile | 2 +- Pipfile.lock | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Pipfile b/Pipfile index 90f906a65..af5c7333d 100644 --- a/Pipfile +++ b/Pipfile @@ -11,7 +11,7 @@ pytest-cov = "*" pytest-mock = "*" [packages] -requests = "<2.22.0" +requests = "*" [requires] python_version = "3.7" diff --git a/Pipfile.lock b/Pipfile.lock index 41af19546..8a647ca6f 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "78166f5c6ed7113c593545f55a974a7d04cb0bc31ebdee23ed23dd2f3e5aa57d" + "sha256": "36b4d15ab997722625c5463b1a4e8164dfc3dd1788d6e7e90b62a7d7b5ed6a50" }, "pipfile-spec": 6, "requires": { @@ -39,18 +39,18 @@ }, "requests": { "hashes": [ - "sha256:502a824f31acdacb3a35b6690b5fbf0bc41d63a24a45c4004352b0242707598e", - "sha256:7bf2a778576d825600030a110f3c0e3e8edc51dfaafe1c146e39a2027784957b" + "sha256:11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4", + "sha256:9cf5292fcd0f598c671cfc1e0d7d1a7f13bb8085e9a590f48c010551dc6c4b31" ], "index": "pypi", - "version": "==2.21.0" + "version": "==2.22.0" }, "urllib3": { "hashes": [ - "sha256:2393a695cd12afedd0dcb26fe5d50d0cf248e5a66f75dbd89a3d4eb333a61af4", - "sha256:a637e5fae88995b256e3409dc4d52c2e2e0ba32c42a6365fee8bbd2238de3cfb" + "sha256:b246607a25ac80bedac05c6f282e3cdaf3afb65420fd024ac94435cabe6e18d1", + "sha256:dbe59173209418ae49d485b87d1681aefa36252ee85884c31346debd19463232" ], - "version": "==1.24.3" + "version": "==1.25.3" } }, "develop": { From 319ffa4a2adbf42a80b6aa35924b38fb0baf42f6 Mon Sep 17 00:00:00 2001 From: renzon Date: Sat, 22 Jun 2019 01:00:46 -0300 Subject: [PATCH 38/99] Atualizado Readme para utilizar o Pipenv --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 89d9110bf..676c14d7f 100644 --- a/README.md +++ b/README.md @@ -16,19 +16,20 @@ Suportada versão 3 de Python Para instalar: ```console -python3 -m venv .venv -source .venv/bin/activate -pip install -r requirements-dev.txt +pip install pipenv +pipenv install --dev ``` Para conferir qualidade de código: ```console -flake8 - +pipenv run flake8 ``` Tópicos a serem abordados: 1. Git 2. Virtualenv - 3. Pip \ No newline at end of file + 3. Pip + 4. Mock + 5. Pipenv + \ No newline at end of file From 96480344e6dd16f8257f16cf273110781bf0d4b0 Mon Sep 17 00:00:00 2001 From: undersfx Date: Sat, 28 Sep 2019 23:27:12 -0300 Subject: [PATCH 39/99] =?UTF-8?q?Workaround=20para=20problema=20no=20parse?= =?UTF-8?q?r=20da=20licen=C3=A7a?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 874d5bcbe..1fea97a65 100644 --- a/setup.py +++ b/setup.py @@ -117,7 +117,7 @@ def find_package_data( long_description_content_type='text/markdown', author=AUTHOR, author_email=AUTHOR_EMAIL, - license=read('LICENSE'), + license="GNU AFFERO GENERAL PUBLIC LICENSE", url=URL, packages=find_packages(exclude=["tests.*", "tests"]), package_data=find_package_data(PACKAGE, only_in_packages=False), From e711373d209926563feca7542b1920a99d9b7986 Mon Sep 17 00:00:00 2001 From: VAIO-MC3 Date: Fri, 1 May 2020 21:43:03 -0300 Subject: [PATCH 40/99] =?UTF-8?q?Adicionado=20contribui=C3=A7=C3=A3o=20a?= =?UTF-8?q?=20projetos=20de=20c=C3=B3digo=20aberto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 980f7db5c..36bcae72d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # libpythonpro -Módulo para exemplificar construção de projetos Python no curso PyTools +# Módulo para exemplificar construção de projetos Python no curso PyTools Nesse curso é ensinado como contribuir com projetos de código aberto From cf0b224c357819193ebd935e80b6e844a1759ceb Mon Sep 17 00:00:00 2001 From: VAIO-MC3 Date: Mon, 4 May 2020 16:41:56 -0300 Subject: [PATCH 41/99] =?UTF-8?q?Adicionado=20contribui=C3=A7=C3=A3o=20a?= =?UTF-8?q?=20projetos=20de=20c=C3=B3digo=20aberto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 36bcae72d..e2524a3ef 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ Link para o curso [Python Pro](https://www.python.pro.br/) [![Build Status](https://travis-ci.org/pythonprobr/libpythonpro.svg?branch=master)](https://travis-ci.org/pythonprobr/libpythonpro) + Suportada versão 3 de Python Para instalar: From 966b72cfdbaf039b60f1a47bc45f306f92f823ab Mon Sep 17 00:00:00 2001 From: VAIO-MC3 Date: Tue, 5 May 2020 19:56:11 -0300 Subject: [PATCH 42/99] =?UTF-8?q?Adicionado=20contribui=C3=A7=C3=A3o=20a?= =?UTF-8?q?=20projetos=20de=20c=C3=B3digo=20aberto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index e2524a3ef..a384f025f 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,11 @@ Link para o curso [Python Pro](https://www.python.pro.br/) [![Build Status](https://travis-ci.org/pythonprobr/libpythonpro.svg?branch=master)](https://travis-ci.org/pythonprobr/libpythonpro) +<<<<<<< Updated upstream +======= +--- NOVO ----- Criação de varios ramos BRANCHES + +>>>>>>> Stashed changes Suportada versão 3 de Python From 75ed7db64cce75474bbd58dafde10537dfd53860 Mon Sep 17 00:00:00 2001 From: VAIO-MC3 Date: Thu, 7 May 2020 16:24:21 -0300 Subject: [PATCH 43/99] =?UTF-8?q?Adicionado=20contribui=C3=A7=C3=A3o=20a?= =?UTF-8?q?=20projetos=20de=20c=C3=B3digo=20aberto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a384f025f..418b78bc8 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Link para o curso [Python Pro](https://www.python.pro.br/) <<<<<<< Updated upstream ======= ---- NOVO ----- Criação de varios ramos BRANCHES +--- NOVO ---- Criação de varios ramos BRANCHES >>>>>>> Stashed changes From 1519f3ab7a1535c9fc08abc5a081ad46d0cc1130 Mon Sep 17 00:00:00 2001 From: VAIO-MC3 Date: Mon, 11 May 2020 18:58:32 -0300 Subject: [PATCH 44/99] Merge remote-tracking branch 'upstreams/master' # Conflicts: # .travis.yml # README.md # libpythonpro/github_api.py --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 144f95c87..76197d0b4 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Link para o curso [Python Pro](https://www.python.pro.br/) [![Python 3](https://pyup.io/repos/github/pythonprobr/libpythonpro/python-3-shield.svg)](https://pyup.io/repos/github/pythonprobr/libpythonpro/) [![codecov](https://codecov.io/gh/pythonprobr/libpythonpro/branch/master/graph/badge.svg)](https://codecov.io/gh/pythonprobr/libpythonpro) + Suportada versão 3 de Python Para instalar: From 3bb40ec0166bef8497044fa6ca4aa361a4d38c67 Mon Sep 17 00:00:00 2001 From: VAIO-MC3 Date: Wed, 13 May 2020 15:59:09 -0300 Subject: [PATCH 45/99] Merge remote-tracking branch 'upstreams/master' # Conflicts: # .travis.yml # README.md # libpythonpro/github_api.py --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 76197d0b4..144f95c87 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,6 @@ Link para o curso [Python Pro](https://www.python.pro.br/) [![Python 3](https://pyup.io/repos/github/pythonprobr/libpythonpro/python-3-shield.svg)](https://pyup.io/repos/github/pythonprobr/libpythonpro/) [![codecov](https://codecov.io/gh/pythonprobr/libpythonpro/branch/master/graph/badge.svg)](https://codecov.io/gh/pythonprobr/libpythonpro) - Suportada versão 3 de Python Para instalar: From 3cc1a7835321c364ff8b50808c5be3a869ea57e4 Mon Sep 17 00:00:00 2001 From: cacciella Date: Mon, 18 May 2020 15:52:17 -0300 Subject: [PATCH 46/99] Suportado Python 3 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 144f95c87..2da79e2ed 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ Nesse curso é ensinado como contribuir com projetos de código aberto Link para o curso [Python Pro](https://www.python.pro.br/) +Suportada versão 3 de Python + [![Build Status](https://travis-ci.org/pythonprobr/libpythonpro.svg?branch=master)](https://travis-ci.org/pythonprobr/libpythonpro) [![Updates](https://pyup.io/repos/github/pythonprobr/libpythonpro/shield.svg)](https://pyup.io/repos/github/pythonprobr/libpythonpro/) [![Python 3](https://pyup.io/repos/github/pythonprobr/libpythonpro/python-3-shield.svg)](https://pyup.io/repos/github/pythonprobr/libpythonpro/) From 92ac58a7ac016dd8b75488c285ff6fda557b2cc4 Mon Sep 17 00:00:00 2001 From: cacciella Date: Tue, 19 May 2020 15:50:00 -0300 Subject: [PATCH 47/99] Suportado Python 3 --- .idea/.gitignore | 3 +++ .idea/inspectionProfiles/profiles_settings.xml | 6 ++++++ .idea/libpythonpro.iml | 10 ++++++++++ .idea/misc.xml | 4 ++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 6 ++++++ libpythonpro/github_api.py | 3 +-- 7 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/libpythonpro.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 000000000..26d33521a --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 000000000..105ce2da2 --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/libpythonpro.iml b/.idea/libpythonpro.iml new file mode 100644 index 000000000..442829ebb --- /dev/null +++ b/.idea/libpythonpro.iml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 000000000..14145163d --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 000000000..3478ad2cf --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 000000000..94a25f7f4 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/libpythonpro/github_api.py b/libpythonpro/github_api.py index 7d29e4e68..6ba55a49b 100644 --- a/libpythonpro/github_api.py +++ b/libpythonpro/github_api.py @@ -1,6 +1,5 @@ import requests - def buscar_avatar(usuario): """ Busca o avatar de um usuário no Github @@ -14,4 +13,4 @@ def buscar_avatar(usuario): if __name__ == '__main__': - print(buscar_avatar('renzon')) + print(buscar_avatar('cacciella')) From 7ebaf6d1e1487dea2ee8034762795cca0b5742fa Mon Sep 17 00:00:00 2001 From: cacciella Date: Tue, 19 May 2020 17:07:26 -0300 Subject: [PATCH 48/99] =?UTF-8?q?Adcionada=20Flake8=20como=20depend=C3=AAn?= =?UTF-8?q?cia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #12 --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2da79e2ed..edec69562 100644 --- a/README.md +++ b/README.md @@ -17,14 +17,17 @@ Suportada versão 3 de Python Para instalar: ```console -pip install pipenv -pipenv install --dev +python3 -m venv .venv +source .venv/bin/activate +pip install -r requirements-dev.txt + ``` Para conferir qualidade de código: ```console -pipenv run flake8 +flake8 + ``` Tópicos a serem abordados: From 12bd39647a113a1f99a20aba965589d2a59daf15 Mon Sep 17 00:00:00 2001 From: cacciella Date: Tue, 19 May 2020 17:08:11 -0300 Subject: [PATCH 49/99] install requirements --- requirements-dev.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index a9fca4b76..d7a6aaced 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,4 @@ -flake8==3.5.0 +flake8==3.8.1 mccabe==0.6.1 -pycodestyle==2.3.1 -pyflakes==1.6.0 --r requirements.txt \ No newline at end of file +pycodestyle==2.6.0 +pyflakes==2.2.0 From bd958fba464bb3022946cda50cfee36295b6651d Mon Sep 17 00:00:00 2001 From: cacciella Date: Tue, 19 May 2020 17:18:48 -0300 Subject: [PATCH 50/99] Requests url --- libpythonpro/github_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpythonpro/github_api.py b/libpythonpro/github_api.py index 6ba55a49b..5d12a52a7 100644 --- a/libpythonpro/github_api.py +++ b/libpythonpro/github_api.py @@ -1,9 +1,9 @@ import requests + def buscar_avatar(usuario): """ Busca o avatar de um usuário no Github - :param usuario: str com o nome de usuário no github :return: str com o link do avatar """ From 623555c2592edf16df79414195f6c83a6fe00cdb Mon Sep 17 00:00:00 2001 From: cacciella Date: Wed, 20 May 2020 17:31:43 -0300 Subject: [PATCH 51/99] Configuradi Travis CI close #13 --- .travis.yml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 828b68c81..517018fc8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,7 @@ language: python python: -<<<<<<< HEAD - - 3.6 + - 3.8 install: - - pip install -q -r requirements-dev.txt + - pip install -r requirements-dev.txt script: - - flake8 -======= - - 3.7 -install: - - pip install -q pipenv codecov - - pipenv sync --dev -script: - - flake8 - - pytest libpythonpro --cov=libpythonpro -after_success: - - codecov ->>>>>>> upstreams/master + - flake8 \ No newline at end of file From f5af1285c1f8ba4d2cdaf5d83def9787b26a11d5 Mon Sep 17 00:00:00 2001 From: cacciella Date: Wed, 20 May 2020 17:57:11 -0300 Subject: [PATCH 52/99] =?UTF-8?q?Removendo=20detalhes=20de=20depend=C3=AAn?= =?UTF-8?q?cias=20durante=20o=20Build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #13 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 517018fc8..32160871c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,6 @@ language: python python: - 3.8 install: - - pip install -r requirements-dev.txt + - pip install -q -r requirements-dev.txt script: - flake8 \ No newline at end of file From 6825f71fa0c672b06f385b2e813ce46e436b50bd Mon Sep 17 00:00:00 2001 From: cacciella Date: Wed, 20 May 2020 18:08:11 -0300 Subject: [PATCH 53/99] Inserido Build Status do Travis CI close #13 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index edec69562..4ede17ea0 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ Nesse curso é ensinado como contribuir com projetos de código aberto Link para o curso [Python Pro](https://www.python.pro.br/) +[![Build Status](https://travis-ci.org/cacciella/libpythonpro.svg?branch=master)](https://travis-ci.org/cacciella/libpythonpro) + Suportada versão 3 de Python [![Build Status](https://travis-ci.org/pythonprobr/libpythonpro.svg?branch=master)](https://travis-ci.org/pythonprobr/libpythonpro) From 19d5f6717a5cb66db69caf4ad04ba78a7f0e17b6 Mon Sep 17 00:00:00 2001 From: cacciella Date: Wed, 20 May 2020 18:10:59 -0300 Subject: [PATCH 54/99] Inserido o Build Status do Travis CI close #13 --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index 4ede17ea0..89a35e809 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,6 @@ Link para o curso [Python Pro](https://www.python.pro.br/) Suportada versão 3 de Python -[![Build Status](https://travis-ci.org/pythonprobr/libpythonpro.svg?branch=master)](https://travis-ci.org/pythonprobr/libpythonpro) -[![Updates](https://pyup.io/repos/github/pythonprobr/libpythonpro/shield.svg)](https://pyup.io/repos/github/pythonprobr/libpythonpro/) -[![Python 3](https://pyup.io/repos/github/pythonprobr/libpythonpro/python-3-shield.svg)](https://pyup.io/repos/github/pythonprobr/libpythonpro/) -[![codecov](https://codecov.io/gh/pythonprobr/libpythonpro/branch/master/graph/badge.svg)](https://codecov.io/gh/pythonprobr/libpythonpro) - -Suportada versão 3 de Python - Para instalar: ```console From 63e6018c77ede7083ff09a02137e473bea41e5cd Mon Sep 17 00:00:00 2001 From: cacciella Date: Wed, 20 May 2020 19:20:45 -0300 Subject: [PATCH 55/99] Integrado com PyUp --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 89a35e809..86cc0e8dd 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ Nesse curso é ensinado como contribuir com projetos de código aberto Link para o curso [Python Pro](https://www.python.pro.br/) [![Build Status](https://travis-ci.org/cacciella/libpythonpro.svg?branch=master)](https://travis-ci.org/cacciella/libpythonpro) +[![Updates](https://pyup.io/repos/github/cacciella/libpythonpro/shield.svg)](https://pyup.io/repos/github/cacciella/libpythonpro/) +[![Python 3](https://pyup.io/repos/github/cacciella/libpythonpro/python-3-shield.svg)](https://pyup.io/repos/github/cacciella/libpythonpro/) Suportada versão 3 de Python From c459670f057d3ecd3eba55766d5290774ed71a11 Mon Sep 17 00:00:00 2001 From: cacciella Date: Wed, 20 May 2020 19:56:19 -0300 Subject: [PATCH 56/99] =?UTF-8?q?Atualiza=C3=A7=C3=A3o=20requests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 86431e80a..a835039e5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ certifi==2018.4.16 chardet==3.0.4 idna==2.6 -requests==2.18.3 -urllib3==1.22 +requests==2.23.0 +urllib3==1.22 \ No newline at end of file From 957b3519d3be1533f30f9ff38a72a4c47ec2777c Mon Sep 17 00:00:00 2001 From: cacciella Date: Wed, 20 May 2020 19:59:25 -0300 Subject: [PATCH 57/99] =?UTF-8?q?Atualiza=C3=A7=C3=A3o=20requirements.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index a835039e5..f14e2113b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ certifi==2018.4.16 chardet==3.0.4 idna==2.6 requests==2.23.0 -urllib3==1.22 \ No newline at end of file +urllib3==1.25.9 \ No newline at end of file From 00a03500c7dca255feccff8aa5a10c9e286a7c01 Mon Sep 17 00:00:00 2001 From: cacciella Date: Wed, 20 May 2020 20:26:33 -0300 Subject: [PATCH 58/99] =?UTF-8?q?Atualiza=C3=A7=C3=A3o=20requirements.txt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index f14e2113b..ceec2f8d8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -certifi==2018.4.16 +certifi==2020.4.5.1 chardet==3.0.4 -idna==2.6 +idna==2.9 requests==2.23.0 urllib3==1.25.9 \ No newline at end of file From dd8a27cdbf98ef686e902ab749ed2c7dd18b50eb Mon Sep 17 00:00:00 2001 From: cacciella Date: Fri, 22 May 2020 12:12:29 -0300 Subject: [PATCH 59/99] =?UTF-8?q?Cria=C3=A7=C3=A3o=20setup.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 1fea97a65..2f85eb424 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,4 @@ +# https://github.com/pythonprobr/libpythonpro/blob/master/setup.py import codecs import os import sys @@ -100,7 +101,7 @@ def find_package_data( out.setdefault(package, []).append(prefix + name) return out - +# Alteracoes a serem feitas para cada projeto PACKAGE = "libpythonpro" NAME = PACKAGE DESCRIPTION = "Módulo para exemplificar construção de projetos Python no curso PyTools" @@ -117,10 +118,11 @@ def find_package_data( long_description_content_type='text/markdown', author=AUTHOR, author_email=AUTHOR_EMAIL, - license="GNU AFFERO GENERAL PUBLIC LICENSE", + license=read('LICENSE'), url=URL, packages=find_packages(exclude=["tests.*", "tests"]), package_data=find_package_data(PACKAGE, only_in_packages=False), + # https://pypi.org/pypi?%3Aaction=list_classifiers classifiers=[ "Development Status :: 2 - Pre-Alpha", "Environment :: Console", From 8f19d455a3355aeccf7001010fc44dbabfb1bd8e Mon Sep 17 00:00:00 2001 From: cacciella Date: Fri, 22 May 2020 12:13:35 -0300 Subject: [PATCH 60/99] Add ver. 0.1 --- libpythonpro/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpythonpro/__init__.py b/libpythonpro/__init__.py index b650ceb08..11d27f8c7 100644 --- a/libpythonpro/__init__.py +++ b/libpythonpro/__init__.py @@ -1 +1 @@ -__version__ = '0.2' +__version__ = '0.1' From d2165b4cc34b145956735341d56ac2e48d9d8d51 Mon Sep 17 00:00:00 2001 From: cacciella Date: Fri, 22 May 2020 15:09:15 -0300 Subject: [PATCH 61/99] Add ver. 0.1.20 --- libpythonpro/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpythonpro/__init__.py b/libpythonpro/__init__.py index 11d27f8c7..e160d939c 100644 --- a/libpythonpro/__init__.py +++ b/libpythonpro/__init__.py @@ -1 +1 @@ -__version__ = '0.1' +__version__ = '0.1.20' From c0bd05e847ceeffb3d2afabaa79f783b2b01e659 Mon Sep 17 00:00:00 2001 From: cacciella Date: Fri, 22 May 2020 15:48:24 -0300 Subject: [PATCH 62/99] Alterar o noe do Package --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2f85eb424..f80efcedb 100644 --- a/setup.py +++ b/setup.py @@ -103,7 +103,7 @@ def find_package_data( # Alteracoes a serem feitas para cada projeto PACKAGE = "libpythonpro" -NAME = PACKAGE +NAME = PACKAGE2 DESCRIPTION = "Módulo para exemplificar construção de projetos Python no curso PyTools" AUTHOR = "Renzo Nuccitelli" AUTHOR_EMAIL = "renzo@python.pro.br" From 0a14e12c572f1475902b69f44f522d4e5394d9bc Mon Sep 17 00:00:00 2001 From: cacciella Date: Fri, 22 May 2020 15:53:35 -0300 Subject: [PATCH 63/99] Alterar o nome do Package --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f80efcedb..df8037714 100644 --- a/setup.py +++ b/setup.py @@ -103,7 +103,7 @@ def find_package_data( # Alteracoes a serem feitas para cada projeto PACKAGE = "libpythonpro" -NAME = PACKAGE2 +NAME = "PACKAGE2" DESCRIPTION = "Módulo para exemplificar construção de projetos Python no curso PyTools" AUTHOR = "Renzo Nuccitelli" AUTHOR_EMAIL = "renzo@python.pro.br" From a4fef501ace616da26e04f2c5d19063388379886 Mon Sep 17 00:00:00 2001 From: cacciella Date: Fri, 22 May 2020 16:35:12 -0300 Subject: [PATCH 64/99] Alterar o nome do Package --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index df8037714..20de621b2 100644 --- a/setup.py +++ b/setup.py @@ -102,8 +102,8 @@ def find_package_data( return out # Alteracoes a serem feitas para cada projeto -PACKAGE = "libpythonpro" -NAME = "PACKAGE2" +PACKAGE = "libpythonpro_02" +NAME = PACKAGE DESCRIPTION = "Módulo para exemplificar construção de projetos Python no curso PyTools" AUTHOR = "Renzo Nuccitelli" AUTHOR_EMAIL = "renzo@python.pro.br" From 51b210ff1c1c9a3dcb437f5dccc7e20a3e89096f Mon Sep 17 00:00:00 2001 From: cacciella Date: Fri, 22 May 2020 16:36:30 -0300 Subject: [PATCH 65/99] Alterar o nome do Package 2 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 20de621b2..b8507dd89 100644 --- a/setup.py +++ b/setup.py @@ -101,7 +101,7 @@ def find_package_data( out.setdefault(package, []).append(prefix + name) return out -# Alteracoes a serem feitas para cada projeto +# Alteracoes a serem feitas para cada projeto PACKAGE = "libpythonpro_02" NAME = PACKAGE DESCRIPTION = "Módulo para exemplificar construção de projetos Python no curso PyTools" From b955c5b3ec756a8f0ffeedaba86bbf63bcb5a224 Mon Sep 17 00:00:00 2001 From: cacciella Date: Fri, 22 May 2020 16:47:06 -0300 Subject: [PATCH 66/99] ver. 0.1.22 --- libpythonpro/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpythonpro/__init__.py b/libpythonpro/__init__.py index e160d939c..872472ae2 100644 --- a/libpythonpro/__init__.py +++ b/libpythonpro/__init__.py @@ -1 +1 @@ -__version__ = '0.1.20' +__version__ = '0.1.22' From 1a60f41d68ded8a5ac77a90e046e2a1ee6050cb4 Mon Sep 17 00:00:00 2001 From: cacciella Date: Fri, 22 May 2020 17:02:04 -0300 Subject: [PATCH 67/99] rename libpythonpro_02 --- .pyup.yml | 3 --- {libpythonpro => libpythonpro_02}/__init__.py | 0 {libpythonpro => libpythonpro_02}/github_api.py | 0 {libpythonpro => libpythonpro_02}/spam/__init__.py | 0 {libpythonpro => libpythonpro_02}/spam/db.py | 0 {libpythonpro => libpythonpro_02}/spam/enviador_de_email.py | 0 {libpythonpro => libpythonpro_02}/spam/main.py | 0 {libpythonpro => libpythonpro_02}/spam/modelos.py | 0 {libpythonpro => libpythonpro_02}/tests/__init__.py | 0 {libpythonpro => libpythonpro_02}/tests/test_exemplo.py | 0 .../tests/test_spam/__init__.py | 0 .../tests/test_spam/conftest.py | 2 +- .../tests/test_spam/test_enviador_de_email.py | 2 +- .../tests/test_spam/test_envio_para_base_de_usuarios.py | 4 ++-- .../tests/test_spam/test_github_api.py | 4 ++-- .../tests/test_spam/test_usuarios.py | 2 +- setup.py | 6 +++--- 17 files changed, 10 insertions(+), 13 deletions(-) delete mode 100644 .pyup.yml rename {libpythonpro => libpythonpro_02}/__init__.py (100%) rename {libpythonpro => libpythonpro_02}/github_api.py (100%) rename {libpythonpro => libpythonpro_02}/spam/__init__.py (100%) rename {libpythonpro => libpythonpro_02}/spam/db.py (100%) rename {libpythonpro => libpythonpro_02}/spam/enviador_de_email.py (100%) rename {libpythonpro => libpythonpro_02}/spam/main.py (100%) rename {libpythonpro => libpythonpro_02}/spam/modelos.py (100%) rename {libpythonpro => libpythonpro_02}/tests/__init__.py (100%) rename {libpythonpro => libpythonpro_02}/tests/test_exemplo.py (100%) rename {libpythonpro => libpythonpro_02}/tests/test_spam/__init__.py (100%) rename {libpythonpro => libpythonpro_02}/tests/test_spam/conftest.py (87%) rename {libpythonpro => libpythonpro_02}/tests/test_spam/test_enviador_de_email.py (91%) rename {libpythonpro => libpythonpro_02}/tests/test_spam/test_envio_para_base_de_usuarios.py (92%) rename {libpythonpro => libpythonpro_02}/tests/test_spam/test_github_api.py (84%) rename {libpythonpro => libpythonpro_02}/tests/test_spam/test_usuarios.py (90%) diff --git a/.pyup.yml b/.pyup.yml deleted file mode 100644 index 551ae40dd..000000000 --- a/.pyup.yml +++ /dev/null @@ -1,3 +0,0 @@ -requirements: - - Pipfile - - Pipfile.lock \ No newline at end of file diff --git a/libpythonpro/__init__.py b/libpythonpro_02/__init__.py similarity index 100% rename from libpythonpro/__init__.py rename to libpythonpro_02/__init__.py diff --git a/libpythonpro/github_api.py b/libpythonpro_02/github_api.py similarity index 100% rename from libpythonpro/github_api.py rename to libpythonpro_02/github_api.py diff --git a/libpythonpro/spam/__init__.py b/libpythonpro_02/spam/__init__.py similarity index 100% rename from libpythonpro/spam/__init__.py rename to libpythonpro_02/spam/__init__.py diff --git a/libpythonpro/spam/db.py b/libpythonpro_02/spam/db.py similarity index 100% rename from libpythonpro/spam/db.py rename to libpythonpro_02/spam/db.py diff --git a/libpythonpro/spam/enviador_de_email.py b/libpythonpro_02/spam/enviador_de_email.py similarity index 100% rename from libpythonpro/spam/enviador_de_email.py rename to libpythonpro_02/spam/enviador_de_email.py diff --git a/libpythonpro/spam/main.py b/libpythonpro_02/spam/main.py similarity index 100% rename from libpythonpro/spam/main.py rename to libpythonpro_02/spam/main.py diff --git a/libpythonpro/spam/modelos.py b/libpythonpro_02/spam/modelos.py similarity index 100% rename from libpythonpro/spam/modelos.py rename to libpythonpro_02/spam/modelos.py diff --git a/libpythonpro/tests/__init__.py b/libpythonpro_02/tests/__init__.py similarity index 100% rename from libpythonpro/tests/__init__.py rename to libpythonpro_02/tests/__init__.py diff --git a/libpythonpro/tests/test_exemplo.py b/libpythonpro_02/tests/test_exemplo.py similarity index 100% rename from libpythonpro/tests/test_exemplo.py rename to libpythonpro_02/tests/test_exemplo.py diff --git a/libpythonpro/tests/test_spam/__init__.py b/libpythonpro_02/tests/test_spam/__init__.py similarity index 100% rename from libpythonpro/tests/test_spam/__init__.py rename to libpythonpro_02/tests/test_spam/__init__.py diff --git a/libpythonpro/tests/test_spam/conftest.py b/libpythonpro_02/tests/test_spam/conftest.py similarity index 87% rename from libpythonpro/tests/test_spam/conftest.py rename to libpythonpro_02/tests/test_spam/conftest.py index a16f3970a..39bf3ca57 100644 --- a/libpythonpro/tests/test_spam/conftest.py +++ b/libpythonpro_02/tests/test_spam/conftest.py @@ -1,6 +1,6 @@ import pytest -from libpythonpro.spam.db import Conexao +from libpythonpro_02.spam.db import Conexao @pytest.fixture(scope='session') diff --git a/libpythonpro/tests/test_spam/test_enviador_de_email.py b/libpythonpro_02/tests/test_spam/test_enviador_de_email.py similarity index 91% rename from libpythonpro/tests/test_spam/test_enviador_de_email.py rename to libpythonpro_02/tests/test_spam/test_enviador_de_email.py index c72a0bbe9..ad28a46ed 100644 --- a/libpythonpro/tests/test_spam/test_enviador_de_email.py +++ b/libpythonpro_02/tests/test_spam/test_enviador_de_email.py @@ -1,6 +1,6 @@ import pytest -from libpythonpro.spam.enviador_de_email import EmailInvalido, Enviador +from libpythonpro_02.spam.enviador_de_email import EmailInvalido, Enviador def test_criar_enviador_de_email(): diff --git a/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py b/libpythonpro_02/tests/test_spam/test_envio_para_base_de_usuarios.py similarity index 92% rename from libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py rename to libpythonpro_02/tests/test_spam/test_envio_para_base_de_usuarios.py index d2db43893..263069c39 100644 --- a/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py +++ b/libpythonpro_02/tests/test_spam/test_envio_para_base_de_usuarios.py @@ -2,8 +2,8 @@ import pytest -from libpythonpro.spam.main import EnviadorDeSpam -from libpythonpro.spam.modelos import Usuario +from libpythonpro_02.spam.main import EnviadorDeSpam +from libpythonpro_02.spam.modelos import Usuario @pytest.mark.parametrize( diff --git a/libpythonpro/tests/test_spam/test_github_api.py b/libpythonpro_02/tests/test_spam/test_github_api.py similarity index 84% rename from libpythonpro/tests/test_spam/test_github_api.py rename to libpythonpro_02/tests/test_spam/test_github_api.py index 21ce9c5d0..497ee100d 100644 --- a/libpythonpro/tests/test_spam/test_github_api.py +++ b/libpythonpro_02/tests/test_spam/test_github_api.py @@ -2,7 +2,7 @@ import pytest -from libpythonpro import github_api +from libpythonpro_02 import github_api @pytest.fixture @@ -13,7 +13,7 @@ def avatar_url(mocker): 'login': 'renzo', 'id': 402714, 'avatar_url': url, } - get_mock = mocker.patch('libpythonpro.github_api.requests.get') + get_mock = mocker.patch('libpythonpro_02.github_api.requests.get') get_mock.return_value = resp_mock return url diff --git a/libpythonpro/tests/test_spam/test_usuarios.py b/libpythonpro_02/tests/test_spam/test_usuarios.py similarity index 90% rename from libpythonpro/tests/test_spam/test_usuarios.py rename to libpythonpro_02/tests/test_spam/test_usuarios.py index 09b523445..2e34153a4 100644 --- a/libpythonpro/tests/test_spam/test_usuarios.py +++ b/libpythonpro_02/tests/test_spam/test_usuarios.py @@ -1,4 +1,4 @@ -from libpythonpro.spam.modelos import Usuario +from libpythonpro_02.spam.modelos import Usuario def test_salvar_usuario(sessao): diff --git a/setup.py b/setup.py index b8507dd89..84c27d044 100644 --- a/setup.py +++ b/setup.py @@ -105,9 +105,9 @@ def find_package_data( PACKAGE = "libpythonpro_02" NAME = PACKAGE DESCRIPTION = "Módulo para exemplificar construção de projetos Python no curso PyTools" -AUTHOR = "Renzo Nuccitelli" -AUTHOR_EMAIL = "renzo@python.pro.br" -URL = "https://github.com/pythonprobr/libpythonpro" +AUTHOR = "Cacciella" +AUTHOR_EMAIL = "arc.mau@gmail.com" +URL = "https://github.com/cacciella/libpythonpro" VERSION = __import__(PACKAGE).__version__ setup( From 4b1f1aa35728504a79d152ff59b79a911a8ba81f Mon Sep 17 00:00:00 2001 From: cacciella Date: Fri, 22 May 2020 20:40:39 -0300 Subject: [PATCH 68/99] ver 0.2 --- libpythonpro_02/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpythonpro_02/__init__.py b/libpythonpro_02/__init__.py index 872472ae2..b650ceb08 100644 --- a/libpythonpro_02/__init__.py +++ b/libpythonpro_02/__init__.py @@ -1 +1 @@ -__version__ = '0.1.22' +__version__ = '0.2' From da64af6471b00bd1c739d69c9137b289a497503e Mon Sep 17 00:00:00 2001 From: cacciella Date: Fri, 22 May 2020 20:41:45 -0300 Subject: [PATCH 69/99] =?UTF-8?q?atualiza=C3=A7=C3=A3o=20do=20Flake8=20=20?= =?UTF-8?q?3.8.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index d7a6aaced..32db13d7f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -flake8==3.8.1 +flake8==3.8.2 mccabe==0.6.1 pycodestyle==2.6.0 pyflakes==2.2.0 From 082f5b7c64992f9890d60017215c60411acadb8d Mon Sep 17 00:00:00 2001 From: cacciella Date: Fri, 22 May 2020 21:34:40 -0300 Subject: [PATCH 70/99] =?UTF-8?q?atualiza=C3=A7=C3=A3o=20do=20Flake8=20=20?= =?UTF-8?q?3.8.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 32db13d7f..c7bcf712f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ flake8==3.8.2 mccabe==0.6.1 pycodestyle==2.6.0 -pyflakes==2.2.0 +pyflakes==2.2.0 \ No newline at end of file From 91264ef6d44b6b465daa3d316ff3eb96f41f5d7d Mon Sep 17 00:00:00 2001 From: cacciella Date: Sat, 23 May 2020 17:14:12 -0300 Subject: [PATCH 71/99] Inserido teste com pytest --- {libpythonpro_02 => libpythonpro}/tests/test_spam/__init__.py | 0 {libpythonpro_02 => libpythonpro}/tests/test_spam/conftest.py | 2 +- .../tests/test_spam/test_enviador_de_email.py | 2 +- .../tests/test_spam/test_envio_para_base_de_usuarios.py | 4 ++-- .../tests/test_spam/test_github_api.py | 4 ++-- .../tests/test_spam/test_usuarios.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) rename {libpythonpro_02 => libpythonpro}/tests/test_spam/__init__.py (100%) rename {libpythonpro_02 => libpythonpro}/tests/test_spam/conftest.py (87%) rename {libpythonpro_02 => libpythonpro}/tests/test_spam/test_enviador_de_email.py (91%) rename {libpythonpro_02 => libpythonpro}/tests/test_spam/test_envio_para_base_de_usuarios.py (92%) rename {libpythonpro_02 => libpythonpro}/tests/test_spam/test_github_api.py (84%) rename {libpythonpro_02 => libpythonpro}/tests/test_spam/test_usuarios.py (90%) diff --git a/libpythonpro_02/tests/test_spam/__init__.py b/libpythonpro/tests/test_spam/__init__.py similarity index 100% rename from libpythonpro_02/tests/test_spam/__init__.py rename to libpythonpro/tests/test_spam/__init__.py diff --git a/libpythonpro_02/tests/test_spam/conftest.py b/libpythonpro/tests/test_spam/conftest.py similarity index 87% rename from libpythonpro_02/tests/test_spam/conftest.py rename to libpythonpro/tests/test_spam/conftest.py index 39bf3ca57..a16f3970a 100644 --- a/libpythonpro_02/tests/test_spam/conftest.py +++ b/libpythonpro/tests/test_spam/conftest.py @@ -1,6 +1,6 @@ import pytest -from libpythonpro_02.spam.db import Conexao +from libpythonpro.spam.db import Conexao @pytest.fixture(scope='session') diff --git a/libpythonpro_02/tests/test_spam/test_enviador_de_email.py b/libpythonpro/tests/test_spam/test_enviador_de_email.py similarity index 91% rename from libpythonpro_02/tests/test_spam/test_enviador_de_email.py rename to libpythonpro/tests/test_spam/test_enviador_de_email.py index ad28a46ed..c72a0bbe9 100644 --- a/libpythonpro_02/tests/test_spam/test_enviador_de_email.py +++ b/libpythonpro/tests/test_spam/test_enviador_de_email.py @@ -1,6 +1,6 @@ import pytest -from libpythonpro_02.spam.enviador_de_email import EmailInvalido, Enviador +from libpythonpro.spam.enviador_de_email import EmailInvalido, Enviador def test_criar_enviador_de_email(): diff --git a/libpythonpro_02/tests/test_spam/test_envio_para_base_de_usuarios.py b/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py similarity index 92% rename from libpythonpro_02/tests/test_spam/test_envio_para_base_de_usuarios.py rename to libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py index 263069c39..d2db43893 100644 --- a/libpythonpro_02/tests/test_spam/test_envio_para_base_de_usuarios.py +++ b/libpythonpro/tests/test_spam/test_envio_para_base_de_usuarios.py @@ -2,8 +2,8 @@ import pytest -from libpythonpro_02.spam.main import EnviadorDeSpam -from libpythonpro_02.spam.modelos import Usuario +from libpythonpro.spam.main import EnviadorDeSpam +from libpythonpro.spam.modelos import Usuario @pytest.mark.parametrize( diff --git a/libpythonpro_02/tests/test_spam/test_github_api.py b/libpythonpro/tests/test_spam/test_github_api.py similarity index 84% rename from libpythonpro_02/tests/test_spam/test_github_api.py rename to libpythonpro/tests/test_spam/test_github_api.py index 497ee100d..21ce9c5d0 100644 --- a/libpythonpro_02/tests/test_spam/test_github_api.py +++ b/libpythonpro/tests/test_spam/test_github_api.py @@ -2,7 +2,7 @@ import pytest -from libpythonpro_02 import github_api +from libpythonpro import github_api @pytest.fixture @@ -13,7 +13,7 @@ def avatar_url(mocker): 'login': 'renzo', 'id': 402714, 'avatar_url': url, } - get_mock = mocker.patch('libpythonpro_02.github_api.requests.get') + get_mock = mocker.patch('libpythonpro.github_api.requests.get') get_mock.return_value = resp_mock return url diff --git a/libpythonpro_02/tests/test_spam/test_usuarios.py b/libpythonpro/tests/test_spam/test_usuarios.py similarity index 90% rename from libpythonpro_02/tests/test_spam/test_usuarios.py rename to libpythonpro/tests/test_spam/test_usuarios.py index 2e34153a4..09b523445 100644 --- a/libpythonpro_02/tests/test_spam/test_usuarios.py +++ b/libpythonpro/tests/test_spam/test_usuarios.py @@ -1,4 +1,4 @@ -from libpythonpro_02.spam.modelos import Usuario +from libpythonpro.spam.modelos import Usuario def test_salvar_usuario(sessao): From faa2d3d12da154db730af50d0cefb9a82195a7c3 Mon Sep 17 00:00:00 2001 From: cacciella Date: Sat, 23 May 2020 17:15:31 -0300 Subject: [PATCH 72/99] Travis CI --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 32160871c..0b60a04e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,4 +4,7 @@ python: install: - pip install -q -r requirements-dev.txt script: - - flake8 \ No newline at end of file + - flake8 + - pytest libpythonpro --cov=libpythonpro +after_success: + - codecov \ No newline at end of file From fbba11394dfa399b83be966d5a46dc1de536622a Mon Sep 17 00:00:00 2001 From: cacciella Date: Sat, 23 May 2020 17:17:32 -0300 Subject: [PATCH 73/99] Inserido teste com pytest --- .idea/libpythonpro.iml | 3 +++ {libpythonpro_02 => libpythonpro}/__init__.py | 0 {libpythonpro_02 => libpythonpro}/github_api.py | 0 {libpythonpro_02 => libpythonpro}/spam/__init__.py | 0 {libpythonpro_02 => libpythonpro}/spam/db.py | 0 .../spam/enviador_de_email.py | 0 {libpythonpro_02 => libpythonpro}/spam/main.py | 0 {libpythonpro_02 => libpythonpro}/spam/modelos.py | 0 .../tests/__init__.py | 0 .../tests/test_exemplo.py | 0 requirements-dev.txt | 14 ++++++++++++-- setup.py | 2 +- 12 files changed, 16 insertions(+), 3 deletions(-) rename {libpythonpro_02 => libpythonpro}/__init__.py (100%) rename {libpythonpro_02 => libpythonpro}/github_api.py (100%) rename {libpythonpro_02 => libpythonpro}/spam/__init__.py (100%) rename {libpythonpro_02 => libpythonpro}/spam/db.py (100%) rename {libpythonpro_02 => libpythonpro}/spam/enviador_de_email.py (100%) rename {libpythonpro_02 => libpythonpro}/spam/main.py (100%) rename {libpythonpro_02 => libpythonpro}/spam/modelos.py (100%) rename {libpythonpro_02 => libpythonpro}/tests/__init__.py (100%) rename {libpythonpro_02 => libpythonpro}/tests/test_exemplo.py (100%) diff --git a/.idea/libpythonpro.iml b/.idea/libpythonpro.iml index 442829ebb..13da07b02 100644 --- a/.idea/libpythonpro.iml +++ b/.idea/libpythonpro.iml @@ -7,4 +7,7 @@ + + \ No newline at end of file diff --git a/libpythonpro_02/__init__.py b/libpythonpro/__init__.py similarity index 100% rename from libpythonpro_02/__init__.py rename to libpythonpro/__init__.py diff --git a/libpythonpro_02/github_api.py b/libpythonpro/github_api.py similarity index 100% rename from libpythonpro_02/github_api.py rename to libpythonpro/github_api.py diff --git a/libpythonpro_02/spam/__init__.py b/libpythonpro/spam/__init__.py similarity index 100% rename from libpythonpro_02/spam/__init__.py rename to libpythonpro/spam/__init__.py diff --git a/libpythonpro_02/spam/db.py b/libpythonpro/spam/db.py similarity index 100% rename from libpythonpro_02/spam/db.py rename to libpythonpro/spam/db.py diff --git a/libpythonpro_02/spam/enviador_de_email.py b/libpythonpro/spam/enviador_de_email.py similarity index 100% rename from libpythonpro_02/spam/enviador_de_email.py rename to libpythonpro/spam/enviador_de_email.py diff --git a/libpythonpro_02/spam/main.py b/libpythonpro/spam/main.py similarity index 100% rename from libpythonpro_02/spam/main.py rename to libpythonpro/spam/main.py diff --git a/libpythonpro_02/spam/modelos.py b/libpythonpro/spam/modelos.py similarity index 100% rename from libpythonpro_02/spam/modelos.py rename to libpythonpro/spam/modelos.py diff --git a/libpythonpro_02/tests/__init__.py b/libpythonpro/tests/__init__.py similarity index 100% rename from libpythonpro_02/tests/__init__.py rename to libpythonpro/tests/__init__.py diff --git a/libpythonpro_02/tests/test_exemplo.py b/libpythonpro/tests/test_exemplo.py similarity index 100% rename from libpythonpro_02/tests/test_exemplo.py rename to libpythonpro/tests/test_exemplo.py diff --git a/requirements-dev.txt b/requirements-dev.txt index c7bcf712f..6ce76224c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,14 @@ -flake8==3.8.2 +flake8==3.8.1 mccabe==0.6.1 pycodestyle==2.6.0 -pyflakes==2.2.0 \ No newline at end of file +pyflakes==2.2.0 + +# Deps do pytest +py==1.5.0 +more-itertools==4.0.0 +#six==1.15.0 +attrs==17.4.0 +#pluggy==0.13.1 +pyparsing==2.0.2 +#pytest==5.4.2 +-r requirements.txt \ No newline at end of file diff --git a/setup.py b/setup.py index 84c27d044..3f43c3229 100644 --- a/setup.py +++ b/setup.py @@ -102,7 +102,7 @@ def find_package_data( return out # Alteracoes a serem feitas para cada projeto -PACKAGE = "libpythonpro_02" +PACKAGE = "libpythonpro" NAME = PACKAGE DESCRIPTION = "Módulo para exemplificar construção de projetos Python no curso PyTools" AUTHOR = "Cacciella" From 126f76bb0d41fafaa961ad0e1ae1c71c76856f5c Mon Sep 17 00:00:00 2001 From: cacciella Date: Sat, 23 May 2020 17:21:54 -0300 Subject: [PATCH 74/99] pytest lib --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0b60a04e3..6024234d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,6 @@ install: - pip install -q -r requirements-dev.txt script: - flake8 - - pytest libpythonpro --cov=libpythonpro + - pytest libpythonpro after_success: - codecov \ No newline at end of file From 03c5cde58c6b4f34482905ca787d2f2b62266a01 Mon Sep 17 00:00:00 2001 From: cacciella Date: Sat, 23 May 2020 17:26:58 -0300 Subject: [PATCH 75/99] pytest deps py --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 6ce76224c..b2eeb8e04 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ pycodestyle==2.6.0 pyflakes==2.2.0 # Deps do pytest -py==1.5.0 +py==1.8.1 more-itertools==4.0.0 #six==1.15.0 attrs==17.4.0 From 3ca51250900c39b0ca892cfff78f374753596b3c Mon Sep 17 00:00:00 2001 From: cacciella Date: Sat, 23 May 2020 17:30:45 -0300 Subject: [PATCH 76/99] =?UTF-8?q?atualiza=C3=A7=C3=A3o=20do=20Flake8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index b2eeb8e04..09817652e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -flake8==3.8.1 +flake8==3.8.2 mccabe==0.6.1 pycodestyle==2.6.0 pyflakes==2.2.0 From 79e0eb1d3076ab683642abd0784da32b5738a4d5 Mon Sep 17 00:00:00 2001 From: cacciella Date: Sat, 23 May 2020 17:34:43 -0300 Subject: [PATCH 77/99] =?UTF-8?q?atualiza=C3=A7=C3=A3o=20do=20attrs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements-dev.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 09817652e..b3350c28d 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,9 +5,9 @@ pyflakes==2.2.0 # Deps do pytest py==1.8.1 -more-itertools==4.0.0 +more-itertools==8.3.0 #six==1.15.0 -attrs==17.4.0 +attrs==19.3.0 #pluggy==0.13.1 pyparsing==2.0.2 #pytest==5.4.2 From 281ccf4c35f95829c420e2849c40619b6b668ef1 Mon Sep 17 00:00:00 2001 From: cacciella Date: Sat, 23 May 2020 17:36:19 -0300 Subject: [PATCH 78/99] =?UTF-8?q?atualiza=C3=A7=C3=A3o=20do=20pyparsing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index b3350c28d..9e50eed2f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -9,6 +9,6 @@ more-itertools==8.3.0 #six==1.15.0 attrs==19.3.0 #pluggy==0.13.1 -pyparsing==2.0.2 +pyparsing==2.4.7 #pytest==5.4.2 -r requirements.txt \ No newline at end of file From bd8c04efa4317f06b336d598e9f4fc4992ae415d Mon Sep 17 00:00:00 2001 From: cacciella Date: Sat, 23 May 2020 17:37:33 -0300 Subject: [PATCH 79/99] =?UTF-8?q?atualiza=C3=A7=C3=A3o=20do=20six?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 9e50eed2f..ad0dba520 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,7 +6,7 @@ pyflakes==2.2.0 # Deps do pytest py==1.8.1 more-itertools==8.3.0 -#six==1.15.0 +six==1.15.0 attrs==19.3.0 #pluggy==0.13.1 pyparsing==2.4.7 From 7071a5f5cefff55d4c3c61f49dae67169c031a37 Mon Sep 17 00:00:00 2001 From: cacciella Date: Sat, 23 May 2020 17:38:32 -0300 Subject: [PATCH 80/99] =?UTF-8?q?atualiza=C3=A7=C3=A3o=20do=20pluggy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index ad0dba520..1b0daf725 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -8,7 +8,7 @@ py==1.8.1 more-itertools==8.3.0 six==1.15.0 attrs==19.3.0 -#pluggy==0.13.1 +pluggy==0.13.1 pyparsing==2.4.7 #pytest==5.4.2 -r requirements.txt \ No newline at end of file From 9ae0d7c4164f1cdce478a55f569f85886954601c Mon Sep 17 00:00:00 2001 From: cacciella Date: Sat, 23 May 2020 17:39:13 -0300 Subject: [PATCH 81/99] =?UTF-8?q?atualiza=C3=A7=C3=A3o=20do=20pytest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1b0daf725..ccc804480 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -10,5 +10,5 @@ six==1.15.0 attrs==19.3.0 pluggy==0.13.1 pyparsing==2.4.7 -#pytest==5.4.2 +pytest==5.4.2 -r requirements.txt \ No newline at end of file From 409e3e8f1628d4691932428daea17c592a7fc29f Mon Sep 17 00:00:00 2001 From: cacciella Date: Sat, 23 May 2020 17:39:13 -0300 Subject: [PATCH 82/99] =?UTF-8?q?atualiza=C3=A7=C3=A3o=20do=20pytest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libpythonpro/tests/test_exemplo.py | 2 +- requirements-dev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libpythonpro/tests/test_exemplo.py b/libpythonpro/tests/test_exemplo.py index 78cd50236..5afa8ef5d 100644 --- a/libpythonpro/tests/test_exemplo.py +++ b/libpythonpro/tests/test_exemplo.py @@ -1,2 +1,2 @@ def test_int(): - assert 1 == 1 + assert 1 == 0 diff --git a/requirements-dev.txt b/requirements-dev.txt index 1b0daf725..ccc804480 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -10,5 +10,5 @@ six==1.15.0 attrs==19.3.0 pluggy==0.13.1 pyparsing==2.4.7 -#pytest==5.4.2 +pytest==5.4.2 -r requirements.txt \ No newline at end of file From 40b4a34209556efd87a7518a6cdbb6f97f931890 Mon Sep 17 00:00:00 2001 From: cacciella Date: Sat, 23 May 2020 17:45:28 -0300 Subject: [PATCH 83/99] =?UTF-8?q?atualiza=C3=A7=C3=A3o=20do=20pytest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libpythonpro/tests/test_exemplo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpythonpro/tests/test_exemplo.py b/libpythonpro/tests/test_exemplo.py index 5afa8ef5d..2df2de1ef 100644 --- a/libpythonpro/tests/test_exemplo.py +++ b/libpythonpro/tests/test_exemplo.py @@ -1,2 +1,2 @@ def test_int(): - assert 1 == 0 + assert 1 == 12 From 8ee5fc5f0c1d59d64006c30d22b23411ac27493a Mon Sep 17 00:00:00 2001 From: cacciella Date: Sat, 23 May 2020 17:48:34 -0300 Subject: [PATCH 84/99] Inserido teste com pytest --- libpythonpro/tests/test_exemplo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpythonpro/tests/test_exemplo.py b/libpythonpro/tests/test_exemplo.py index 2df2de1ef..78cd50236 100644 --- a/libpythonpro/tests/test_exemplo.py +++ b/libpythonpro/tests/test_exemplo.py @@ -1,2 +1,2 @@ def test_int(): - assert 1 == 12 + assert 1 == 1 From 632daa3fbaa37aebff744e2caffc1f2bbcc48644 Mon Sep 17 00:00:00 2001 From: cacciella Date: Sat, 23 May 2020 21:27:37 -0300 Subject: [PATCH 85/99] =?UTF-8?q?Acrescentada=20a=20cobertura=20de=20c?= =?UTF-8?q?=C3=B3digo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 4 ++-- README.md | 1 + requirements-dev.txt | 5 +++++ setup.py | 3 ++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6024234d2..164cdecf3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,9 @@ language: python python: - 3.8 install: - - pip install -q -r requirements-dev.txt + - pip install -q -r requirements-dev.txt codecov script: - flake8 - - pytest libpythonpro + - pytest libpythonpro --cov=libpythonpro after_success: - codecov \ No newline at end of file diff --git a/README.md b/README.md index 86cc0e8dd..6f3f9c8b9 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Link para o curso [Python Pro](https://www.python.pro.br/) [![Build Status](https://travis-ci.org/cacciella/libpythonpro.svg?branch=master)](https://travis-ci.org/cacciella/libpythonpro) [![Updates](https://pyup.io/repos/github/cacciella/libpythonpro/shield.svg)](https://pyup.io/repos/github/cacciella/libpythonpro/) [![Python 3](https://pyup.io/repos/github/cacciella/libpythonpro/python-3-shield.svg)](https://pyup.io/repos/github/cacciella/libpythonpro/) +[![codecov](https://codecov.io/gh/cacciella/libpythonpro/branch/master/graph/badge.svg)](https://codecov.io/gh/cacciella/libpythonpro) Suportada versão 3 de Python diff --git a/requirements-dev.txt b/requirements-dev.txt index ccc804480..a1ddfb39e 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -11,4 +11,9 @@ attrs==19.3.0 pluggy==0.13.1 pyparsing==2.4.7 pytest==5.4.2 + +# Coverage +coverage==5.1 +pytest-cov==2.9.0 + -r requirements.txt \ No newline at end of file diff --git a/setup.py b/setup.py index 3f43c3229..d529f10bd 100644 --- a/setup.py +++ b/setup.py @@ -101,7 +101,8 @@ def find_package_data( out.setdefault(package, []).append(prefix + name) return out -# Alteracoes a serem feitas para cada projeto + +# Alteracoes a serem feitas para cada projeto PACKAGE = "libpythonpro" NAME = PACKAGE DESCRIPTION = "Módulo para exemplificar construção de projetos Python no curso PyTools" From 908370ee4a27370398abf6f4e696168fdc27ff5c Mon Sep 17 00:00:00 2001 From: cacciella Date: Mon, 25 May 2020 11:51:26 -0300 Subject: [PATCH 86/99] Teste de usuarios --- libpythonpro/tests/test_spam/conftest.py | 3 +++ .../tests/test_spam/test_enviador_de_email.py | 14 +++++----- libpythonpro/tests/test_spam/test_usuarios.py | 27 +++++++++++++++++++ 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/libpythonpro/tests/test_spam/conftest.py b/libpythonpro/tests/test_spam/conftest.py index a16f3970a..7d436ce55 100644 --- a/libpythonpro/tests/test_spam/conftest.py +++ b/libpythonpro/tests/test_spam/conftest.py @@ -1,3 +1,6 @@ +# permitir que fixtures sejam reutilizadas por +# diferentes módulos utilizando o arquivo conftest.py + import pytest from libpythonpro.spam.db import Conexao diff --git a/libpythonpro/tests/test_spam/test_enviador_de_email.py b/libpythonpro/tests/test_spam/test_enviador_de_email.py index c72a0bbe9..f3cdbd0d8 100644 --- a/libpythonpro/tests/test_spam/test_enviador_de_email.py +++ b/libpythonpro/tests/test_spam/test_enviador_de_email.py @@ -10,29 +10,29 @@ def test_criar_enviador_de_email(): @pytest.mark.parametrize( 'remetente', - ['foo@bar.com.br', 'renzo@python.pro.br'] + ['foo@bar.com.br', 'arc.mau@gmail.com'] ) def test_remetente(remetente): enviador = Enviador() resultado = enviador.enviar( remetente, - 'luciano@python.pro.br', - 'Cursos Python Pro', - 'Primeira turma Guido Von Rossum aberta.' + 'renzo@python.pro.br', + 'Curso Python Pro', + 'Primeira turma Luiz Vital aberta.' ) assert remetente in resultado @pytest.mark.parametrize( 'remetente', - ['', 'renzo'] + ['', 'cacciella'] ) def test_remetente_invalido(remetente): enviador = Enviador() with pytest.raises(EmailInvalido): enviador.enviar( remetente, - 'luciano@python.pro.br', + 'renzo@python.pro.br', 'Cursos Python Pro', - 'Primeira turma Guido Von Rossum aberta.' + 'Primeira turma Luiz Vital aberta.' ) diff --git a/libpythonpro/tests/test_spam/test_usuarios.py b/libpythonpro/tests/test_spam/test_usuarios.py index 09b523445..3292a33c0 100644 --- a/libpythonpro/tests/test_spam/test_usuarios.py +++ b/libpythonpro/tests/test_spam/test_usuarios.py @@ -1,3 +1,30 @@ +# Código da aula: criada uma abstração de banco de dados +# +# def test_salvar_usuario(): +# conexao = Caonexao() +# sessao = conexao.gerar_seessao() +# usuario = Usuario(nome='Cacciella') +# sessao.salvar(usuario) +# assert isinstance(usuario.id, int) +# sessao.roll_back() +# sessao.fechar() +# conexao.fechar() +# +# +# def test_listar_usuario(): +# conexao = Caonexao() +# sessao = conexao.gerar_seessao() +# usuarios = [Usuario(nome='Cacciella'),Usuario(nome='Marcos')] +# for usuario in usuarios: +# sessao.salvar(usuario) +# assert usuario.sessao.listar() +# sessao.roll_back() +# sessao.fechar() +# conexao.fechar() + + + + from libpythonpro.spam.modelos import Usuario From c00a5d9a34d88c6a6de1182525b901fa3dab32cf Mon Sep 17 00:00:00 2001 From: cacciella Date: Mon, 25 May 2020 11:55:51 -0300 Subject: [PATCH 87/99] Teste de usuarios --- libpythonpro/tests/test_spam/test_usuarios.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/libpythonpro/tests/test_spam/test_usuarios.py b/libpythonpro/tests/test_spam/test_usuarios.py index 3292a33c0..345a1d9e1 100644 --- a/libpythonpro/tests/test_spam/test_usuarios.py +++ b/libpythonpro/tests/test_spam/test_usuarios.py @@ -23,8 +23,6 @@ # conexao.fechar() - - from libpythonpro.spam.modelos import Usuario From dea7ac047b5f24da3de81784877b62adff746db0 Mon Sep 17 00:00:00 2001 From: cacciella Date: Mon, 25 May 2020 11:58:11 -0300 Subject: [PATCH 88/99] Teste de usuarios --- libpythonpro/tests/test_spam/test_usuarios.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/libpythonpro/tests/test_spam/test_usuarios.py b/libpythonpro/tests/test_spam/test_usuarios.py index 345a1d9e1..ecfe4b620 100644 --- a/libpythonpro/tests/test_spam/test_usuarios.py +++ b/libpythonpro/tests/test_spam/test_usuarios.py @@ -21,11 +21,8 @@ # sessao.roll_back() # sessao.fechar() # conexao.fechar() - - from libpythonpro.spam.modelos import Usuario - def test_salvar_usuario(sessao): usuario = Usuario(nome='Renzo', email='renzo@python.pro.br') sessao.salvar(usuario) From 12d7d5342821f258b5b87b3cc5dc3c55bfb126b2 Mon Sep 17 00:00:00 2001 From: cacciella Date: Mon, 25 May 2020 12:06:21 -0300 Subject: [PATCH 89/99] Teste de usuarios --- libpythonpro/tests/test_spam/test_usuarios.py | 1 + 1 file changed, 1 insertion(+) diff --git a/libpythonpro/tests/test_spam/test_usuarios.py b/libpythonpro/tests/test_spam/test_usuarios.py index ecfe4b620..0a907c67c 100644 --- a/libpythonpro/tests/test_spam/test_usuarios.py +++ b/libpythonpro/tests/test_spam/test_usuarios.py @@ -23,6 +23,7 @@ # conexao.fechar() from libpythonpro.spam.modelos import Usuario + def test_salvar_usuario(sessao): usuario = Usuario(nome='Renzo', email='renzo@python.pro.br') sessao.salvar(usuario) From 08097a11de94138e7e7158b8e3576da9e5f0d8e2 Mon Sep 17 00:00:00 2001 From: cacciella Date: Mon, 25 May 2020 17:30:30 -0300 Subject: [PATCH 90/99] alterar license --- setup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index d529f10bd..e43267140 100644 --- a/setup.py +++ b/setup.py @@ -119,7 +119,7 @@ def find_package_data( long_description_content_type='text/markdown', author=AUTHOR, author_email=AUTHOR_EMAIL, - license=read('LICENSE'), + license=read('GNU AFFERO GENERAL PUBLIC LICENSE'), url=URL, packages=find_packages(exclude=["tests.*", "tests"]), package_data=find_package_data(PACKAGE, only_in_packages=False), @@ -131,7 +131,8 @@ def find_package_data( "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8.2", "Framework :: Pytest", ], install_requires=[ From c634f7cd9219ceb73fd5e676b9278fa1adc8608e Mon Sep 17 00:00:00 2001 From: cacciella Date: Mon, 25 May 2020 17:43:33 -0300 Subject: [PATCH 91/99] alterar license --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e43267140..84384910e 100644 --- a/setup.py +++ b/setup.py @@ -119,7 +119,7 @@ def find_package_data( long_description_content_type='text/markdown', author=AUTHOR, author_email=AUTHOR_EMAIL, - license=read('GNU AFFERO GENERAL PUBLIC LICENSE'), + license=read('GNU Affero General Public License v3 or later (AGPLv3+)'), url=URL, packages=find_packages(exclude=["tests.*", "tests"]), package_data=find_package_data(PACKAGE, only_in_packages=False), From 469485f486c820de6973563412b3f24f85d49864 Mon Sep 17 00:00:00 2001 From: cacciella Date: Mon, 8 Jun 2020 17:09:31 -0300 Subject: [PATCH 92/99] alterado gestor de dependencia para pipenv close #2 --- requirements.txt | 5 ----- setup.py | 3 --- 2 files changed, 8 deletions(-) delete mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index ceec2f8d8..000000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -certifi==2020.4.5.1 -chardet==3.0.4 -idna==2.9 -requests==2.23.0 -urllib3==1.25.9 \ No newline at end of file diff --git a/setup.py b/setup.py index 84384910e..ba46eb751 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,3 @@ -# https://github.com/pythonprobr/libpythonpro/blob/master/setup.py import codecs import os import sys @@ -123,7 +122,6 @@ def find_package_data( url=URL, packages=find_packages(exclude=["tests.*", "tests"]), package_data=find_package_data(PACKAGE, only_in_packages=False), - # https://pypi.org/pypi?%3Aaction=list_classifiers classifiers=[ "Development Status :: 2 - Pre-Alpha", "Environment :: Console", @@ -132,7 +130,6 @@ def find_package_data( "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8.2", "Framework :: Pytest", ], install_requires=[ From e784c9eb3173aba7e1cb8bb1ada486e473a67a26 Mon Sep 17 00:00:00 2001 From: cacciella Date: Mon, 8 Jun 2020 17:58:57 -0300 Subject: [PATCH 93/99] alterado gestor de dependencia para pipenv close #2 --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 164cdecf3..6694375b7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,9 @@ language: python python: - - 3.8 + - 3.7 install: - - pip install -q -r requirements-dev.txt codecov + - pip install -q pipenv codecov + - pipenv sync --dev script: - flake8 - pytest libpythonpro --cov=libpythonpro From abafe04c555445f1ef9cdbfe48777e2b8d8df8e5 Mon Sep 17 00:00:00 2001 From: cacciella Date: Mon, 8 Jun 2020 18:12:02 -0300 Subject: [PATCH 94/99] alterado gestor de dependencia para pipenv close #2 --- requirements-dev.txt | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 requirements-dev.txt diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index a1ddfb39e..000000000 --- a/requirements-dev.txt +++ /dev/null @@ -1,19 +0,0 @@ -flake8==3.8.2 -mccabe==0.6.1 -pycodestyle==2.6.0 -pyflakes==2.2.0 - -# Deps do pytest -py==1.8.1 -more-itertools==8.3.0 -six==1.15.0 -attrs==19.3.0 -pluggy==0.13.1 -pyparsing==2.4.7 -pytest==5.4.2 - -# Coverage -coverage==5.1 -pytest-cov==2.9.0 - --r requirements.txt \ No newline at end of file From c63da6f78dab19ea1c2d2438ac33ca60d8dcdac2 Mon Sep 17 00:00:00 2001 From: cacciella Date: Mon, 8 Jun 2020 18:21:41 -0300 Subject: [PATCH 95/99] =?UTF-8?q?Atualizado=20configura=C3=A7=C3=A3o=20de?= =?UTF-8?q?=20Pyup=20de=20acordo=20com=20a=20pipenv?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close #3 --- .pyup.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .pyup.yml diff --git a/.pyup.yml b/.pyup.yml new file mode 100644 index 000000000..551ae40dd --- /dev/null +++ b/.pyup.yml @@ -0,0 +1,3 @@ +requirements: + - Pipfile + - Pipfile.lock \ No newline at end of file From 69d4e7100f7fd1a31032b4813720e668fa5b53d1 Mon Sep 17 00:00:00 2001 From: cacciella Date: Mon, 8 Jun 2020 18:54:11 -0300 Subject: [PATCH 96/99] Atualizado pipenv --- Pipfile.lock | 212 +++++++++++++++++++++++---------------------------- 1 file changed, 97 insertions(+), 115 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 8a647ca6f..1b6e254b6 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -18,10 +18,10 @@ "default": { "certifi": { "hashes": [ - "sha256:046832c04d4e752f37383b628bc601a7ea7211496b4638f6514d0e5b9acc4939", - "sha256:945e3ba63a0b9f577b1395204e13c3a231f9bc0223888be653286534e5873695" + "sha256:5ad7e9a056d25ffa5082862e36f119f7f7cec6457fa07ee2f8c339814b80c9b1", + "sha256:9cd41137dc19af6a5e03b630eefe7d1f458d964d406342dd3edf625839b944cc" ], - "version": "==2019.6.16" + "version": "==2020.4.5.2" }, "chardet": { "hashes": [ @@ -32,100 +32,82 @@ }, "idna": { "hashes": [ - "sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407", - "sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c" + "sha256:7588d1c14ae4c77d74036e8c22ff447b26d0fde8f007354fd48a7814db15b7cb", + "sha256:a068a21ceac8a4d63dbfd964670474107f541babbd2250d61922f029858365fa" ], - "version": "==2.8" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==2.9" }, "requests": { "hashes": [ - "sha256:11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4", - "sha256:9cf5292fcd0f598c671cfc1e0d7d1a7f13bb8085e9a590f48c010551dc6c4b31" + "sha256:43999036bfa82904b6af1d99e4882b560e5e2c68e5c4b0aa03b655f3d7d73fee", + "sha256:b3f43d496c6daba4493e7c431722aeb7dbc6288f52a6e04e7b6023b0247817e6" ], "index": "pypi", - "version": "==2.22.0" + "version": "==2.23.0" }, "urllib3": { "hashes": [ - "sha256:b246607a25ac80bedac05c6f282e3cdaf3afb65420fd024ac94435cabe6e18d1", - "sha256:dbe59173209418ae49d485b87d1681aefa36252ee85884c31346debd19463232" + "sha256:3018294ebefce6572a474f0604c2021e33b3fd8006ecd11d62107a5d2a963527", + "sha256:88206b0eb87e6d677d424843ac5209e3fb9d0190d0ee169599165ec25e9d9115" ], - "version": "==1.25.3" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", + "version": "==1.25.9" } }, "develop": { - "atomicwrites": { - "hashes": [ - "sha256:03472c30eb2c5d1ba9227e4c2ca66ab8287fbfbbda3888aa93dc2e28fc6811b4", - "sha256:75a9445bac02d8d058d5e1fe689654ba5a6556a1dfd8ce6ec55a0ed79866cfa6" - ], - "version": "==1.3.0" - }, "attrs": { "hashes": [ - "sha256:69c0dbf2ed392de1cb5ec704444b08a5ef81680a61cb899dc08127123af36a79", - "sha256:f0b870f674851ecbfbbbd364d6b5cbdff9dcedbc7f3f5e18a6891057f21fe399" + "sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c", + "sha256:f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72" ], - "version": "==19.1.0" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==19.3.0" }, "coverage": { "hashes": [ - "sha256:3684fabf6b87a369017756b551cef29e505cb155ddb892a7a29277b978da88b9", - "sha256:39e088da9b284f1bd17c750ac672103779f7954ce6125fd4382134ac8d152d74", - "sha256:3c205bc11cc4fcc57b761c2da73b9b72a59f8d5ca89979afb0c1c6f9e53c7390", - "sha256:465ce53a8c0f3a7950dfb836438442f833cf6663d407f37d8c52fe7b6e56d7e8", - "sha256:48020e343fc40f72a442c8a1334284620f81295256a6b6ca6d8aa1350c763bbe", - "sha256:5296fc86ab612ec12394565c500b412a43b328b3907c0d14358950d06fd83baf", - "sha256:5f61bed2f7d9b6a9ab935150a6b23d7f84b8055524e7be7715b6513f3328138e", - "sha256:68a43a9f9f83693ce0414d17e019daee7ab3f7113a70c79a3dd4c2f704e4d741", - "sha256:6b8033d47fe22506856fe450470ccb1d8ba1ffb8463494a15cfc96392a288c09", - "sha256:7ad7536066b28863e5835e8cfeaa794b7fe352d99a8cded9f43d1161be8e9fbd", - "sha256:7bacb89ccf4bedb30b277e96e4cc68cd1369ca6841bde7b005191b54d3dd1034", - "sha256:839dc7c36501254e14331bcb98b27002aa415e4af7ea039d9009409b9d2d5420", - "sha256:8f9a95b66969cdea53ec992ecea5406c5bd99c9221f539bca1e8406b200ae98c", - "sha256:932c03d2d565f75961ba1d3cec41ddde00e162c5b46d03f7423edcb807734eab", - "sha256:988529edadc49039d205e0aa6ce049c5ccda4acb2d6c3c5c550c17e8c02c05ba", - "sha256:998d7e73548fe395eeb294495a04d38942edb66d1fa61eb70418871bc621227e", - "sha256:9de60893fb447d1e797f6bf08fdf0dbcda0c1e34c1b06c92bd3a363c0ea8c609", - "sha256:9e80d45d0c7fcee54e22771db7f1b0b126fb4a6c0a2e5afa72f66827207ff2f2", - "sha256:a545a3dfe5082dc8e8c3eb7f8a2cf4f2870902ff1860bd99b6198cfd1f9d1f49", - "sha256:a5d8f29e5ec661143621a8f4de51adfb300d7a476224156a39a392254f70687b", - "sha256:aca06bfba4759bbdb09bf52ebb15ae20268ee1f6747417837926fae990ebc41d", - "sha256:bb23b7a6fd666e551a3094ab896a57809e010059540ad20acbeec03a154224ce", - "sha256:bfd1d0ae7e292105f29d7deaa9d8f2916ed8553ab9d5f39ec65bcf5deadff3f9", - "sha256:c62ca0a38958f541a73cf86acdab020c2091631c137bd359c4f5bddde7b75fd4", - "sha256:c709d8bda72cf4cd348ccec2a4881f2c5848fd72903c185f363d361b2737f773", - "sha256:c968a6aa7e0b56ecbd28531ddf439c2ec103610d3e2bf3b75b813304f8cb7723", - "sha256:df785d8cb80539d0b55fd47183264b7002077859028dfe3070cf6359bf8b2d9c", - "sha256:f406628ca51e0ae90ae76ea8398677a921b36f0bd71aab2099dfed08abd0322f", - "sha256:f46087bbd95ebae244a0eda01a618aff11ec7a069b15a3ef8f6b520db523dcf1", - "sha256:f8019c5279eb32360ca03e9fac40a12667715546eed5c5eb59eb381f2f501260", - "sha256:fc5f4d209733750afd2714e9109816a29500718b32dd9a5db01c0cb3a019b96a" + "sha256:00f1d23f4336efc3b311ed0d807feb45098fc86dee1ca13b3d6768cdab187c8a", + "sha256:01333e1bd22c59713ba8a79f088b3955946e293114479bbfc2e37d522be03355", + "sha256:0cb4be7e784dcdc050fc58ef05b71aa8e89b7e6636b99967fadbdba694cf2b65", + "sha256:0e61d9803d5851849c24f78227939c701ced6704f337cad0a91e0972c51c1ee7", + "sha256:1601e480b9b99697a570cea7ef749e88123c04b92d84cedaa01e117436b4a0a9", + "sha256:2742c7515b9eb368718cd091bad1a1b44135cc72468c731302b3d641895b83d1", + "sha256:2d27a3f742c98e5c6b461ee6ef7287400a1956c11421eb574d843d9ec1f772f0", + "sha256:402e1744733df483b93abbf209283898e9f0d67470707e3c7516d84f48524f55", + "sha256:5c542d1e62eece33c306d66fe0a5c4f7f7b3c08fecc46ead86d7916684b36d6c", + "sha256:5f2294dbf7875b991c381e3d5af2bcc3494d836affa52b809c91697449d0eda6", + "sha256:6402bd2fdedabbdb63a316308142597534ea8e1895f4e7d8bf7476c5e8751fef", + "sha256:66460ab1599d3cf894bb6baee8c684788819b71a5dc1e8fa2ecc152e5d752019", + "sha256:782caea581a6e9ff75eccda79287daefd1d2631cc09d642b6ee2d6da21fc0a4e", + "sha256:79a3cfd6346ce6c13145731d39db47b7a7b859c0272f02cdb89a3bdcbae233a0", + "sha256:7a5bdad4edec57b5fb8dae7d3ee58622d626fd3a0be0dfceda162a7035885ecf", + "sha256:8fa0cbc7ecad630e5b0f4f35b0f6ad419246b02bc750de7ac66db92667996d24", + "sha256:a027ef0492ede1e03a8054e3c37b8def89a1e3c471482e9f046906ba4f2aafd2", + "sha256:a3f3654d5734a3ece152636aad89f58afc9213c6520062db3978239db122f03c", + "sha256:a82b92b04a23d3c8a581fc049228bafde988abacba397d57ce95fe95e0338ab4", + "sha256:acf3763ed01af8410fc36afea23707d4ea58ba7e86a8ee915dfb9ceff9ef69d0", + "sha256:adeb4c5b608574a3d647011af36f7586811a2c1197c861aedb548dd2453b41cd", + "sha256:b83835506dfc185a319031cf853fa4bb1b3974b1f913f5bb1a0f3d98bdcded04", + "sha256:bb28a7245de68bf29f6fb199545d072d1036a1917dca17a1e75bbb919e14ee8e", + "sha256:bf9cb9a9fd8891e7efd2d44deb24b86d647394b9705b744ff6f8261e6f29a730", + "sha256:c317eaf5ff46a34305b202e73404f55f7389ef834b8dbf4da09b9b9b37f76dd2", + "sha256:dbe8c6ae7534b5b024296464f387d57c13caa942f6d8e6e0346f27e509f0f768", + "sha256:de807ae933cfb7f0c7d9d981a053772452217df2bf38e7e6267c9cbf9545a796", + "sha256:dead2ddede4c7ba6cb3a721870f5141c97dc7d85a079edb4bd8d88c3ad5b20c7", + "sha256:dec5202bfe6f672d4511086e125db035a52b00f1648d6407cc8e526912c0353a", + "sha256:e1ea316102ea1e1770724db01998d1603ed921c54a86a2efcb03428d5417e489", + "sha256:f90bfc4ad18450c80b024036eaf91e4a246ae287701aaa88eaebebf150868052" ], "index": "pypi", - "version": "==4.5.3" - }, - "entrypoints": { - "hashes": [ - "sha256:589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19", - "sha256:c70dd71abe5a8c85e55e12c19bd91ccfeec11a6e99044204511f9ed547d48451" - ], - "version": "==0.3" + "version": "==5.1" }, "flake8": { "hashes": [ - "sha256:859996073f341f2670741b51ec1e67a01da142831aa1fdc6242dbf88dffbe661", - "sha256:a796a115208f5c03b18f332f7c11729812c8c3ded6c46319c59b53efd3819da8" + "sha256:15e351d19611c887e482fb960eae4d44845013cc142d42896e9862f775d8cf5c", + "sha256:f04b9fcbac03b0a3e58c0ab3a0ecc462e023a9faf046d57794184028123aa208" ], "index": "pypi", - "version": "==3.7.7" - }, - "importlib-metadata": { - "hashes": [ - "sha256:6dfd58dfe281e8d240937776065dd3624ad5469c835248219bd16cf2e12dbeb7", - "sha256:cb6ee23b46173539939964df59d3d72c3e0c1b5d54b84f1d8a7e912fe43612db" - ], - "version": "==0.18" + "version": "==3.8.3" }, "mccabe": { "hashes": [ @@ -136,98 +118,98 @@ }, "more-itertools": { "hashes": [ - "sha256:2112d2ca570bb7c3e53ea1a35cd5df42bb0fd10c45f0fb97178679c3c03d64c7", - "sha256:c3e4748ba1aad8dba30a4886b0b1a2004f9a863837b8654e7059eebf727afa5a" + "sha256:558bb897a2232f5e4f8e2399089e35aecb746e1f9191b6584a151647e89267be", + "sha256:7818f596b1e87be009031c7653d01acc46ed422e6656b394b0f765ce66ed4982" ], - "markers": "python_version > '2.7'", - "version": "==7.0.0" + "markers": "python_version >= '3.5'", + "version": "==8.3.0" }, "packaging": { "hashes": [ - "sha256:0c98a5d0be38ed775798ece1b9727178c4469d9c3b4ada66e8e6b7849f8732af", - "sha256:9e1cbf8c12b1f1ce0bb5344b8d7ecf66a6f8a6e91bcb0c84593ed6d3ab5c4ab3" + "sha256:4357f74f47b9c12db93624a82154e9b120fa8293699949152b22065d556079f8", + "sha256:998416ba6962ae7fbd6596850b80e17859a5753ba17c32284f67bfff33784181" ], - "version": "==19.0" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==20.4" }, "pluggy": { "hashes": [ - "sha256:0825a152ac059776623854c1543d65a4ad408eb3d33ee114dff91e57ec6ae6fc", - "sha256:b9817417e95936bf75d85d3f8767f7df6cdde751fc40aed3bb3074cbcb77757c" + "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0", + "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d" ], - "version": "==0.12.0" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==0.13.1" }, "py": { "hashes": [ - "sha256:64f65755aee5b381cea27766a3a147c3f15b9b6b9ac88676de66ba2ae36793fa", - "sha256:dc639b046a6e2cff5bbe40194ad65936d6ba360b52b3c3fe1d08a82dd50b5e53" + "sha256:5e27081401262157467ad6e7f851b7aa402c5852dbcb3dae06768434de5752aa", + "sha256:c20fdd83a5dbc0af9efd622bee9a5564e278f6380fffcacc43ba6f43db2813b0" ], - "version": "==1.8.0" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==1.8.1" }, "pycodestyle": { "hashes": [ - "sha256:95a2219d12372f05704562a14ec30bc76b05a5b297b21a5dfe3f6fac3491ae56", - "sha256:e40a936c9a450ad81df37f549d676d127b1b66000a6c500caa2b085bc0ca976c" + "sha256:2295e7b2f6b5bd100585ebcb1f616591b652db8a741695b3d8f5d28bdc934367", + "sha256:c58a7d2815e0e8d7972bf1803331fb0152f867bd89adf8a01dfd55085434192e" ], - "version": "==2.5.0" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==2.6.0" }, "pyflakes": { "hashes": [ - "sha256:17dbeb2e3f4d772725c777fabc446d5634d1038f234e77343108ce445ea69ce0", - "sha256:d976835886f8c5b31d47970ed689944a0262b5f3afa00a5a7b4dc81e5449f8a2" + "sha256:0d94e0e05a19e57a99444b6ddcf9a6eb2e5c68d3ca1e98e90707af8152c90a92", + "sha256:35b2d75ee967ea93b55750aa9edbbf72813e06a66ba54438df2cfac9e3c27fc8" ], - "version": "==2.1.1" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==2.2.0" }, "pyparsing": { "hashes": [ - "sha256:1873c03321fc118f4e9746baf201ff990ceb915f433f23b395f5580d1840cb2a", - "sha256:9b6323ef4ab914af344ba97510e966d64ba91055d6b9afa6b30799340e89cc03" + "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1", + "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b" ], - "version": "==2.4.0" + "markers": "python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==2.4.7" }, "pytest": { "hashes": [ - "sha256:4a784f1d4f2ef198fe9b7aef793e9fa1a3b2f84e822d9b3a64a181293a572d45", - "sha256:926855726d8ae8371803f7b2e6ec0a69953d9c6311fa7c3b6c1b929ff92d27da" + "sha256:5c0db86b698e8f170ba4582a492248919255fcd4c79b1ee64ace34301fb589a1", + "sha256:7979331bfcba207414f5e1263b5a0f8f521d0f457318836a7355531ed1a4c7d8" ], "index": "pypi", - "version": "==4.6.3" + "version": "==5.4.3" }, "pytest-cov": { "hashes": [ - "sha256:2b097cde81a302e1047331b48cadacf23577e431b61e9c6f49a1170bbe3d3da6", - "sha256:e00ea4fdde970725482f1f35630d12f074e121a23801aabf2ae154ec6bdd343a" + "sha256:b6a814b8ed6247bd81ff47f038511b57fe1ce7f4cc25b9106f1a4b106f1d9322", + "sha256:c87dfd8465d865655a8213859f1b4749b43448b5fae465cb981e16d52a811424" ], "index": "pypi", - "version": "==2.7.1" + "version": "==2.9.0" }, "pytest-mock": { "hashes": [ - "sha256:43ce4e9dd5074993e7c021bb1c22cbb5363e612a2b5a76bc6d956775b10758b7", - "sha256:5bf5771b1db93beac965a7347dc81c675ec4090cb841e49d9d34637a25c30568" + "sha256:636e792f7dd9e2c80657e174c04bf7aa92672350090736d82e97e92ce8f68737", + "sha256:a9fedba70e37acf016238bb2293f2652ce19985ceb245bbd3d7f3e4032667402" ], "index": "pypi", - "version": "==1.10.4" + "version": "==3.1.1" }, "six": { "hashes": [ - "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", - "sha256:d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73" + "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259", + "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced" ], - "version": "==1.12.0" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==1.15.0" }, "wcwidth": { "hashes": [ - "sha256:3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e", - "sha256:f4ebe71925af7b40a864553f761ed559b43544f8f71746c2d756c7fe788ade7c" - ], - "version": "==0.1.7" - }, - "zipp": { - "hashes": [ - "sha256:8c1019c6aad13642199fbe458275ad6a84907634cc9f0989877ccc4a2840139d", - "sha256:ca943a7e809cc12257001ccfb99e3563da9af99d52f261725e96dfe0f9275bc3" + "sha256:79375666b9954d4a1a10739315816324c3e73110af9d0e102d906fdb0aec009f", + "sha256:8c6b5b6ee1360b842645f336d9e5d68c55817c26d3050f46b235ef2bc650e48f" ], - "version": "==0.5.1" + "version": "==0.2.4" } } } From 7e789f7152d86fadf1fa6c02011c1fe724dbfd0f Mon Sep 17 00:00:00 2001 From: cacciella Date: Mon, 8 Jun 2020 19:13:35 -0300 Subject: [PATCH 97/99] Atualizado pipenv --- Pipfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index af5c7333d..4af0456df 100644 --- a/Pipfile +++ b/Pipfile @@ -4,7 +4,7 @@ url = "https://pypi.org/simple" verify_ssl = true [dev-packages] -flake8 = "*" +flake8 = "3.8.3" pytest = "*" coverage = "*" pytest-cov = "*" From 1e8a62e1e19818b83bf828d5affd1c883fcaa390 Mon Sep 17 00:00:00 2001 From: cacciella Date: Mon, 8 Jun 2020 19:15:17 -0300 Subject: [PATCH 98/99] Atualizado pipenv --- Pipfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index 4af0456df..af5c7333d 100644 --- a/Pipfile +++ b/Pipfile @@ -4,7 +4,7 @@ url = "https://pypi.org/simple" verify_ssl = true [dev-packages] -flake8 = "3.8.3" +flake8 = "*" pytest = "*" coverage = "*" pytest-cov = "*" From ba57f7abd058d392556f4973fa7484e8278171c2 Mon Sep 17 00:00:00 2001 From: cacciella Date: Fri, 12 Jun 2020 14:57:13 -0300 Subject: [PATCH 99/99] Implementado o Codcov --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6f3f9c8b9..869381372 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Link para o curso [Python Pro](https://www.python.pro.br/) [![Python 3](https://pyup.io/repos/github/cacciella/libpythonpro/python-3-shield.svg)](https://pyup.io/repos/github/cacciella/libpythonpro/) [![codecov](https://codecov.io/gh/cacciella/libpythonpro/branch/master/graph/badge.svg)](https://codecov.io/gh/cacciella/libpythonpro) + Suportada versão 3 de Python Para instalar: