Git Product home page Git Product logo

pythonprojecttemplate's Introduction

Python Project Template

Boiler plates for the creation of Python Project Template.

How-to Use The Template

  • Install Python 3
  • Install Cookiecutter pip install cookiecutter
  • Create a blank repository (no readme etc) on Github
  • Run cookiecutter https://github.com/marmstr93ng/PythonProjectTemplate.git filling in the prompted information
  • Connect the local directory to the git repository
    • Inside the local folder run a git bash window
    • Run git init
    • git remote add origin https://(the cloning URL).git
    • Add all file git add .
    • Commit all files with an appropriate comment git commit -m "feat: added modified boiler plate files"
    • git push origin master

Reference

Virtual Environments (VENV)

An inbuilt Python tool that creates an isolated python environment, keeping project dependencies independent from each other.

  1. python -m venv .venv
  2. .\\.venv\\Scripts\\activate or .\\.venv\\Scripts\\deactivate

Requirements.txt

[DEPRICATED FOR PYPROJECT.TOML] A file which contains all the python packages used in the project

  • pip freeze > requirements.txt - Capture the python requirements
  • pip install -r requirements.txt - Install all python packages specified in requirements file

How to include a Github repo in the requirements file

Commit Message Format

Format

<type>: <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
  • The header line is mandatory, while the rest of the message is advisory.
  • Any line of the commit message cannot be longer 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.
  • use the imperative, present tense: "change" not "changed" nor "changes"

<Type>

  • feat: a new user feature (inclusion in a release bumps a MINOR version)
  • fix: a user bug fixed (inclusion in a release bumps a PATCH version)
  • docs: changes to documentation
  • style: formatting changes, missing semicolons, etc
  • refactor: code change that neither fixes a bug nor adds a feature
  • perf: code change that improves performance (inclusion in a release bumps a PATCH version)
  • test: adding missing or correcting existing tests
  • chore: changes to the build process or auxiliary tools and libraries such as documentation generation

<Subject>

A succinct description of the change.

  • don't capitalize first letter
  • no dot (.) at the end

<Body>

The body should include the motivation for the change and contrast this with previous behaviour

<Footer>

The footer should contain any information about breaking changes and is also the place to reference issue numbers from your issue tracker

  • Closed bugs should be listed, comma separated, on a separate line at the end of the footer prefixed with "Closes" keyword like this: Closes #123, #245

[1], [2]

Setup SSH

Run all the commands in Git Bash

Generate SSH Key

ssh-keygen -t rsa -b 4096 -C "[email protected]"

  • On "Enter a file in which to save the key," press Enter. This accepts the default file location.
  • At the prompt, type a secure passphrase.

Add SSH Key to SSH-Agent

  • SSH-Agent is an SSH key manager that stores the SSH key in a process memory so that users can log into SSH servers without having to type the key’s passphrase every time they authenticate with the server
  • Ensure ssh-agent is enabled: eval "$(ssh-agent -s)"
  • Add your SSH key to the ssh-agent: ssh-add ~/.ssh/id_rsa

Add SSH key to Github Account

  • Copy the SSH key to your clipboard. clip < ~/.ssh/id_rsa.pub
  • In the top right corner of any page, click your profile photo, then click Settings
  • In the user settings sidebar, click SSH keys.
  • Click New SSH key.
  • Name and add Key

Test SSH Connection

ssh -T [email protected]

  • Check if the hash that is shown matches one of the hashes shown in Github SSH Key Fingerprints
  • If the following error occurs The authenticity of host 'github.com (140.82.121.3)' can't be established. run ssh-keyscan github.com >> ~/.ssh/known_hosts which will add authenticity to your known_hosts.

pythonprojecttemplate's People

Watchers

Matthew Armstrong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.