This is a simple Python project with a Makefile to automate common tasks such as setting up a virtual environment, installing dependencies, running tests, and cleaning up.
python_project/
├── Makefile
├── README.md
├── requirements.txt
├── main.py
└── tests/
└── test_main.py
- Python 3.6 or higher
make
tool
-
Clone the repository:
git clone https://github.com/Raguggg/Makefile.git cd Makefile
-
Run the default Makefile target to set up the environment and run tests:
make
This command will:
- Create a virtual environment in the
venv
directory - Install dependencies from
requirements.txt
- Run the unit tests in the
tests
directory
-
all: Default target that sets up the environment and runs tests.
make
-
venv: Creates a virtual environment.
make venv
-
install: Installs dependencies from
requirements.txt
.make install
-
test: Runs unit tests using
unittest
.make test
-
clean: Removes the virtual environment directory.
make clean
To clean up the project, removing the virtual environment directory, run:
make clean
A simple Python script that contains a function hello_world() which returns "Hello, world!".
A unit test for main.py that tests the hello_world() function.
Feel free to submit issues and pull requests. For major changes, please open an issue first to discuss what you would like to change