Skip to content
Snippets Groups Projects
README.rst 2.27 KiB
Newer Older
Tamas Gal's avatar
Tamas Gal committed
A Python Project Template
=========================
Tamas Gal's avatar
Tamas Gal committed

Tamas Gal's avatar
Tamas Gal committed
Fork this project and adjust the following files to your needs to get started
with a new Python project:

- ``requirements.txt`` - a list of Python packages needed for your software
- ``setup.py`` - this includes meta data for your package and is required
Tamas Gal's avatar
Tamas Gal committed
  for the ``pip install`` procedure. The most important things to change
  are listed at the top of the file.
- ``doc/conf.py`` - the documentation is configured in this file. Make sure
  to update the descriptions, title, ``import`` statements and so on.
  Add ``*.rst`` files inside the ``doc`` folder and include them in
  ``index.rst``. If you need more information, check out the Sphinx
  documentation.
Tamas Gal's avatar
Tamas Gal committed
- ``.gitlab-ci.yml`` - this file describes the stages and jobs you want to
Tamas Gal's avatar
Tamas Gal committed
  run on the KM3NeT continuous integration servers
Tamas Gal's avatar
Tamas Gal committed
- ``.coveragerc`` - contains a list of files to include or skip. Make sure
Tamas Gal's avatar
Tamas Gal committed
  to update the package name to match yours and exclude files which should
  not be tracked
Tamas Gal's avatar
Tamas Gal committed

Tamas Gal's avatar
Tamas Gal committed
Please note that the GitLab CI is using KM3NeT services (the GitLab runners and
Tamas Gal's avatar
Tamas Gal committed
the KM3NeT Docker registry), so make sure you update the settings to match
your environment.

Tamas Gal's avatar
Tamas Gal committed
Don't write me a mail, please create an issue
(https://git.km3net.de/examples/python_project/issues) if you have any
Tamas Gal's avatar
Tamas Gal committed
questions, feedback or feature requests. Merge requests are welcome!
Tamas Gal's avatar
Tamas Gal committed

**Tamás Gál**
Tamas Gal's avatar
Tamas Gal committed

Tamas Gal's avatar
Tamas Gal committed
Features of this Template
Tamas Gal's avatar
Tamas Gal committed
-------------------------
Tamas Gal's avatar
Tamas Gal committed

- Package installation using ``pip install .`` (also via ``make install``)
- Test Suite infrastructure included
    - ``make test`` will run all tests
    - ``make test-loop`` will run the tests and watch files for changes to rerun
      them continuously
Tamas Gal's avatar
Tamas Gal committed
- Documentation infrastructure which includes automatic generation of HTML
  pages, publishing using **GitLab pages**  
  and the generation of a fully browsable coverage report under the following
  links:
Tamas Gal's avatar
Tamas Gal committed
    - Docs: https://examples.pages.km3net.de/python_project
    - Code coverage: https://examples.pages.km3net.de/python_project/coverage/
Tamas Gal's avatar
Tamas Gal committed
- Continuous Integration on the KM3NeT GitLab server
Tamas Gal's avatar
Tamas Gal committed

Tamas Gal's avatar
Tamas Gal committed
Installing the Python Package
-----------------------------

This Python package works out of the box. Explore it with with the following
commands.
Tamas Gal's avatar
Tamas Gal committed

Install it with::

    make install

Run the tests with::

    make test
Tamas Gal's avatar
Tamas Gal committed