-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release v0.1.1: version and help commands
- Loading branch information
1 parent
514a4f9
commit c6d5aaf
Showing
17 changed files
with
218 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,3 +102,5 @@ venv.bak/ | |
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
accessify==0.3.1 | ||
click==7.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |