Skip to content

Commit

Permalink
📝 added documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
drearondov committed Mar 10, 2021
1 parent 7866632 commit fe405e3
Show file tree
Hide file tree
Showing 17 changed files with 600 additions and 118 deletions.
2 changes: 2 additions & 0 deletions AUTHORS.md
@@ -1,5 +1,7 @@
# Credits

This package was created with Cookiecutter and the [audreyr/cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage) project template.

## Development Lead

* Andrea Rondón Villanueva <andrea.estefania.rv@gmail.com>
Expand Down
60 changes: 37 additions & 23 deletions CONTRIBUTING.md
Expand Up @@ -49,36 +49,47 @@ If you are proposing a feature:
Ready to contribute? Here's how to set up `rocket_launcher` for local development.

1. Fork the `rocket_launcher` repo on GitHub.
2. Clone your fork locally::
2. Clone your fork locally and install dependencies.

$ git clone git@github.com:your_name_here/rocket_launcher.git
```bash
git clone git@github.com:your_name_here/rocket_launcher.git
cd rocket_launcher/
```

3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
3. Create a virtualenv. Assuming you have pyenv-virtualenv installed, this is how you set up your fork for local development

$ mkvirtualenv rocket_launcher
$ cd rocket_launcher/
$ python setup.py develop
``` bash
pyenv virtualenv rocket_launcher
pyenv activate rocket_launcher
poetry install
```

4. Create a branch for local development::
4. Create a branch for local development

$ git checkout -b name-of-your-bugfix-or-feature
```bash
git checkout -b name-of-your-bugfix-or-feature
```

Now you can make your changes locally.

5. When you're done making changes, check that your changes pass flake8 and the
tests, including testing other Python versions with tox::
tests, including testing other Python versions with tox

$ flake8 rocket_launcher tests
$ python setup.py test or pytest
$ tox
```bash
flake8 rocket_launcher tests
pytest
tox
```

To get flake8 and tox, just pip install them into your virtualenv.

6. Commit your changes and push your branch to GitHub::

$ git add .
$ git commit -m "Your detailed description of your changes."
$ git push origin name-of-your-bugfix-or-feature
```bash
git add .
git commit -m "Your detailed description of your changes."
git push origin name-of-your-bugfix-or-feature
```

7. Submit a pull request through the GitHub website.

Expand All @@ -96,19 +107,22 @@ Before you submit a pull request, check that it meets these guidelines:

## Tips

To run a subset of tests::
To run a subset of tests


$ python -m unittest tests.test_rocket_launcher
```bash
pytest tests/test_cookiecutters.py
```

## Deploying

A reminder for the maintainers on how to deploy.
Make sure all your changes are committed (including an entry in HISTORY.rst).
Make sure all your changes are committed (including an entry in CHANGELOG.md).
Then run::

$ bump2version patch # possible: major / minor / patch
$ git push
$ git push --tags
```bash
bump2version patch # possible: major / minor / patch
git push
git push --tags
```

Travis will then deploy to PyPI if tests pass.
Travis will then deploy to the repository if the tests pass.
1 change: 0 additions & 1 deletion Makefile

This file was deleted.

47 changes: 39 additions & 8 deletions README.md
@@ -1,26 +1,28 @@
# Rocket Launcher

