Metadata-Version: 2.1
Name: rc-cli
Version: 0.1.5
Summary: RoseCloud CLI
Home-page: UNKNOWN
Author: RoseCloud Team
Author-email: rupakhet@rose-hulman.edu
License: MIT
Project-URL: Bug Reports, https://ada.csse.rose-hulman.edu/RoseBuild/rc-cli/boards
Project-URL: Source, https://ada.csse.rose-hulman.edu/RoseBuild/rc-cli/tree/master
Keywords: rose-hulman rosecloud management setuptools
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Education
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Education
Classifier: Topic :: Software Development :: Version Control :: Git
Classifier: Topic :: System :: Filesystems
Classifier: Topic :: Utilities
Requires-Python: >=3.5
Description-Content-Type: text/markdown
Requires-Dist: Click (==6.7)
Requires-Dist: colorama (==0.3.9)
Requires-Dist: requests (==2.18.4)
Requires-Dist: gitpython (==2.1.9)
Requires-Dist: pytz (==2018.3)

# RoseCloud CLI
The RoseCloud CLI tool. It is intended to be used to setup and manage
a RoseCloud workspace for instructors and teaching assistants.

## Requirements
- python 3.5+

## Development
### Setup
#### With `pipenv`
  1. Install `pipenv`: `sudo pip install pipenv`.
  2. Run `pipenv install`.
This sets up a python virtual environment for you. All subsequent
commands should be run via `pipenv run ...`. If you need to add
another dependency, run `pipenv install <package_name>`.

##### Link CLI
  1. Run `pipenv install -e .`. This will create a symlink to this
project. All changes here will show up in the `pipenv`.
  2. Run `pipenv run rc --help`.

#### With `pip`
  1. Run `pip install -r requirements.txt`
This will install all dependencies to your machine. This is if you do not
want to mess around with virtual environments and are fine with adding a few
dependencies globally to your machine.

##### Link CLI
 1. Run `pip install -e .`
 2. Run `rc --help`

### Things to Keep in Mind
- Update `requirements.txt` once in a while. Recommend using `pigar`
- Update `setup.py` dependencies once in a while.
- Update Docker image once in a while by running
    - `docker build -t docker.csse.rose-hulman.edu/rosebuild/rc-cli/pypi-deployer:MAJOR.MINOR.PATCH . --no-cache`
    - `docker push docker.csse.rose-hulman.edu/rosebuild/rc-cli/pypi-deployer:MAJOR.MINOR.PATCH`
- We need test
    - Click supports isolated filesystem and internal invocation

## Publishing
### CI
You can read below for how to do it manually. To deploy, make sure the repository
is cleaned (all files committed and pushed) and add a tag following semantic versioning.

To add a tag:
```shell
git fetch --tags --force // fetch all tags
git tag // display a list of tags
git tag MAJOR.MINOR.PATCH // fill in the MAJOR, MINOR, and PATCH
git push --tags // pusha all uncommitted tags
```

This will trigger a CI pipeline that will automatically deploy to `pypi`.
You can see if your changes made it [here](https://pypi.org/project/rc-cli/)
or you can check the CI/CD pipeline on Gitlab.

**NOTE** We are using `setuptools_scm` to fetch `git tags` and use it as our
version. `setuptools_scm` finds the latest tag and attempts to compute the latest
PATCH version based on the number of commits (and unstaged changes) since the commit
of the tag. This is why it is important that you tag after all files are committed
and pushed.

### Setup
First, you need to install `PyPi`'s publication tool `twine`.
Run,
```shell
pip install twine
```

You will also need `wheel`.
Run,
```shell
pip install wheel
```

Lastly, ensure you have the latest `setuptools` by running
```shell
pip install --upgrade setuptools
```

You will need to also setup a PyPi account ([link](https://pypi.org/account/register/))
and a test PyPi account ([link](https://test.pypi.org/account/register/)).

For ease of use, you can create a file in your home directory called
`.pypirc` with the following. For linux and osx, this would be `~/.pypirc`. `Twine` will use this to request rather than
requesting for credentials.
```
[pypi]
username = <username>
password = <password>

[testpypi]
username = <username>
password = <password>
```

### Short Version
The details are below. If you do not want to do the below or want to remember what you need to do, do this:
1. Update `setup.py`'s version.
2. Run `python deploy.py`.

### Generating Dist Files
**Before you begin, make sure `python` has version 3.5+. The following command will
generate dist files that are specific to your `python` version and some of the features
used in this project are `python 3.5+` specific.**

To generate `dist` files, you need to run
```shell
python setup.py bdist_wheel
```

### Upload New Distribution
If you are uploading changes, you should update the version in the `setup.py` following
semantic versioning principles.

Run the following to upload latest changes to official `PyPi` servers
```shell
twine upload dist/*
```

You can now install it using
```shell
pip install rc-cli
```

Alternatively, to test without messing with production, run this
```shell
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
```

To install from test,
```shell
pip install --index-url https://test.pypi.org/rc-cli rc-cli
```

More info here on PyPi distribution [link](https://packaging.python.org/tutorials/distributing-packages/).

More info here on test PyPi [link](https://packaging.python.org/guides/using-testpypi/#using-test-pypi).


