Commit 86c58576 authored by Dom31's avatar Dom31
Browse files

README with badges

parent e2812739
Loading
Loading
Loading
Loading
Loading
+1 −22
Original line number Diff line number Diff line
The MIT License
===============

Copyright (c) 2019 Dom31

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
No licence !
+87 −92
Original line number Diff line number Diff line
**All issues and contributions should be done on
[Gitlab](https://gitlab.com/costrouc/python-package-template). Github
[Gitlab](https://gitlab.com/Dom31/python-project-template). Github
is used only as a mirror for visibility**

# Python Package Template

<table>
<tr>
  <td>Latest Release</td>
  <td><img src="https://img.shields.io/pypi/v/pypkgtemp.svg" alt="latest release" /></td>
</tr>
<tr>
  <td></td>
  <td><img src="https://anaconda.org/costrouc/pypkgtemp/badges/version.svg" alt="latest release" /></td>
</tr>
<tr>
  <td></td>
  <td>
    <a href="https://hub.docker.com/r/costrouc/python-package-template/">
    <img src="https://img.shields.io/badge/docker-latest-blue.svg" alt="latest release" />
    </a>
  </td>
</tr>
<tr>
  <td>Package Status</td>
  <td><img src="https://img.shields.io/pypi/status/pypkgtemp.svg" alt="status" /></td>
</tr>
<tr>
  <td>License</td>
  <td><img src="https://img.shields.io/pypi/l/pypkgtemp.svg" alt="license" /></td>
</tr>
<tr>
  <td>Build Status</td>
  <td>
    <a href="https://gitlab.com/costrouc/python-package-template/pipelines">
    <img src="https://gitlab.com/costrouc/python-package-template/badges/master/pipeline.svg" alt="gitlab pipeline status" />
    </a>
  </td>
</tr>
<tr>
  <td>Coverage</td>
  <td><img src="https://gitlab.com/costrouc/python-package-template/badges/master/coverage.svg" alt="coverage" /></td>
</tr>
<tr>
  <td>Conda</td>
  <td>
    <a href="https://gitlab.com/costrouc/python-package-template">
    <img src="https://anaconda.org/costrouc/pypkgtemp/badges/downloads.svg" alt="conda downloads" />
    </a>
  </td>
</tr>
<tr>
  <td>Documentation</td>
  <td>
    <a href="https://costrouc-python-package-template.readthedocs.io/en/latest/">
    <img src="https://media.readthedocs.org/static/projects/badges/passing.svg" alt="readthedocs documentation" />
    </a>
  </td>
</tr>
</table>

This is an opinionated attempt to document how I deploy a python
application with documentation, testing, pypi, and continuous
deployment. This project will be updated as I change my python
development practices. Number one this is a learning experience.
[![pipeline status](https://gitlab.com/Dom31/python-project-template/badges/master/pipeline.svg)](https://gitlab.com/Dom31/python-project-template/commits/master)
[![coverage report](https://gitlab.com/Dom31/python-project-template/badges/master/coverage.svg)](https://gitlab.com/Dom31/python-project-template/commits/master)

This project is an example of implementation of:

 - documentation ([sphinx](http://www.sphinx-doc.org/en/stable/), selfhosted + [readthedocs](https://readthedocs.org/))
 - testing ([pytest](https://docs.pytest.org/en/latest/)) and coverage ([pytest-cov](https://github.com/pytest-dev/pytest-cov))
 - deploy to pypi ([twine](https://github.com/pypa/twine))
 - deploy to conda ([conda](https://github.com/conda/conda))
 - deploy docker container to ([dockerhub](https://hub.docker.com) and [gitlab container registry](https://about.gitlab.com/2016/05/23/gitlab-container-registry/))
 - building a package (`setup.py`, `README.md`, `CHANGELOG.md`, `LICENSE.md`)
 - command line interface with argparse
 - badges for testing, packages, and documentation

Thank's to these site authors:
- https://gitlab.com/costrouc/python-package-template
- https://pypi.org/project/python_boilerplate_template/

## Assumptions:

Gitlab will be used for the continuous deployment. It is a great
project that is open source and comes with many nice features not
available for Github. You should consider it! Features used:
Gitlab will be used for the continuous deployment. See these features:

 - [pages](https://docs.gitlab.com/ee/user/project/pages/index.html)
 - [CI/CD](https://about.gitlab.com/features/gitlab-ci-cd/)

If you would like a custom domain setup with gitlab pages for the
documentation you will need to use
[cloudflare](https://www.cloudflare.com/). I have a [blog written on
how to do
this](https://chrisostrouchov.com/posts/hugo_static_site_deployment/)
or you can look at the [gitlab cloudflare
documentation](https://about.gitlab.com/2017/02/07/setting-up-gitlab-pages-with-cloudflare-certificates/).
## Contributing

## Steps
All contributions, bug reports, bug fixes, documentation improvements,
enhancements and ideas are welcome. These should be submitted at the
[Gitlab repository](https://gitlab.com/Dom31/python-package-template). Github is only used for visibility.

This project is a python package itself and full documentation is
available on readthedocs. Each of the steps below includes a link to
the section in the documentation.
The goal of this project is to in an opinionated way guide modern
python packaging development for myself.

1. [setup a bare python package](https://costrouc-python-package-template.readthedocs.io/en/latest/packaging.html) with git repo (`setup.py`, `README.md`, `.gitignore`, `<package>`)
2. [setup pypi deployment](https://costrouc-python-package-template.readthedocs.io/en/latest/pypi.html) with git tags `vX.X.X`
3. [setup testing](https://costrouc-python-package-template.readthedocs.io/en/latest/testing.html) on each commit with `pytest`
4. [setup documentation](https://costrouc-python-package-template.readthedocs.io/en/latest/documentation.html) with `sphinx` on readthedocs and self hosted
## License

# Requirements
No licence (but why not : BSD, MIT, GPL v3,...)

None!

# Contributing
# Installation and usage

All contributions, bug reports, bug fixes, documentation improvements,
enhancements and ideas are welcome. These should be submitted at the
[Gitlab repository](https://gitlab.com/costrouc/python-package-template). Github is
only used for visibility.

The goal of this project is to in an opinionated way guide modern
python packaging development for myself.
## Requirements

[requirements.txt](/requirements.txt)

**Note**: others external python modules may be mentioned in [setup.py](/setup.py) and [docs/conf.py](/docs/conf.py) 

## Install with git

```git
git clone https://gitlab.com/Dom31/python-package-template/python-package-template.git
```

## Build

``no build instructions``

## Tests

```
pytest --cov=people tests/
```

See also the section on tests in [.gitlab-ci.yml](/.gitlab-ci.yml)
**Note:** Batch file for windows (coverage output in HTML) : [tests/people-cli/run_coverage_windows.bat](/tests/people-cli/run_coverage_windows.bat)


## Usages

```
python people.people_cli.py 
python people.people_cli.py init
python people.people_cli.py file data/people.json
python peopleGUI.people_gui.py
```


## Bug reports


Please report bugs and feature requests at https://github.com/Dom31/oneClass/issues


Documentation
=============

See the command lines in the section on documentation in [.gitlab-ci.yml](/.gitlab-ci.yml)

The full documentation for CLI and API is available on [Read-the-Docs](https://a-python-project-template.readthedocs.io/en/latest/index.html)

The configuration is in [.readthedocs.yml](/.readthedocs.yml)



## Code-Style

We use black as code formatter, so you'll need to format your changes using the
`black code formatter
<https://github.com/python/black>`_.

Just run

```

    cd python-gitlab/
    pipinstall --user black
    black .

# License
```
  
MIT
to format your code according to our guidelines.