Skip to main content

libpythonpro

Módulo para exemplificar construção de projetos Python no curso PyTools

Neste curso é ensinado como contribuir com o projeto de código aberto

Link do curso Python Pro

Build Status Updates Python 3 codecov

Suportada a versão 3.9.5 do Python

Para instalar:

# python3 -m venv .venv
# source .venv/bin/activate
# pip install -r requirements-dev.txt

Para conferir a qualidade do código:

# flake8

Tópicos a serem abordados:

  1. Git
  2. Virtualenv
  3. Pip
  4. Travis CI
  5. PyUp
  6. PyPI
  7. PyTest
  8. PyTest Coverage
  9. Code Coverage
  10. Pytest-Mock
  11. Pipenv

Bibliotecas de terceiros utilizadas:

  1. Requests
  2. Flake8
  3. Twine
  4. Pytest
  5. Pytest-cov
  6. Pytest-mock
  7. Pipenv

Instalar o pacote 'libpythonpro' localmente:

# python3 -m venv .venv
# source .venv/bin/activate
# pip install -e ./libpythonpro/

Verificar a Instalação do pacote:

# pip freeze

Testar o pacote, utilizando a biblioteca 'github_api'

# python
Python 3.9.5 (default, May 11 2021, 08:20:37) 
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

>>> from libpythonpro.github_api import buscar_avatar
>>> buscar_avatar('ricardovezetiv')
>>> quit()

Criando a versão '0.1' do projeto 'libpythonpro' no 'Git'

# git tag 0.1
# git push --tags

Upload de pacote para o PyPI

# python setup.py sdist bdist_wheel
# pip install twine
# twine upload dist/*

Para instalar:

# python3 -m venv test
# source test/bin/activate
# pip install libpythonpro-r

# pip freeze
certifi==2021.5.30
charset-normalizer==2.0.3
idna==3.2
libpythonpro-r==0.1
requests==2.26.0
urllib3==1.26.6

Instalar o PyTest

# pip install pytest

Executar o PyTest via linha de comando:

# pytest libpythonpro/tests/

Instalar o PyTest Coverage

# pip install pytest-cov

Executar o PyTest com o Coverage

# pytest libpythonpro --cov=libpythonpro

Instalar o Pytest-Mock

# pip install pytest-mock

Instalar o Pipenv

# pip install pipenv

Comandos utilizados para integrar o projeto ao 'Pipenv'

# deactivate
# rm -Rf .venv
# pipenv install requests
# pipenv install --dev flake8 pytest coverage pytest-cov pytest-mock
# pipenv graph
# pipenv run flake8

Release files for libpythonpro-r 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for libpythonpro-r 0.4
File Size Uploaded
libpythonpro-r-0.4.tar.gz 44.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for libpythonpro-r 0.4
File Interpreter ABI Platform
libpythonpro_r-0.4-py3-none-any.whl Python 3 none any Details

Total release size: 76.8 kB

Release files / libpythonpro-r-0.4.tar.gz

Download URL libpythonpro-r-0.4.tar.gz
Size 44.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1508421717a4b382624356c372d6e899e71c6f27a8529a1055c176d277a155dc
BLAKE2b-256 checksum
How to use checksums
c35d2328705cd2bffe96f3ef822c77fb664df2c914dd18096592955b225eeae5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

Release files / libpythonpro_r-0.4-py3-none-any.whl

Download URL libpythonpro_r-0.4-py3-none-any.whl
Size 32.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
33ee9eed4ccc0e8df1f6fa727ecdb9667b4498d86cc15ae8d351f0ed19052f4c
BLAKE2b-256 checksum
How to use checksums
4a82772939d0393d2980035c644f89d506a906a998dc91a91bca641a2c954fc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.4 This release

2 release files

0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page