Skip to content

Template for reproducible python applications in science

License

Notifications You must be signed in to change notification settings

ucyo/python-package-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Template for Python

This a template for developing Python application and libraries in an enclosed and safe environment. We are using Docker to provide a reproducible environment which can be used for active development, python packaging for releases and CI/CD workflows.

Usage

Copy the example environmental file .env.example to .env and (if necessary) add environmental variables.

$ > cp .env.example .env

Start and bash into development container.

$ > make bash

Now your environment is setup. All changes to the codebase are reflected in the container, since they are mounted.

Getting Started

Name your project

The first thing you want to do is give your project a proper name.

  1. Rename the project in pyproject.toml and update the description.

  2. Rename the app/src/app to your project name.

    $ > mv app/src/app app/src/<projectname>

Add dependencies

Add your dependencies to the project.

  1. Enter the development container.

    $ > make bash
  2. Use rye to add the dependencies. You can find an introduction to rye here.

    $ > rye add <dependent package>  # like flask, numpy or pandas
  3. Install the dependencies.

    $ > rye sync

The next time you build the container your dependencies have been installed.

Update the README

A fresh start. Just move the blank README.md over here and start with your project.

$ > mv app/README.md .

Explore

This template is just the barebone to get a Python Open Source Software (OSS) project up and running. Don't forget change the license, add a CHANGE.md and a CODE_OF_CONDUCT.md. But that is up to your 😄