Giter VIP home page Giter VIP logo

starter_python's Introduction

Python Startup Template Repository!

Build status badge MIT License badge Github repository size

Starting up new projects, especially command-line applications, can often be tedious. It's hard to remember all of the tools that are used to speed up development and how they're properly configured. This repository allows that step to be recycled by providing a starter CLI with everything needed out of the box, including testing automation through Github Actions.

Table of Contents

  1. License
  2. What to edit first
  3. Installation
  4. What are all these tools??
  5. Extra documentation

License

This repository is offered under an MIT license and is free to be used however one might prefer

What to edit first

You'll most likely want to name things differently. The most glaring example is how the term 'project' is used here as the name of the application. I have tried to minimize the number of places where it is used to make it easier to adapt this repository to different needs. You should edit the following, ensuring that all have the same new name:

  • The project directory, naming it as makes sense for your project
  • Inside the tests/cli_test.py file, edit the following line:
    • import project.main as main
  • Inside the setup.cfg file, edit the following lines:
    • addopts = --cov=project --cov-report term-missing
    • files = project/**/*.py
  • Inside the setup.py file:
    • name='project'
    • 'console_scripts': ['project = project.main:main']

Installation

To install, run the convenience script included with this repository or execute the following code below in your terminal. It is highly recommended that a virtual environment is used for this (and all) Python applications.

pip install -r requirements.txt -r test-requirements.txt -e .;
pre-commit install;
pre-commit run --all-files;
mypy;
pytest;

What are all these tools??

pre-commit is a tool used to run a series of checks before git commit is finished executing. This may seem cumbersome or annoying, but it'll often catch little mistakes that degrade code quality over time. Quite a few of the checks that it runs will also fix the problems that they are checking for.

flake8 is a linter. You can read some more about linters here. Also check out their repository and their documentation

mypy is a static type analyzer. Python is a dynamically typed language, and mypy doesn't seek to change that. However, they do hope to add some of the benefits of static typing, such as legibility. It's a fairly popular tool, and you can read some of its benefits here. If you're new to python type hints (they were introduced in Python 3.5), check out the docs

pytest is a popular python testing framework. It has good outputs and plenty of plugins, including a coverage report to see how much of your code is covered by tests.

Extra documentation

The following links might be helpful:

starter_python's People

Contributors

cryptaliagy avatar

Stargazers

Jürgen Hermann avatar

Watchers

James Cloos avatar  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.