Lets build an inventory
- We will have product(S)
- We will have quantities
- We will be selling and procuring
-
Refer Here for some experiments done with inventory
-
Topics covered
- dataclass
- package: A python package is a folder with
__init__.py in it. Package name will be folder name. A package can have subpackages
- PYPI:
Building a python project
Approach 1:
- create a new folder
- Create a virtual environment
python -m venv .venv
- Activate the virtual environment
# windows
.venv/Scripts/activate
# mac or linux
source .venv/bin/activate
pip install boto3
pip freeze > requirements.txt
- To install from requirements.txt
pip install -r requirements.txt
Aproach 2
#windows
winget install --id=astral-sh.uv -e
# mac
brew install uv
# linux
wget -qO- https://astral.sh/uv/install.sh | sh
- create a new directory
warehouse and cd into it
- To build a simple application
uv init .
uv init --package .
- Run
uv sync and then activate virtual environment
- Adding packages can be done
uv pip install .....
uv add .....
-
Refer Here for the warehouse first set changes
-
we need to test the code which we have written so far, so lets add a popular unit testing framework in python
pytest
uv add --dev pytest
Like this:
Like Loading...