Cloneable referential to initialize a Python project based on this template with the best practice. This is a pre-configured and read-to-used project to create deployable python libraries or application much more easily.
Table of Contents
- Description: contents the project description.
- Features: contents the descriptions of each features implemented and available on this software.
- Installation: contents the process of the installation for two plateforms.
- For Linux: here is the process of installation of this software on linux.
- OS dependences: Installation of your Linux OS dependences.
- Ubuntu: Choose this, if your OS is Ubuntu.
- Debian or Kali: Otherwise, choose this, if your OS is Debian or Kali.
- Project dependences: To install the dependences for this project.
- OS dependences: Installation of your Linux OS dependences.
- For Windows: here is the process of installation of this software on Windows.
- For Linux: here is the process of installation of this software on linux.
- Usage: all details of the use cases usefull to get starting this software.
- Tests: all details to run unittest.
- To contribute: usefull information for the person who want to contribute to this project.
- Licence: description of the license of this software.
- Contact: developers contacts.
My Python project is a simple application that allows users to create, read, update and delete the tasks. It is designed to be easy to use and expand.
- Add tasks.
- Mark tasks as complete.
- Delete tasks.
- Show all the tasks.
To install the project, make sure you have Python 3.8 or later version
and pip installed on your machine. And then run the following command lines.
git clone https://github.com/mokira3d48/PyOrigin my_project;
cd my_project;
sudo rm -r .git;
git init; # To create a new instance of git repositoryOpen your terminal and run following command lines to add the deadsnakes PPA to your system:
sudo apt update;
sudo apt install software-properties-common -y;
sudo add-apt-repository ppa:deadsnakes/ppa -y
Refresh your package list to include the deadsnakes PPA and then install Python 3.10:
sudo apt update;
sudo apt install python3.10;
python3.10 --versionNOTE: Do not change the default Python version of Ubuntu, as it may break system tools that depend on it.
In first, install the following dependences on your computer.
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-devAnd then, we can run the following command to install pyenv
directly via APT on your computer.
sudo apt install pyenvOr run the following command lines, to clone and install
pyenv from its souce code.
git clone https://github.com/pyenv/pyenv.git ~/.pyenv;
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc;
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc;
echo 'eval "$(pyenv init --path)"' >> ~/.bashrc;
echo 'eval "$(pyenv init -)"' >> ~/.bashrc;
source ~/.bashrc;Now, runing the following command line, we can use pyenv
to install the version of Python what we want to install.
pyenv install 3.10.18; # Here, we install Python 3.10.18.
sudo ln -s $HOME/.pyenv/versions/3.10.18/bin/python3 /usr/local/bin/python3.10sudo apt install cmake python3-venvInstall Cmake and Virtual env;python3 -m venv .venvcreate a virtual env into directory namedenv;source .venv/bin/activateactivate the virtual environment named.venv;make installinstall the requirements of this package;make dev_installorpip install -e .install the package in dev mode in virtual environment;- Run
make testorpytestto execute the unit test scripts located attestsdirectory.
git clone https://github.com/mokira3d48/PyOrigin my_projectcd my_projectAnd then, delete the hidden directory named .git located at the root
of the directory project.
And then,
- Install python for windows;
- Open your command prompt;
- Run
python -m venv .venvto create a virtual env into directory named.venv; - Run
.venv\Scripts\activateto activate the virtual environment; - Run
pip install -r requirements.txtto install the requirements of this package or project; - Run
pip install -e .install the package in dev mode in virtual environment; pytestrun the unit test scripts located attestsdirectory.
Here is an example how to add a new task:
from package_name.utils import get_file_paths_list
def main():
"""Main function
"""
file_paths = get_file_paths_list('./')
file_paths = sorted(file_paths)
print("List of file paths:", file_paths)
if __name__ == '__main__':
main()To execute the unittest, make sure you have pytest package installed,
and then run the following command line:
make test or
pytestContributions are welcome! Please follow these steps:
- Create a new branch for your feature (
git checkout -b feature/my-feature); - Commit your changes (
git commit -m 'Adding a new feature'); - Push toward the branch (
git push origin feature/my-feature); - Create a new Pull Request or Merge Request.
This project is licensed under the MIT License. See the file LICENSE for more details, contact me please.
For your question or suggestion, contact me please:
- Name : Your name (Doctor Mokira)
- Email : Your email address (dr.mokira@gmail.com)
- GitHub : Your GitHub or Gitlab profile