Giter Site home page Giter Site logo

python-project-template's Introduction

Python project template

A somewhat complete Python project template with packaging and testing support.

Usage

Fork this project and create your Python code under the src directory. Run grep package_name to know where to update the name of your package. Projects with a single package should probably be named the same as the package.

Go through setup.cfg and see if you'd wish to update something there.

Freeze the dependencies on dev_dependencies.txt.

Versioning

This template always generates version 0.1.0 for the Python project. Make sure to change tox.ini to output the correct version during tests.

Packaging with setuptools

Packaging is done with setuptools using pyproject.toml in and setup.cfg. Transitioning to a project fully on pyproject.toml would require eitheri switching to Poetry or wait for setuptools to addapt.

Testing

With Pytest, MyPy, Tox, coverage and generation of HTML reports. Coverage is currently buggy but I have spent too much time in this for the moment. To run the tests simply run:

tox

Configuration

It is hard to keep all configuration in one file when the Python packaging standards are changing so quickly. To keep compatible back to at least Python 3.6, some compromises need to be made. Most of the configuration is done in setup.cfg and only what is absolutely necessary is done in other files.

Installation

Running pip install . will install the project from source, and pip install -e . does not work for the moment. This installs project-name and a package called package_name.

CI

Still deciding whether to split the CI into separate repositories. Currently the

python-project-template's People

Watchers

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