Skip to content

Commit fd307d9

Browse files
committed
[DOCS] Installation guide & cli Usage
2 parents 3e09403 + 806bb5a commit fd307d9

File tree

7 files changed

+93
-28
lines changed

7 files changed

+93
-28
lines changed

CHANGELOG.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22
Changelog
33
=========
44

5+
1.1.1 (2022-05-17)
6+
==================
7+
8+
Changes
9+
^^^^^^^
10+
11+
documentation
12+
"""""""""""""
13+
- document installation and cli usage
14+
15+
516
1.1.0 (2022-05-17)
617
==================
718

README.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Python Package (pypi) Cookiecutter, with emphasis on CI/CD and automation.
55

66
.. start-badges
77
8-
| |build| |docs| |coverage| |ossf| |maintainability| |better_code_hub| |codacy| |tech-debt|
8+
| |build| |docs| |coverage| |ossf| |maintainability| |better_code_hub| |codacy| |tech-debt| |black|
99
| |release_version| |wheel| |supported_versions| |gh-lic| |commits_since_specific_tag_on_master| |commits_since_latest_github_release|
1010
1111
|
@@ -196,9 +196,9 @@ For more complex use cases, you can modify the Template and also leverage all of
196196

197197
.. Github Releases & Tags
198198
199-
.. |commits_since_specific_tag_on_master| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/v1.1.0/master?color=blue&logo=github
199+
.. |commits_since_specific_tag_on_master| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/v1.1.1/master?color=blue&logo=github
200200
:alt: GitHub commits since tagged version (branch)
201-
:target: https://github.com/boromir674/cookiecutter-python-package/compare/v1.1.0..master
201+
:target: https://github.com/boromir674/cookiecutter-python-package/compare/v1.1.1..master
202202

203203
.. |commits_since_latest_github_release| image:: https://img.shields.io/github/commits-since/boromir674/cookiecutter-python-package/latest?color=blue&logo=semver&sort=semver
204204
:alt: GitHub commits since latest release (by SemVer)
@@ -248,3 +248,10 @@ For more complex use cases, you can modify the Template and also leverage all of
248248
.. |tech-debt| image:: https://img.shields.io/codeclimate/tech-debt/boromir674/cookiecutter-python-package
249249
:alt: Code Climate technical debt
250250
:target: https://codeclimate.com/github/boromir674/cookiecutter-python-package/
251+
252+
253+
.. Code Style with Black
254+
255+
.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
256+
:alt: Black
257+
:target: https://github.com/psf/black
Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11

2-
| The most common way to generate a new Python Package Project (in the current working directory),
3-
| is to invoke the *generate-python* cli (while supplying the necessary initial
4-
| information if/when prompted).
2+
| Using the cli is as simple as invoking `generate-python` from a console.
53
6-
Open a console (ie terminal) and run:
4+
You can run the following to see all the available parameters you can control:
75

86
.. code-block:: shell
9-
7+
8+
generate-python --help
9+
10+
The most common way to generate a new Python Package Project is to run:
11+
12+
.. code-block:: shell
13+
1014
generate-python
15+
16+
This will prompt you to input some values and create a fresh new Project in the
17+
current directory!
18+
19+
Now, simply `cd` into the generated Project's directory and enjoy some
20+
of the features the generator supplies new projects with!
21+
22+
More on use cases in the next section.

docs/contents/30_usage/index.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22
Generate New Python Package Project
33
===================================
44

5-
This *pyton generator* was designed to be installed via *pip* and then invoked through
5+
This *python generator* was designed to be installed via *pip* and then invoked through
66
the cli.
77

8-
------------
9-
Installation
10-
------------
8+
------------------
9+
Installing the cli
10+
------------------
1111

1212
.. include:: installation.rst
1313

14+
-------------
15+
Using the cli
16+
-------------
17+
1418
.. include:: generate_project.rst
1519

1620

docs/contents/30_usage/installation.rst

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,46 +6,77 @@
66
Install as PyPi package
77
-----------------------
88

9+
Installing `cookiecutter-python` with `pip` is the way to go, for getting the
10+
`generate-python` cli onto your machine. Here we demonstrate how to do that using a
11+
912

1013
In virtual environment (recommended)
1114
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1215

13-
The recommended way of installing any python package, is use a *python virtual environment*.
16+
As with any Python Package, it is recommended to install *cookiecutter-python* inside a
17+
python *virtual environment*. You can use any of `virtualenv`, `venv`, `pyenv` of the
18+
tool of your choice. Here we demonstrate, using `virtualenv`, by running the following commands
19+
in a console (aka terminal):
20+
21+
1. Create a virtual environment
22+
23+
.. code-block:: shell
24+
25+
virtualenv env --python=python3
1426
1527
Open a console (aka terminal) and run:
1628

17-
.. code-block:: shell
29+
2. Activate environment
30+
31+
.. code-block:: shell
32+
33+
source env/bin/activate
34+
35+
3. Install `cookiecutter-python`
36+
37+
.. code-block:: shell
1838
19-
virtualenv env --python=python3
20-
source env/bin/activate
39+
pip install cookiecutter-python
2140
22-
pip install cookiecutter-python
41+
4. Create symbolic link for the (current) user
2342

24-
deactivate
43+
.. code-block:: shell
44+
45+
ln -s env/bin/generate-python ~/.local/bin/generate-python
2546
26-
ln -s env/bin/generate-python ~/.local/bin/generate-python
2747
2848
Now the *generate-python* executable should be available (assuming ~/.local/bin is in your PATH)!
2949

3050

31-
For user
32-
^^^^^^^^
51+
For user (option 2)
52+
^^^^^^^^^^^^^^^^^^^
3353

3454
One could also opt for a *user* installation of *cookiecutter-python* package:
3555

36-
.. code-bloack: shell
56+
.. code-block:: shell
3757
3858
python3 -m pip install --user cookiecutter-python
3959
4060
41-
For all users
42-
^^^^^^^^^^^^^
61+
For all users (option 3)
62+
^^^^^^^^^^^^^^^^^^^^^^^^
4363

4464
The least recommended way of installing *cookiecutter-python* package is to
4565
*directly* install in the *host* machine:
4666

47-
.. code-bloack: shell
67+
.. code-block:: shell
4868
4969
sudo python3 -m pip install cookiecutter-python
5070
5171
Note the need to invoke using *sudo*, hence not that much recommended.
72+
73+
74+
Check installation
75+
------------------
76+
77+
| Now the `generate-python` cli should be available!
78+
| You can verify by running the following:
79+
80+
.. code-block:: shell
81+
82+
generate-python --version

setup.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[metadata]
22
## Setuptools specific information
33
name = cookiecutter_python
4-
version = 1.1.0
4+
version = 1.1.1
55
# renders on pypi as subtitle
66
description = Yet another modern Python Package (pypi) with emphasis in CI/CD and automation
77
long_description = file: README.rst
@@ -15,7 +15,7 @@ author_email = k.lampridis@hotmail.com
1515
# represents the web home page of the project
1616
url = https://github.com/boromir674/cookiecutter-python-package
1717

18-
download_url = https://github.com/boromir674/cookiecutter-python-package/archive/v1.1.0.tar.gz
18+
download_url = https://github.com/boromir674/cookiecutter-python-package/archive/v1.1.1.tar.gz
1919

2020
## PyPi specific information
2121
project_urls =
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.1.0'
1+
__version__ = '1.1.1'

0 commit comments

Comments
 (0)