diff --git a/_sidebar.md b/_sidebar.md index 3200247..c4426f0 100644 --- a/_sidebar.md +++ b/_sidebar.md @@ -1,6 +1,8 @@ * [Home](/) * [Getting Starter](pages/getting-starter.md) * [Known the structure](pages/structure.md) + + + +* Requirement + * git + * python + * pip + * [venv](pages/requirement/venv.md) diff --git a/pages/getting-starter.md b/pages/getting-starter.md index 21c4544..702e39d 100644 --- a/pages/getting-starter.md +++ b/pages/getting-starter.md @@ -2,7 +2,7 @@ ## Requirement -You need a `git`, `python`, `pip`, and `venv` before using CostaPy. +You need a `git`, `python`, `pip`, and [venv](pages/requirement/venv.md) before using CostaPy. Install them using the following commands on your `Debian` or `Ubuntu` system. @@ -44,18 +44,3 @@ Use this command below to start the web service and it will run on port `11000` ``` Here, `costapy-welcome` is the label of your service. You can replace it with any name you prefer. -## Trivia - -- Why must `venv`? - - `venv` is a module in Python that provides support for creating lightweight, isolated Python environments, known as virtual environments. Each virtual environment has its own installation directories and can have its own versions of Python packages, independent of the system-wide Python environment. - - When deploying a Python application, using a virtual environment ensures that only the required packages (and their specific versions) are bundled. This reduces the risk of deploying unnecessary packages or incompatible versions that could lead to runtime errors. - - Using `venv` is a widely accepted best practice in the Python community. It encourages good habits in dependency management, ensuring that projects are self-contained and reducing the potential for "dependency hell." - - When a project is no longer needed, deleting its virtual environment is straightforward and does not affect other projects or the system's Python environment. - -- Why I add `venv` on my `gitignore`? - - Committing `venv` to Git is gross. Virtual environments can contain thousands of files and their size can be in gigabytes. Committing them to Git can overload and clutter your source code repo with unnecessary files and cause confusion for anyone trying to clone and run the source code on their machine. diff --git a/pages/requirement/venv.md b/pages/requirement/venv.md new file mode 100644 index 0000000..dfd8a36 --- /dev/null +++ b/pages/requirement/venv.md @@ -0,0 +1,15 @@ +# venv + +- Why must `venv`? + + `venv` is a module in Python that provides support for creating lightweight, isolated Python environments, known as virtual environments. Each virtual environment has its own installation directories and can have its own versions of Python packages, independent of the system-wide Python environment. + + When deploying a Python application, using a virtual environment ensures that only the required packages (and their specific versions) are bundled. This reduces the risk of deploying unnecessary packages or incompatible versions that could lead to runtime errors. + + Using `venv` is a widely accepted best practice in the Python community. It encourages good habits in dependency management, ensuring that projects are self-contained and reducing the potential for "dependency hell." + + When a project is no longer needed, deleting its virtual environment is straightforward and does not affect other projects or the system's Python environment. + +- Why I add `venv` on my `gitignore`? + + Committing `venv` to Git is gross. Virtual environments can contain thousands of files and their size can be in gigabytes. Committing them to Git can overload and clutter your source code repo with unnecessary files and cause confusion for anyone trying to clone and run the source code on their machine.