Software Catalog Structure specification
Standardization can better control program structure, improve the readability of programs
How directory is organized
Foo/|-- bin/| |-- foo||-- conf/|
|-- db/ ||-- docs/| |-- conf.py| |-- abc.rst||-- setup.py|-- requirements.txt|-- README
Briefly explain:
bin/
: Store some executable files and scripts of the project, of course you can name and script/
so on.
conf/
: Store some configuration files.
- db/: Store some data.
docs/
: Store some documents and logs.
setup.py
: Install, deploy, and package the scripts.
requirements.txt
: A list of external Python packages that store software dependencies.
README
: Project description file.
About the content of the Readme
It needs to illustrate several things:
- Software positioning, the basic functions of the software.
- How to run your code: Installation environment, startup commands, and so on.
- Brief instructions for use.
- Code directory structure Description, more detailed can explain the basic principles of the software.
- FAQ's description.
About Requirements.txt and setup.pysetup.py
In general, use it setup.py
to manage the packaging, installation, and deployment of your code. The industry standard notation is to use Python's popular packaging tools Setuptools to manage these things. This approach is commonly used in open source projects. But the core idea here is not to use standardized tools to solve these problems, but to say that a project must have an installation deployment tool that can quickly and easily install the environment on a new machine, deploy the code, and run the program.
setup.py
These things can be automated to improve efficiency and reduce the probability of errors. "Complex things are automated and things that can be automated must be automated. "is a very good habit.
Requirements.txt
The purpose of this file exists is to:
- Easy for developers to maintain software package dependencies. Add the new packages in the development process to this list to avoid
setup.py
missing packages when installing dependencies.
- Make it easy for readers to identify which Python packages the project uses.
The format of this file is that each line contains a description of the package dependencies, usually flask>=0.10
this format, the requirement is that the format can be pip
recognized, so that you can simply pass pip install -r requirements.txt
all the Python package dependencies are installed.
Software Development Specifications