Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
degagne committed Aug 6, 2021
0 parents commit 4a7485c
Show file tree
Hide file tree
Showing 20 changed files with 909 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/python-publish.yml
@@ -0,0 +1,36 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
77 changes: 77 additions & 0 deletions .gitignore
@@ -0,0 +1,77 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Distribution / packaging
.Python
build/
_build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
Makefile

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
test.py
tests/

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
19 changes: 19 additions & 0 deletions .readthedocs.yml
@@ -0,0 +1,19 @@
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
formats: all

python:
version: 3.6
install:
- requirements: docs/requirements.txt
- method: pip
path: .
10 changes: 10 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,10 @@
# 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).

## [0.0.1-dev0] - 2021-08-05

- Initial release (new project)
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Deric Degagne

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
27 changes: 27 additions & 0 deletions README.md
@@ -0,0 +1,27 @@
# python-ssh

[![PythonSSH Version](https://img.shields.io/pypi/v/python-ssh?style=for-the-badge)](https://pypi.org/project/python-ssh/)
[![PythonSSH Status](https://img.shields.io/pypi/status/python-ssh?style=for-the-badge)](https://pypi.org/project/python-ssh)
[![PythonSSH Python Versions](https://img.shields.io/pypi/pyversions/python-ssh?style=for-the-badge)](https://pypi.org/project/python-ssh/)
[![PythonSSH Release](https://img.shields.io/github/release/degagne/python-ssh?style=for-the-badge)](https://github.com/degagne/python-ssh/releases/)
[![PythonSSH License](https://img.shields.io/github/license/degagne/python-ssh?style=for-the-badge)](https://github.com/degagne/python-ssh/blob/master/LICENSE)

**python-ssh** provides a convenient interface used to execute commands on remote hosts. The following documentation provides an overview of how to use the interface.

## Installation

It's recommended to be installed using [pip](https://pip.pypa.io/en/stable/).

```bash
pip install python-ssh
```

Releases are listed on the [Releases](https://github.com/degagne/python-ssh/releases) page.

## Documentation

For documentation, please visit [python-ssh](https://python-ssh.readthedocs.io/en/latest/index.html).

## License

`python-ssh` is licensed under MIT license. See the [LICENSE](https://github.com/degagne/python-ssh/blob/master/LICENSE) for more information.
36 changes: 36 additions & 0 deletions docs/_static/custom.css
@@ -0,0 +1,36 @@
body, body.wy-body-for-nav {
font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
}

.wy-nav-content {
max-width: 900px;
}

div[class^=highlight] {
border: none!important;
}

div[class^=highlight] pre {
font-family: monospace!important;
font-size: 13px!important;
}

.code-block-caption {
font-style: normal!important;
text-align: left!important;
background: #d5d8d9!important;
padding: 8px 12px !important;
}

.highlight {
background: #edf0f2!important;
}

code.literal {
border: none!important;
color: black!important;
font-size: 15px!important;
font-family: monospace!important;
padding: 0px!important;
background: none!important;
}
5 changes: 5 additions & 0 deletions docs/apidoc/errors.rst
@@ -0,0 +1,5 @@
Exceptions
##########

.. automodule:: ssh2.errors
:members:
7 changes: 7 additions & 0 deletions docs/apidoc/modules.rst
@@ -0,0 +1,7 @@
python-ssh API
##############

.. toctree::

ssh_connect
errors
6 changes: 6 additions & 0 deletions docs/apidoc/ssh_connect.rst
@@ -0,0 +1,6 @@
ssh_connect
###########

.. autoclass:: ssh2.ssh_connect
:members:
:inherited-members:
63 changes: 63 additions & 0 deletions docs/conf.py
@@ -0,0 +1,63 @@
import os
import sys
import imp
import datetime as dt
import sphinx_rtd_theme

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.abspath('..'))

# General information about the project.
project = "python-ssh"
copyright = "{}, Deric Degagne".format(dt.date.today().year)
author = "Deric Degagne"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The full version, including alpha/beta/rc tags.
release = imp.load_source("ssh2.version", os.path.join("../ssh2", "version.py")).version

# 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.intersphinx",
"sphinx.ext.viewcode",
'sphinx.ext.napoleon',
"sphinx.ext.autosectionlabel",
"sphinx_rtd_theme"
]

# The suffix of source filenames.
source_suffix = ".rst"

# The master toctree document.
master_doc = "index"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ["_build"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "sphinx_rtd_theme"

# 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_css_files = [
"custom.css"
]

intersphinx_mapping = {"python": ("http://docs.python.org/3", None)}
21 changes: 21 additions & 0 deletions docs/index.rst
@@ -0,0 +1,21 @@
python-ssh
##########

python-ssh provides a convenient interface used to execute commands on remote hosts. The following documentation provides
an overview of how to use the interface.

It's recommended to be installed using `pip <https://pip.pypa.io/en/stable/>`_.

.. code-block:: bash
:caption: Bash
pip install python-ssh
Releases are listed at https://github.com/degagne/python-ssh/releases

.. toctree::
:hidden:
:maxdepth: 2

Usage Overview <usage>
API </apidoc/modules>
7 changes: 7 additions & 0 deletions docs/requirements.txt
@@ -0,0 +1,7 @@
sphinx
sphinx_rtd_theme

# Install kafka-python in editable mode
# This allows the sphinx autodoc module
# to load the Python modules and extract docstrings.
# -e ..

0 comments on commit 4a7485c

Please sign in to comment.