Skip to content

Commit

Permalink
Release v0.1.1: version and help commands
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytrostriletskyi authored Apr 9, 2019
1 parent 514a4f9 commit c6d5aaf
Show file tree
Hide file tree
Showing 17 changed files with 218 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
coverage:
precision: 2
round: down
range: 70...100

status:
patch: off
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,5 @@ venv.bak/

# mypy
.mypy_cache/

.idea/
9 changes: 9 additions & 0 deletions .pypi-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package:
name: remme-core-cli

ci:
name: travis

branches:
development: develop
release: master
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
language: python

python:
- "3.4"
- "3.5"
- "3.6"
- "3.7-dev"

install:
- pip install -r requirements.txt
- pip install -r requirements-dev.txt
- pip install -r requirements-tests.txt

script:
- cat requirements.txt requirements-tests.txt requirements-dev.txt | safety check --stdin
- radon cc cli -nb --total-average
- isort -rc cli --diff && isort -rc tests --diff
- flake8 cli
- coverage run -m pytest -vv tests

after_success:
- coverage report -m && coverage xml
- bash <(curl -s https://codecov.io/bash)
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include *.md
include LICENSE
include requirements.txt
include requirements-dev.txt
include requirements-tests.txt
72 changes: 71 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,72 @@
# remme-core-cli
The command-line interface (CLI) that provides a set of commands to interact with Remme-core.

[![Release](https://img.shields.io/github/release/Remmeauth/remme-core-cli.svg)](https://github.com/Remmeauth/remme-core-cli/releases)
[![PyPI version shields.io](https://img.shields.io/pypi/v/remme-core-cli.svg)](https://pypi.python.org/pypi/remme-core-cli/)
[![Build Status](https://travis-ci.com/Remmeauth/remme-core-cli.svg?branch=develop)](https://travis-ci.com/Remmeauth/remme-core-cli)
[![codecov](https://codecov.io/gh/Remmeauth/remme-core-cli/branch/develop/graph/badge.svg)](https://codecov.io/gh/Remmeauth/remme-core-cli)

[![Downloads](https://pepy.tech/badge/remme-core-cli)](https://pepy.tech/project/remme-core-cli)
[![PyPI license](https://img.shields.io/pypi/l/remme-core-cli.svg)](https://pypi.python.org/pypi/remme-core-cli/)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/remme-core-cli.svg)](https://pypi.python.org/pypi/remme-core-cli/)

* [Getting started](#getting-started)
* [Usage](#usage)
* [Service](#service)
* [Development](#development)
* [Production](#production)

## Getting started

Blank.

## Usage

### Service

Get the version of the package — ``remme --version``:

```bash
$ remme --version
remme, version 0.1.0
```

Get all possible package's commands — ``remme --help``:

```bash
$ remme --help
Usage: remme [OPTIONS] COMMAND [ARGS]...

Command line interface for PyPi version checking.

Options:
--version Show the version and exit.
--help Show this message and exit.

...
```

## Development

To run the tests, use the following command, being in the root of the project:

```bash
$ pytest tests/
```

To build the package to test of to be deployed, use the following commands:

```bash
$ pip3 uninstall -y remme-core-cli && rm -rf dist/ remme_core_cli.egg-info && \
python3 setup.py sdist && pip3 install dist/*.tar.gz
```

## Production

To build the package and upload it to [PypI](https://pypi.org) to be accessible through [pip](https://github.com/pypa/pip),
use the following commands. [Twine](https://twine.readthedocs.io/en/latest/) requires the username and password of the
account package is going to be uploaded to.

```build
$ python3 setup.py sdist
$ twine upload dist/*
```
Empty file added cli/__init__.py
Empty file.
Empty file added cli/clis/__init__.py
Empty file.
14 changes: 14 additions & 0 deletions cli/entrypoint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
Provide implementation of the command line interface to interact with Remme-core.
"""
import click


@click.group()
@click.version_option()
@click.help_option()
def cli():
"""
Command-line interface to interact with Remme-core.
"""
pass
Empty file added cli/services/__init__.py
Empty file.
11 changes: 11 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
add-trailing-comma==1.0.0
flake8==3.7.7
flake8-docstrings==1.3.0
flake8-commas==2.0.0
flake8-comprehensions==2.1.0
flake8-per-file-ignores==0.8.1
flake8-print==3.1.0
isort==4.3.17
pep8-naming==0.8.2
safety==1.8.5
radon==3.0.1
3 changes: 3 additions & 0 deletions requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
coverage==4.5.3
pytest==4.4.0
pytest-mock==1.10.3
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
accessify==0.3.1
click==7.0
20 changes: 20 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[isort]
line_length=120
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=True
combine_as_imports=True

[flake8]
max-line-length=120
ignore=D200, D413, D107
per-file-ignores=
*/__init__.py: D104, F401

[coverage:run]
omit =
*/.virtualenvs/*,
*/virtualenv/*,

*/__init__.py,
tests/*
39 changes: 39 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""
Setup the package.
"""
from setuptools import find_packages, setup

with open('README.md', 'r') as read_me:
long_description = read_me.read()

with open('requirements.txt', 'r') as f:
requirements = f.read().splitlines()

setup(
version='0.1.0',
name='remme-core-cli',
description='The command-line interface (CLI) that provides a set of commands to interact with Remme-core.',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/Remmeauth/remme-core-cli',
license='MIT',
author='Remme',
author_email='[email protected]',
packages=find_packages(),
install_requires=requirements,
entry_points={
'console_scripts': [
'remme = cli.entrypoint:cli',
]
},
classifiers=[
'Operating System :: OS Independent',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',

'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
],
)
Empty file added tests/__init.py
Empty file.
12 changes: 12 additions & 0 deletions tests/test_entrypoint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""
Provide tests for implementation of the entrypoint commands.
"""
from cli.entrypoint import cli


def test_name():
"""
Case: get the name of the CLI entrypoint function.
Expect: the name is the same as in setup.py (`cli`).
"""
assert 'cli' == cli.name

0 comments on commit c6d5aaf

Please sign in to comment.