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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libpythonpro-r-0.4.tar.gz (44.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libpythonpro_r-0.4-py3-none-any.whl (32.6 kB view details)

Uploaded Python 3

File details

Details for the file libpythonpro-r-0.4.tar.gz.

File metadata

  • Download URL: libpythonpro-r-0.4.tar.gz
  • Upload date:
  • Size: 44.2 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for libpythonpro-r-0.4.tar.gz
Algorithm Hash digest
SHA256 1508421717a4b382624356c372d6e899e71c6f27a8529a1055c176d277a155dc
MD5 e18fbebf23a199c789d68ab652d54a13
BLAKE2b-256 c35d2328705cd2bffe96f3ef822c77fb664df2c914dd18096592955b225eeae5

See more details on using hashes here.

File details

Details for the file libpythonpro_r-0.4-py3-none-any.whl.

File metadata

  • Download URL: libpythonpro_r-0.4-py3-none-any.whl
  • Upload date:
  • Size: 32.6 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for libpythonpro_r-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 33ee9eed4ccc0e8df1f6fa727ecdb9667b4498d86cc15ae8d351f0ed19052f4c
MD5 e2cd8998109513154142d6f59f28d3a7
BLAKE2b-256 4a82772939d0393d2980035c644f89d506a906a998dc91a91bca641a2c954fc5

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.4 This release

2 files

0.3

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page