Skip to main content

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

Project description

pytoolsbrunojatoba

Module is one exemple for biulding projects in Python from the Backend DevPro Course In this course is taught how contributed in open source projects

Link of the course DevPro

This project has support for Python 3 version

Updates

Python 3

Checklist topics of the course and commands necessary for job:

  1. Git:

Local and remote branchs verification commands

git branch -all (check all branchs)
git remote -v (check all remotes branchs)

Steps for job local:

git fetch upstream (search for local branch updates of one remote repository)
git branch 1 (add a new local branch)
git checkout 1 (change from a main branch to branch 1) or
git checkout -b main upstream/main (make a new main branch from upstream main branch)
make one commit
git push upstream main (send the update to be accept in the GitHub forked repository of outher programmer)
git push origin main (send the code update only for your repositorio and after being submitted in upstream repository)
if accept make
git branch -D 1 (delete local branch 1)
git push --delete upstream 1(delete remote branch 1)
git push --delete origin 1(delete remote branch 1)

Final job:

git fetch upstream (search update in the repository)
git merge (download code update)

.gitignore file:

Hide what should not be made available

Pycharm files
.idea/
.classpath
.project
.settings/
bin/
*.sqlite3
:wq (exit)
git config --global core.excludesfile ~/.gitignore_global
  1. Pyenv:

Install differents Python versions in one PC

Installation:

bash <(curl -sSL https://raw.githubusercontent.com/zaemiel/ubuntu-pyenv-installer/master/ubuntu-pyenv-installer.sh) 

Edit the .bashrc file final in the vim:

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"

vim commands:

vim .bashrc (open)
i (edition)
:wq (clone and save)

Commands:

pyenv install -l (list everything that can be installed)
pyenv install 3.11.2 (Python 3.11.2 install)
pyenv versions (list all python versions avaliable for use)
pyenv global 3.11.2 (define global python the version 3.11.2)
which python (check which the global python path defined)
python -V (display how global python activated)
  1. VirtualEnv:

Works with another python separate from system python The aim is to create one virtual envieronmental for be install libs differents of the O.S Python

python3 -m venv .venv
source .venv/bin/activate
deativate
  1. Pip install, Requests and Flake8 libs, requirements.txt file:

First activate the virtualenv for use pip install

Requests (requirements.txt):

pip install requests

Flake8 (requirements-dev.txt):

Check errors in the code(various or without spaces)

pip install flake8
flake8

Requeriments:

Generate the file txt with libs to be made available in github repository

pip freeze > requirements.txt
pip freeze > requirements-dev.txt (flake8, delete requirements libs )

Install .venv libs of the requirements-dev.txt file

pip install -r requirements-dev.txt
  1. GitHub Actions I'm using in place of the Travis CI Create .github_actions.yml file in the .github/workflows folder
name: Python application

on: [pull_request]

jobs:
  build:
    env:
      PIPENV_NO_INHERIT: 1
      PIPENV_IGNORE_VIRTUALENVS: 1
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
      - name: Set up Python 3.11.2
        uses: actions/setup-python@v1
        with:
          python-version: 3.11.2

      - name: Install dependencies
        run: |
          pip install -q -r requirements-dev.txt
      - name: Lint with flake8.
        run: |
          pipenv run flake8 .
  1. Pypi: Setup.py file Create a new .venv out of the repository
pip install -e ./pytoolsbrunojatoba/

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

pytoolsbrunojatoba-0.1.tar.gz (41.9 kB view details)

Uploaded Source

File details

Details for the file pytoolsbrunojatoba-0.1.tar.gz.

File metadata

  • Download URL: pytoolsbrunojatoba-0.1.tar.gz
  • Upload date:
  • Size: 41.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for pytoolsbrunojatoba-0.1.tar.gz
Algorithm Hash digest
SHA256 ead02f162618a355c8a745a20be4b85f9aece0e5ba4530fc0167da676ea3c5cd
MD5 3f8b8fda600445ad1be8066efd056db5
BLAKE2b-256 8b05adb3bd6e507186cef9adc3f4331799ff302a7d36970d559b19e3fa441b0e

See more details on using hashes here.

Supported by

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