This is a template repository for Python designed to work out of the box for developing software projects. This repository provides the fundamental building blocks needed to design and develop projects including:
- Build Management
- Unit Testing
- Continuous Integration
- Static Analysis
- Code Formatting
- Component Specification
A template for issue and pull requests is also provided for collaborative development.
- Clone project repository to your local machine
- Initialize repository using
pdm install - Update dependencies using
pdm update - Activate virtual environment using
pdm venv activate - Run the project using
pdm run start
View available scripts using pdm run --list
start- Start the projecttest- Run testslint- Run static analysisformat- Format codeformat-test- Dry run for code formatting
For the purposes of this project, and scope of this template, we are defining a component to be any group or individual module which performs a standalone functionality, utility, or otherwise.
In structuring these components, we use the __main__.py file as the entry point into this application. Other utilities ("components") may be imported, but are not intended to be accessed by users. These are marked as such with a single underscore in front of the file name (e.g. _accessory.py)
We have included two examples of components which are imported into the __main__.py file: one is "Hello World" which is not intended to be accessed by users, and the second is a component which finds the length of a string, which is meant to be accessed by users.
The "Hello World" component is a basic module which provides a function to print the greeting message "Hello World!"
The "String Length" component is designed to calculate the length of a given string.
We have imported both modules into the __main__.py file, to showcase how components can be imported into different files within a Python project. As seen from the code structure below (which only includes files relevant to the components) our import strategy assumes that all components will be within the src/sylveon directory.
src/sylveon/
|-- __init__.py
|-- __main__.py
|-- _hello/
| |-- __init__.py
| |-- _greeting.py
|-- string_length/
| |-- __init__.py
| |-- find_length.py
- Programming Language:
Python✅ - Toolchain/Runtime Environment:
Python>= 3.12 ✅ - Testing Framework:
pytest✅ - Continuous Integration Solution:
CircleGI✅ - Static Analysis Tool:
mypy✅ - Code Formatting Solution:
black✅ - Package Manager:
pip/PDM✅ - Python Dependency Management ✅
- Component Specification: ✅
- Issue and Pull Request Templates ✅
- Susmitha Kusuma
- Berry Liu
- Margaret Jagger
- Calvin Tian
- Kevin Zheng