Skip to content

Commit

Permalink
Release v1.5
Browse files Browse the repository at this point in the history
Update docstrings
  • Loading branch information
dormant-user committed Sep 28, 2023
1 parent 6a15c1d commit 2958233
Show file tree
Hide file tree
Showing 14 changed files with 300 additions and 114 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repos:
-
id: docs
name: docs
entry: /bin/bash gen_docs.sh
entry: /bin/bash pre_commit.sh
language: system
pass_filenames: false
always_run: true
2 changes: 1 addition & 1 deletion doc_gen/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Configuration

====

.. autoclass:: vpn.models.config.EnvConfig(pydantic.BaseSettings)
.. autoclass:: vpn.models.config.EnvConfig(pydantic_settings.BaseSettings)
:members:
:exclude-members: _abc_impl, model_config, model_fields

Expand Down
92 changes: 92 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
![Python](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue)

###### Platform Supported
![Generic badge](https://img.shields.io/badge/Platform-MacOS|Windows-1f425f.svg)

###### Repo Stats
[![GitHub](https://img.shields.io/github/license/thevickypedia/vpn-server)][LICENSE]
[![GitHub repo size](https://img.shields.io/github/repo-size/thevickypedia/vpn-server)][API_REPO]
[![GitHub code size](https://img.shields.io/github/languages/code-size/thevickypedia/vpn-server)][API_REPO]

###### Deployments
[![pages-build-deployment](https://github.com/thevickypedia/vpn-server/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/thevickypedia/vpn-server/actions/workflows/pages/pages-build-deployment)
[![pypi](https://github.com/thevickypedia/vpn-server/actions/workflows/python-publish.yml/badge.svg)](https://github.com/thevickypedia/vpn-server/actions/workflows/python-publish.yml)

[![Pypi-format](https://img.shields.io/pypi/format/vpn-server)](https://pypi.org/project/vpn-server/#files)
[![Pypi-status](https://img.shields.io/pypi/status/vpn-server)](https://pypi.org/project/vpn-server)
[![sourcerank](https://img.shields.io/librariesio/sourcerank/pypi/vpn-server)](https://libraries.io/pypi/vpn-server)

# VPN Server
Establish a scalable, on-demand VPN Server powered by OpenVPN on AWS EC2.

### Install
```shell
python -m pip install vpn-server
```

### Usage
```python
import vpn

# Instantiates the object
vpn_server = vpn.VPNServer()

# Create a VPN Server
vpn_server.create_vpn_server()

# Test an existing VPN Server
# vpn_server.test_vpn()

# Deletes the VPN Server
vpn_server.delete_vpn_server()
```

> :bulb:   Please refer to the [wiki page](https://github.com/thevickypedia/vpn-server/wiki) for more usage instructions and payload requirements.
## Coding Standards
Docstring format: [`Google`](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) <br>
Styling conventions: [`PEP 8`](https://www.python.org/dev/peps/pep-0008/) <br>
Clean code with pre-commit hooks: [`flake8`](https://flake8.pycqa.org/en/latest/) and
[`isort`](https://pycqa.github.io/isort/)

### [Release Notes](https://github.com/thevickypedia/vpn-server/blob/main/release_notes.rst)
**Requirement**
```shell
python -m pip install gitverse
```

**Usage**
```shell
gitverse-release reverse -f release_notes.rst -t 'Release Notes'
```

### Linting
`PreCommit` will ensure linting, and the doc creation are run on every commit.

**Requirement**
```shell
pip install sphinx==5.1.1 pre-commit recommonmark
```

**Usage**
```shell
pre-commit run --all-files
```

## Project Links
[Wiki](https://github.com/thevickypedia/vpn-server/wiki)

[Repository](https://github.com/thevickypedia/vpn-server)

[Runbook](https://thevickypedia.github.io/vpn-server/)

[Package](https://pypi.org/project/vpn-server/)

## License & copyright

&copy; Vignesh Rao

Licensed under the [MIT License][LICENSE]

[LICENSE]: https://github.com/thevickypedia/vpn-server/blob/main/LICENSE
[API_REPO]: https://api.github.com/repos/thevickypedia/vpn-server
2 changes: 1 addition & 1 deletion docs/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Configuration

====

.. autoclass:: vpn.models.config.EnvConfig(pydantic.BaseSettings)
.. autoclass:: vpn.models.config.EnvConfig(pydantic_settings.BaseSettings)
:members:
:exclude-members: _abc_impl, model_config, model_fields

Expand Down
113 changes: 76 additions & 37 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions gen_docs.sh

This file was deleted.

37 changes: 37 additions & 0 deletions pre_commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash
# 'set -e' stops the execution of a script if a command or pipeline has an error.
# This is the opposite of the default shell behaviour, which is to ignore errors in scripts.
set -e

clean_docs() {
rm -rf docs && mkdir docs
}

update_release_notes() {
# Update release notes
gitverse-release reverse -f release_notes.rst -t 'Release Notes'
}

gen_docs() {
# Generate sphinx docs
mkdir -p doc_gen/_static # Create a _static directory if unavailable
cp README.md doc_gen # Copy readme file to doc_gen
cd doc_gen && make clean html # cd into doc_gen and create the runbook
mv _build/html/* ../docs && mv README.md ../docs # Move the runbook, readme and cleanup
cp static.css ../docs/_static
}

run_pytest() {
# Run pytest
python -m pytest
}

gen_docs &
clean_docs &
update_release_notes &

wait

# The existence of this file tells GitHub Pages not to run the published files through Jekyll.
# This is important since Jekyll will discard any files that begin with _
touch docs/.nojekyll
2 changes: 1 addition & 1 deletion vpn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
from vpn.models import (config, exceptions, image_factory, # noqa: F401
logger, route53, server, util)

version = "1.4b"
version = "1.5"
Loading

0 comments on commit 2958233

Please sign in to comment.