...
Markdown |
---|
```console project_name ├── LICENSE ├── project_name │ ├── __init__.py │ └── project_name.py ├── README.md ├── requirements.txt ├── pyproject.toml ├── setup.cfg ├── setup.py └── tests ``` A good practices for creating new package directory structure: - All names should be lowercase - Names should be underscore-separeted (no hyphens) - The project name should be as unique as possible - The root directory should mainly store metadata files - Source files should be stored in a subdirectory with the same name as the project directory - Always pay attention to the inclusion of the LICENSE file ### Package directory contents #### LICENSE file ```console ├── LICENSE ``` - It’s important for every package to include a license. This tells users who install package the terms under which they can use it. #### README.md file ```console ├── README.md ``` - It can be customised in a way that best describes the project. - Normally, the package configuration loads README.md to provide a __long_description__, README.md must be included along with code when generating a source distribution. #### requirements.txt file ```console ├── requirements.txt ``` - Allows to store dependency versions for a project that are considered concrete and essential. - All necessary dependencies can be collected into requirements.txt with PIP like below: ```console $ python -m pip freeze > requirements.txt```txt ``` #### pyproject.toml file ```console ├── pyproject.toml ``` - A build-system independent way to specify project dependencies. It is a way to step away from distutils / setuptools. - Tells build tools (like pip and build) what is required to build project. ```toml [build-system] requires = [ "setuptools>=42", "wheel" ] build-backend = "setuptools.build_meta" ``` |
...