Any fool can write code that a computer can understand. Good programmers write code that humans can understand. โ Martin Fowler
python is a template project, designed by Templ Project.
python includes instructions for initializing a new Pyhon project, and configuring it for development, unit testing as well as code linting and analysis.
python implements:
- Please install git-scm tool.
- Please install a form of make
- Install Make for Windows
- Install make from ezwinports
- Install chocolatey, run
choco install make
- Please install
git
andmake
# i.e debian
sudo apt-get install git make -y
# i.e mac OS
brew install make git
- Running Travis CI with Windows fails on
coverage
. Seems Travis CI Windows image has an issue with this. - Python support starts with version 3.6 and above.
- Clone the project
- Remove .git folder
- Re-initialize your git repository
- Use
make init
to initialize your project - If you're targeting to write an application and not a module, use
make init MOD=app
- Run
make configure
to configure project or - Run
make venv
to create a virtual environment (make venv
is included inmake configure
) - Run
make
to see all your pre-implemented options
git clone https://github.com/templ-project/python your_project
cd your_project
rm -rf .git
git init
git add remote origin https://url/to/your/project/repository
git add .
git commit -am "init"
git push origin master
make init PROJECT=your_project MODE=mod
# make init PROJECT=your_project MODE=app
make configure
# make venv
# make
Most Linux versions, come with python 2.7 as default. The rest of python versions that are installed, can be found having a name similar to python3.x
, i.e python3.5
.
To allow using a specific python version, create a file called Makefile.py-version.include
which should include the following:
PY = python3.8
PIP = pip3.8
or
PY = /path/to/my/version/of/python
PIP = /path/to/my/version/of/pip
When runing make venv
, the version used by the Makefile
will be the one defined in this file.
- Please install Python. Project support python 3.6 and above.
- Please instal a Python IDE
- Visual Studio Code with ITMCDev Python Extension Pack
- JetBrains PyCharm
- Vim (see here a tutorial for making Vim a Python IDE)
- Any other IDE you trust.
Run unit tests using make test
.
Testing is currently set to use unittest.
- or you could use
make test TEST_LIB=pytest
- or you could alter
Makefile.mod.include
to use pytest by default. Just change the commented line as showed:
# TEST_LIB=unittest
TEST_LIB=pytest
Run single unit tests file, by calling make test-single TEST_PATH=./path/to/file.py
make test-single TEST_PATH=./your-project/test/hello.py
Adapt release
directive in your Makefile to fit your needs.
make release
will know how to increment version and create tags on its own.
- Dragos Cirjan - Initial work
Add a set of links to the issues page/website, so people can know where to add issues/bugs or ask for support.
(If the package is public, add licence) This project is licensed under the MIT License - see the LICENSE.md file for details
Remove Everything above this line
One Paragraph of project description goes here
What things you need to install the software and how to install them (based on each OS type).
# Give Examples
npm install -g node-gyp windows-build-tools
# Warning: Please note windows-build-tools will install MSVS which takes a
# LONG amount of time.
# Give Examples
apt-get install build-essential mono
npm install -y node-gyp
Describe a list of known issues, and how to bypass them.
A step by step series of examples that tell you how to get a development env running
Give the example
until finished
End with an example of getting some data out of the system or using it for a little demo
Explain any development process for the project, if necesary
give examples
Explain how to run the automated tests for this system
Explain what these tests test and why
Give an example
Explain what these tests test and why
Give an example
Explain what these tests test and why
Give an example
Add additional notes about how to deploy this on a live system
- Dragos Cirjan - Initial work - PurpleBooth
See also the list of contributors who participated in this project.
Add a set of links to the issues page/website, so people can know where to add issues/bugs or ask for support.
(If the package is public, add licence) This project is licensed under the MIT License - see the LICENSE.md file for details
Small changelog history. The rest should be added to CHANGELOG.md.
See here a template for changelogs: https://keepachangelog.com/en/1.0.0/
Also see this tool for automatically generating them: https://www.npmjs.com/package/changelog