![GitHub release (latest by date)](https://img.shields.io/github/v/release/drearondov/rocketlauncher?style=flat-square)

![Travis (.com)](https://img.shields.io/travis/com/drearondov/rocketlauncher?style=flat-square)
![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/drearondov/rocketlauncher?include_prereleases&style=flat-square) ![Travis (.com)](https://img.shields.io/travis/com/drearondov/rocketlauncher?style=flat-square) ![GitHub](https://img.shields.io/github/license/drearondov/rocketlauncher?style=flat-square) ![Codestyle](https://img.shields.io/badge/code%20style-black-333333?style=flat-square)

A **very** opinionated CLI to automate the start of a new project.

* Free software: GNU General Public License v3
* Documentation: https://projects-cli.readthedocs.io.
* Documentation: https://rocket-launcher.readthedocs.io.

## Features

* Select environment manager (`pyenv`, `conda` supported)
* Create environment manager by default
* Create new virtual environment by default
* Create folder structure from cookiecutter
* Choose to create repository and upload project to Github
* Configure defaults values
* Quickstart a new project with default values

## Usage
## Installation

Since the nature of this package is very opinionated (meaning, made with me in mind) I will not be publishing to `pypi`. But if you would like to use it, this are the installation steps.

This package assumes that some tools are already installed in your system.
### Prerequisites

For rocketLauncher to work the followinng packages need to be installed.

* [pyenv](https://github.com/pyenv/pyenv)
* [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv)
Expand All @@ -29,6 +31,35 @@ This package assumes that some tools are already installed in your system.
* [git](https://git-scm.com)
* [GithubCLI](https://cli.github.com)

Once installed you can use the following code to get the latest release.

```bash
repo='https://github.com/drearondov/rocketLauncher'

# Find the latest release.
latest=$(git ls-remote --tags --refs $repo | # Fetch remote tags.
sort -t '/' -k 3 -V | # Sort them by version.
tail -n 1 | # Take the latest one.
awk -F / '{print $3}') # Return only the tag.

# Craft the URL for the release asset.
version=$(echo $latest | tr -d 'v') # Remove the leading v.
wheel="rocket_launcher-${version}-py3-none-any.whl"
release="${repo}/releases/download/${latest}/${wheel}"

# Install the release.
pip install $release
```

## Usage

The available commands are:

* `rocketlauncher init`: Configures the projects directory and logs in to Github
* `rocketlauncher new`: Creates a new project and runs a cookiecutter inside
* `rocketlauncher push`: Creates local repository and pushes to Github
* `rocketlauncher config`: Allows the creation of a configuration file and edit/set defaults
* `rocketlauncher cookiecutters`: Add/ view available cookiecutters
## Credits

This package was created with Cookiecutter_ and the [audreyr/cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage) project template.
This package was created with Cookiecutter and the [audreyr/cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage) project template.
2 changes: 1 addition & 1 deletion config.ini
@@ -1,5 +1,5 @@
[general]
projects_dir = /private/var/folders/zr/_v5nzcxd6p3550kvyqj4cyq40000gn/T/pytest-of-drea/pytest-24/test_basefile/test_projects
projects_dir = /private/var/folders/zr/_v5nzcxd6p3550kvyqj4cyq40000gn/T/pytest-of-drea/pytest-1/test_basefile/test_projects

[defaults]
env_manager =
Expand Down
12 changes: 11 additions & 1 deletion docs/authors.md
@@ -1 +1,11 @@
.. include:: ../AUTHORS.rst
# Credits

This package was created with Cookiecutter and the [audreyr/cookiecutter-pypackage](https://github.com/audreyr/cookiecutter-pypackage) project template.

## Development Lead

* Andrea Rondón Villanueva <andrea.estefania.rv@gmail.com>

## Contributors

None yet. Why not be the first?
26 changes: 25 additions & 1 deletion docs/changelog.md
@@ -1 +1,25 @@
.. include:: ../CHANGELOG.rst
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

* Install dependencies from cookiecutter
* Switch from setup.py to pyproject.toml
* Full documentation

## [0.1.0-alpha] - 2021-02-17

### Added

* `init`, `new`, `push`, `cookiecutters` and `config` commands
* `config` commands `cookiecutter`, `init`

## [0.1.0] - 2021-03-07

### Added
* `cookiecutters` commands `add` and `list`
* Built test suite and setup Travis CI
60 changes: 49 additions & 11 deletions docs/conf.py
Expand Up @@ -19,8 +19,12 @@
#
import os
import sys

sys.path.insert(0, os.path.abspath('..'))

import recommonmark
from recommonmark.transform import AutoStructify

import rocket_launcher

# -- General configuration ---------------------------------------------
Expand All @@ -31,24 +35,41 @@

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'recommonmark']
extensions = [
'sphinx.ext.autosectionlabel',
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx.ext.coverage',
'sphinx.ext.napoleon',
'recommonmark'
]

# Prefix document path to section labels, otherwise autogenerated labels would look like 'heading'
# rather than 'path/to/file:heading'
autosectionlabel_prefix_document = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
source_suffix = ['.rst', '.md']
source_suffix = {
'.rst': 'restructuredtext',
'.txt': 'markdown',
'.md': 'markdown',
}
# source_suffix = '.rst'

# The master toctree document.
master_doc = 'index'

# General information about the project.
project = 'projects-cli'
copyright = "2021, Andrea Rondón Villanueva"
author = "Andrea Rondón Villanueva"
project = u'rocketLauncher'
copyright = u'2021, Andrea Rondón Villanueva'
author = u"Andrea Rondón Villanueva"

github_doc_root = "https://github.com/drearondov/rocketLauncher/tree/main/docs"

# The version info for the project you're documenting, acts as replacement
# for |version| and |release|, also used in various other places throughout
Expand Down Expand Up @@ -89,12 +110,19 @@
# theme further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
html_theme_options = {
'description': 'A very opinionated CLI to automate the start of a new project',
'sidebar_width': '28%',
'show_relbar_bottom': True,
'github_user': 'drearondov',
'github_repo': 'rocketLauncher',
'travis_button': True
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# html_static_path = ['_static']


# -- Options for HTMLHelp output ---------------------------------------
Expand Down Expand Up @@ -128,7 +156,7 @@
# [howto, manual, or own class]).
latex_documents = [
(master_doc, 'rocket_launcher.tex',
'projects-cli Documentation',
'rocketLauncher Documentation',
'Andrea Rondón Villanueva', 'manual'),
]

Expand All @@ -139,7 +167,7 @@
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'rocket_launcher',
'projects-cli Documentation',
'rocketLauncher Documentation',
[author], 1)
]

Expand All @@ -158,5 +186,15 @@
'Miscellaneous'),
]



# -- Recommonmark configuration

def setup(app):
app.add_config_value('recommonmark_config', {
'url_resolver': lambda url: github_doc_root + url,
'enable_auto_toc_tree': True,
'auto_toc_tree_section': 'Contents',
'enable_math': False,
'enable_inline_math': False,
'enable_eval_rst': True
}, True)
app.add_transform(AutoStructify)

0 comments on commit fe405e3

Please sign in to comment.