Skip to content

Commit

Permalink
Merge pull request #1 from craigcomstock/CFE-3266
Browse files Browse the repository at this point in the history
Added setup.py script to enable installation from pip
  • Loading branch information
olehermanse authored Jan 27, 2021
2 parents 344889a + f15a68d commit 5d3ea67
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 33 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build
dist
33 changes: 5 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,17 @@
# cf-remote

## Installation

cf-remote requires python 3 with fabric and requests.
(Install using brew/apt/yum/pip).
It's a _normal_ python package, but doesn't have a setup script (yet).

Clone `cfengine/cf-remote` repo where you want, and then symlink, like this:

```
$ git clone https://github.com/cfengine/cf-remote.git
$ sudo ln -s `pwd`/cf-remote/cf_remote/__main__.py /usr/local/bin/cf-remote
```
## Requirements

Install dependencies:
cf-remote requires python 3.6 or greater.

```
$ cd cf-remote/
$ pip3 install -r requirements.txt
```
## Installation

Check that it worked:
Install with pip3:

```
$ ls -al `which cf-remote`
lrwxr-xr-x 1 olehermanse admin 68 Jan 10 15:20 /usr/local/bin/cf-remote -> /northern.tech/cfengine/cf-remote/cf_remote/__main__.py
$ cf-remote --version
cf-remote version 0.1 (BETA)
Available CFEngine versions:
3.13.0, 3.12.1, 3.12.0, 3.10.5, 3.10.4, 3.10.3, 3.10.2, 3.10.1, 3.10.0
$ pip3 install cf-remote
```

Note that the version/branch of core you have checked out is important!
You can also move it out of your core folder if you prefer this (but then making changes to cf-remote becomes more tedious).

## Examples

### See information about remote host
Expand Down Expand Up @@ -97,4 +75,3 @@ $ export CF_REMOTE_SSH_KEY="~/.ssh/id_rsa.pub"

Feel free to open pull requests to expand this documentation, add features or fix problems.
You can also pick up an existing task or file an issue in [our bug tracker](https://tracker.mender.io/issues/?filter=11711).
`cf-remote` is a part of the [cfengine community repo](https://github.com/cfengine/core) and has the same license (GPLv3).
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cryptography==3.2
fabric==2.4.0
paramiko==2.7.0
requests==2.22.0
apache-libcloud==2.8.0
cryptography==3.3.1
fabric==2.6.0
paramiko==2.7.2
requests==2.25.1
apache-libcloud==3.3.0
27 changes: 27 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import setuptools

with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()

setuptools.setup(
name="cf-remote",
version="0.1.0",
author="Northern.tech, Inc.",
author_email="[email protected]",
description="Tooling to deploy CFEngine (and much more)",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/cfengine/cf-remote",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
],
python_requires='>=3.6',
entry_points={
"console_scripts": [
"cf-remote = cf_remote.main:main"
]
},
)

0 comments on commit 5d3ea67

Please sign in to comment.