diff --git a/03_building_and_packaging/pip_demo.md b/03_building_and_packaging/pip_demo.md index 5bb335e0..929194b9 100644 --- a/03_building_and_packaging/pip_demo.md +++ b/03_building_and_packaging/pip_demo.md @@ -1,6 +1,6 @@ # `pip`: Python Packaging Tool Demo Notes -**Note**: Maybe run everything in a fresh Ubuntu Docker container. Launch such a container using `docker run --rm -it ubuntu:jammy`. The other option is to work in a Python virtual environment. An environment can be created as follows +**Note**: It is recommended run everything in a Ubuntu Docker container or a virtual environment. Launch a container using `docker run --rm -it ubuntu:jammy`. A virtual environment can be created as follows ```bash python -m venv env-name @@ -9,7 +9,7 @@ source env-name/bin/activate ## 0. Getting `pip` -If Python has been installed using a system package manager like `apt`, it will not come with `pip`. `pip`can be installed in several ways +A clean Docker container may not have Python installed. Install Python using `apt`: `apt install python3`. If Python has been installed using a package manager like `apt`, it will not come with `pip`. `pip`can be installed in several ways ```bash python -m ensurepip --upgrade @@ -18,7 +18,7 @@ python -m ensurepip --upgrade or ```bash -apt install pip +apt install python3-pip ``` - If installed with Python, the Python version is used to determine which `pip` is installed. So Python 3.8 will install a `pip` by the name of `pip3.8` which will be compatible with Python 3.8. @@ -27,7 +27,7 @@ apt install pip ## 1. Installing packages with `pip` -Let us install the finite element library [Nutils](https://nutils.org/) +Let us install the finite element library [Nutils](https://nutils.org/). ```bash pip install nutils @@ -36,7 +36,7 @@ pip install nutils Install a specific version of a package ```bash -pip install nutils==6.0.0 +pip install nutils==7.0.0 ``` Uninstalling a package @@ -56,9 +56,6 @@ cd nutils pip install --user . ``` -- A `build` folder is created and the package files are copied into it. -- But now `pip uninstall package-name` does not work as `pip` looks in the home path. Removal of package can be done by deleting the `build` folder or using manually using `setup.py`. - ## 2. Getting information of currently installed packages ```bash diff --git a/03_building_and_packaging/pypi_exercise.md b/03_building_and_packaging/pypi_exercise.md index 6303d935..c9d71475 100644 --- a/03_building_and_packaging/pypi_exercise.md +++ b/03_building_and_packaging/pypi_exercise.md @@ -24,7 +24,7 @@ In this exercise you will convert a raw Python code into a packaged code which i ## Step 1 - Acquiring the raw code and getting familiar with it -- Fork the [exercise repository](https://github.com/Simulation-Software-Engineering/diffusion2d). +- Fork the [exercise repository](https://github.com/Simulation-Software-Engineering/diffusion2D). - Open the file `diffusion2d.py` and go through the file and try to understand the code components. - Check if your system has Python version >= 3.6 and update it if it is older than 3.6. - Install pip, build, and Twine. diff --git a/03_building_and_packaging/pypi_slides.md b/03_building_and_packaging/pypi_slides.md index 271c6672..d952d380 100644 --- a/03_building_and_packaging/pypi_slides.md +++ b/03_building_and_packaging/pypi_slides.md @@ -361,7 +361,7 @@ setup( ## Additional options in setup.py 3/3 -The option `entry_points` provide metadata which are exposed after installation. For example: executable functions from a terminal. +The option `entry_points` exposes code for direct use. For example: executable functions from a terminal. ```python from setuptools import setup