Skip to content

essembeh/python-helloworld

Repository files navigation

helloworld

This is just a sample helloworld project which aims to provide some good (at least not so bad) praticies to start a new project.

Basically, you can clone this repository and run sed -i 's/helloworld/YOURPROJECTNAME/g' ;)

Install

Install latest version from repository using pip

$ pip3 install --user git+https://github.com/essembeh/python-helloworld

Or setup a development environment

# Clone the source $ git clone https://github.com/essembeh/python-helloworld $ cd python-helloworld # Build the virtualenv $ make venv # Load the venv $ source venv/bin/activate # Install your app in the venv (venv) $ pip install -e . # equivalent (venv) $ make install

Coding and Testing

VSCodium is a good editor and the Python support is pretty nice. Some workspace settings in .vscode/settings.json are configured for example to work with the virtual environment.

Flake8 is configured with some plugins (in requirements-dev.txt) to report many warnings/errors (and VSCodium is configured to show them).

Black code formatter will automatically format source code on save using VSCodium.

Some usefull commands:

  • make venv to create or update the virtualenv in the folder named venv
  • make install, simple alias to pip install -e . to install your app in the virtualenv in development mode, ie: no need to reinstall when the code changes
  • pytest to run the tests
  • tox to run all the test with coverage and flake8 analysis (equivalent to make test)
  • make docker-test to run tox in a docker image containing all supported Python versions, see multipy
  • Finally the make publish (or make publish-test) to build and publish the project on PyPI.

About

Simple helloworld skeleton to help starting a new python project

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages