Skip to main content

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

Project description

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

Project details


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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page