I'm following this AWS CDK python getting started tutorial to learn how to use AWS CDK with python.
I'm curious about the meaning of -e . in requirements.txt file, which is generated by AWS CDK. What does it mean?
The document from pip install --help says -e, --editable <path/url> Install a project in editable mode (i.e. setuptools "develop mode") from a local project path or a VCS url..
I don't think the -e in requirements.txt means --editable. It must represents something different.
I cannot find any explanations about -e . in requirements.txt in https://pip.pypa.io/en/stable/user_guide/#requirements-files.
What does -e . mean in requirements.txt file?
Python applications generally have a requirements.txt file and a setup.py file.
requirements.txt is a plain text file that lists down the python package requirements.
setup.py is a python script that uses setuptools to define a package. setup.py also contains the list of dependencies to be installed along with all the other metadata about the package.
If you define your dependencies in both places this is a redundancy. -e . is the way you can overcome this problem. You can just define your dependencies in setup.py alone and create requirements.txt file with just -e . in it.
You can now use pip install -r requirements.txt without defining all the dependencies again in the requirements file. All the packages in setup.py are automatically installed, setup.py becomes your single source of truth for what dependencies are to be installed.
This document says
requirements.txt—This file is used by pip to install all of the dependencies for your application. In this case, it contains only -e . This tells pip to install the requirements specified in setup.py. It also tells pip to run
So it tells pip to install the requirements specified in setup.py.