A repository for python template
The structure template of general project which can provide some userfull files and quickly build,
- Make copy of the project, the rename it as your new project, for example "project1".
- Rename the "monster" dir to the name of yor project or others as your root moudle.
- Now, edit your setup.py to what your want to modifing or adding more infomations for your project. and then run "python setup.py check" to check if the setup.py works well.
- Rename the tests/project_tests.py to your root module again, for example "project1_tests.py"
- Then you should check if you have make it right , so you will use "nosetests" at the root dir; if it ouput as "Ran 1 test in xxx.s ok", so it's all right,others you should fix it again.
- Okay, you can start coding for new project now.
- setuptools
- virtualenv or conda or python3 venv
- nose
- pytest
- pandoc
- sphinx
- and so on
- If you modify the setup.py file, you can visit the website" http://docs.python.org/distutils/setupscript.html".
- The general template is the The most simplified, so you can adding more rules as you can do.
- Before you install the project, you should install some python packages, as "pip","distribute","nose","virtualenv". pip: install the python packages from PyPI, virtualenv or venv is used to isolate application specific dependencies from a shared Python installation, and nose can be as unit test tools, in fact, the distribute as the standard of Python disutils extension, but it can be replaced by "setuptools".
- SomeHow, those tools will not usefull in future, the web site "https://packaging.python.org/current/" can be most useful.
Python Packaging User Guide: https://packaging.python.org/
Distributing Python Modules: https://docs.python.org/3/distributing/index.html
Packaging and Distributing Projects: https://packaging.python.org/distributing/
Python Packaging Authority: https://www.pypa.io/en/latest/
Tool Recommendations: https://packaging.python.org/current/
SetupTools:http://setuptools.readthedocs.io/en/latest/
Cookiecutter:
https://www.pydanny.com/cookie-project-templates-made-easy.html
https://cookiecutter-pypackage.readthedocs.io/en/latest/
- python interpreter
- virtualenv/venv:build virtual environment
- project structure and the command: pip freeze > requirements.txt
- pyint: check the python code style and others
- pytest/nose/pytest-cov: pytest testing tools
- Sphinx: documents generator from source codes, which use reStructuredText as comment statement
- ReadTheDocs: continue to document integration
- Tox: testing standardization, edit the tox.ini as it's configuration
- git、github、git-flow version control and project management flow
- TravisCI: continuous testing integration, edit the .travis.yml as it's configurations
- Cookiecutter: automate these steps when starting your next project, in fact, the tool can be do many things as you done before