This is a project scaffold for my future Python project. It tests across python 3.10 & 3.11 & 3.12
This repo contains my work for the Create Python Gitlab Template assignment of IDS 706. If you want to use this, simply refer to this in a GitHub codespace and wait for the .devcontainer
to execute the Makefile
, which handles the following: install, format, lint, and test.
According to the project requirements, the following files are included:
-
Makefile
-
Dockerfile
-
requirements.txt
with a set of specifications -
githubactions
-
.devcontainer
for GitHub Codespace
The purpose of this project is to create a Python template that includes a main.py
file containing a simple add(a, b)
function, which returns the sum of two numbers. This function is located in the main part of the file. I test the function using the test_main.py
file, which verifies the correct behavior of the add(a, b)
function.
I plan to use this template as the foundation for future projects. I will modify and expand upon it as needed to suit the requirements of upcoming assignments or personal projects. This template provides a solid base for Python development with integrated tools for testing, formatting, and containerization, making it flexible for further development.
To set up this project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/your-repo-name.git
-
Navigate to the project directory:
cd your-repo-name
-
Build the Docker container (if you are using Docker):
docker build -t your-container-name .
-
Install the required packages using the
Makefile
:make install
This command will install all the necessary dependencies listed in
requirements.txt
.
To use this project:
-
Run the
main.py
file to test theadd(a, b)
function:python main.py
-
Run the tests using:
pytest
-
Lint the code:
make lint
-
Format the code:
make format
By following these instructions, you will be able to set up and run the project smoothly.