Skip to content

Commit

Permalink
Merge pull request #39 from TGoddessana/dev
Browse files Browse the repository at this point in the history
setup document.
  • Loading branch information
TGoddessana authored Nov 19, 2023
2 parents 0f44bf4 + e690f76 commit 988a5c2
Show file tree
Hide file tree
Showing 13 changed files with 78 additions and 29 deletions.
11 changes: 5 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,14 @@ and are written using the [pytest] testing framework.

Open a [pull request] to submit changes to this project.

Your pull request needs to meet the following guidelines for acceptance:

- The Nox test suite must pass without errors and warnings.
- Include unit tests. This project maintains 100% code coverage.
- If your changes add functionality, update the documentation accordingly.
warning:: this project is still in its early stages. still, CI-CD workflow is not yet implemented.
so do not worry to much about the test(coverage, mypy, typeguard or etc). our first priority is to get the project have
a stable test workflow.

Feel free to submit early, though—we can always iterate on this.

To run linting and code formatting checks before committing your change, you can install pre-commit as a Git hook by running the following command:
To run linting and code formatting checks before committing your change, you can install pre-commit as a Git hook by
running the following command:

```console
$ nox --session=pre-commit -- install
Expand Down
35 changes: 30 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<img src="https://github.com/TGoddessana/flask-moreshell/assets/88619089/804d2934-be56-4ea7-8ad8-9c787d5b2dd2" style="width: 40%">

# Flask Moreshell

flask shell with IPython, BPython, PTPython!

[![PyPI](https://img.shields.io/pypi/v/flask-moreshell.svg)][pypi_]
[![Status](https://img.shields.io/pypi/status/flask-moreshell.svg)][status]
[![Python Version](https://img.shields.io/pypi/pyversions/flask-moreshell)][python version]
[![License](https://img.shields.io/pypi/l/flask-moreshell)][license]
[![License](https://img.shields.io/badge/license-MIT-blue)][license]

[![Read the documentation at https://flask-moreshell.readthedocs.io/](https://img.shields.io/readthedocs/flask-moreshell/latest.svg?label=Read%20the%20Docs)][read the docs]
[![Tests](https://github.com/tgoddessana/flask-moreshell/workflows/Tests/badge.svg)][tests]
Expand All @@ -23,11 +27,13 @@

## Features

- TODO
This package provides functionality to allow flask shell commands to be used with the ipython, bpython, and ptpython
shells.

## Requirements

- TODO
- Python 3.9+
- Flask 2.3+

## Installation

Expand All @@ -37,9 +43,28 @@ You can install _Flask Moreshell_ via [pip] from [PyPI]:
$ pip install flask-moreshell
```

or anything else that can install packages from PyPI. for example, [poetry](https://python-poetry.org/)
or [pipenv](https://pipenv.pypa.io/en/latest/).

## Usage

Please see the [Command-line Reference] for details.
after the package is installed, you can use the `flask shell` command as usual.

```shell
$ flask shell
```

and you can see python REPLs like this, with flask app loaded.

![shell_usage](https://github.com/TGoddessana/flask-moreshell/assets/88619089/fdbdb4de-1f18-48fd-84da-d7dae2eb88ad)

By default, make sure that `ipython`, `bpython`, and `ptpython` are installed in your current virtual environment. When
you
use the `flask shell` command, the package will look for and load the Python REPLs in that order.

if you want to use a specific shell, you can use the `--shelltype` option.

see [Usage] for more information.

## Contributing

Expand All @@ -64,4 +89,4 @@ please [file an issue] along with a detailed description.

[license]: https://github.com/tgoddessana/flask-moreshell/blob/main/LICENSE
[contributor guide]: https://github.com/tgoddessana/flask-moreshell/blob/main/CONTRIBUTING.md
[command-line reference]: https://flask-moreshell.readthedocs.io/en/latest/usage.html
[usage]: https://flask-moreshell.readthedocs.io/en/latest/usage.html
Binary file added docs/flask-moreshell-logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ maxdepth: 1
---
usage
reference
contributing
Code of Conduct <codeofconduct>
License <license>
Expand Down
8 changes: 0 additions & 8 deletions docs/reference.md

This file was deleted.

9 changes: 5 additions & 4 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
furo==2022.4.7
sphinx==4.5.0
sphinx-click==4.1.0
myst_parser==0.17.2
furo==2023.9.10
sphinx==7.2.6
sphinx-click==5.0.1
myst_parser==2.0.0
flask==2.3.1
Binary file added docs/shell_usage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/shelltype_usage_bpython.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/shelltype_usage_ipython.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/shelltype_usage_ptpython.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 36 additions & 4 deletions docs/usage.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,39 @@
# Usage

```{eval-rst}
.. click:: flask_moreshell.__main__:main
:prog: flask-moreshell
:nested: full
after the package is installed, you can use the `flask shell` command as usual.

```console
$ flask shell
```

and you can see python REPLs like this, with flask app loaded.

![shell_usage.png](shell_usage.png)

By default, make sure that `ipython`, `bpython`, and `ptpython` are installed in your current virtual environment. When
you
use the `flask shell` command, the package will look for and load the Python REPLs in that order.

if no python REPL is found, the package will use the default python REPL.

if you want to use a specific shell, you can use the `--shelltype` option.

```shell
$ flask shell --shelltype bpython
```

![shelltype_usage_ipython.png](shelltype_usage_ipython.png)

```console
$ flask shell --shelltype bpython
```

![shelltype_usage_bpython.png](shelltype_usage_bpython.png)

```console
$ flask shell --shelltype ptpython
```

![shelltype_usage_ptpython.png](shelltype_usage_ptpython.png)

so that's all. enjoy, and go crush your flask bugs!
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ python = "^3.9"
click = ">=8.0.1"
nox-poetry = "^1.0.3"
nox = "^2023.4.22"
furo = "^2023.9.10"

[tool.poetry.extras]
ipython = ["ipython"]
Expand Down

0 comments on commit 988a5c2

Please sign in to comment.