From d6dc3d95f149df79d814bb7cb1facc4a3583299b Mon Sep 17 00:00:00 2001 From: renzon Date: Mon, 30 Apr 2018 11:13:17 -0300 Subject: [PATCH 1/7] 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 3469cd1c0d143e53a6a4a46544042abdbd5cd8c9 Mon Sep 17 00:00:00 2001 From: renzon Date: Mon, 30 Apr 2018 16:53:08 -0300 Subject: [PATCH 2/7] =?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 cb63ae38ca6d66bbf5d3ffe9498b402ac84ba4dd Mon Sep 17 00:00:00 2001 From: renzon Date: Mon, 30 Apr 2018 17:17:15 -0300 Subject: [PATCH 3/7] =?UTF-8?q?Adcionada=20flake8=20como=20depend=C3=AAnci?= =?UTF-8?q?a?= 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 7a343733089f90aa332990586728b7fd983df925 Mon Sep 17 00:00:00 2001 From: renzon Date: Mon, 30 Apr 2018 17:30:17 -0300 Subject: [PATCH 4/7] 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 efd22b8ec7d396d48f81136395367166ff8c49dc Mon Sep 17 00:00:00 2001 From: renzon Date: Mon, 30 Apr 2018 17:34:12 -0300 Subject: [PATCH 5/7] 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 be2839a08d61a14d3739bca86d9604a391d6eeab Mon Sep 17 00:00:00 2001 From: renzon Date: Mon, 30 Apr 2018 17:36:00 -0300 Subject: [PATCH 6/7] 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 24622a1f20360830903d1bdb8fe170b452bb82b5 Mon Sep 17 00:00:00 2001 From: renzon Date: Sat, 5 May 2018 06:25:14 -0300 Subject: [PATCH 7/7] 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