Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ddac282

Browse files
committed
Merge branch 'main' into develop
2 parents d52a516 + d27afd8 commit ddac282

File tree

8 files changed

+27
-25
lines changed

8 files changed

+27
-25
lines changed

README.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@ Currently supported bots:
2727

2828
Full documentation: https://franaudo.github.io/codebots/latest/.
2929

30-
.. note::
31-
32-
This pacakge is a WIP! Expect things to be very different among versions. However,
33-
the stable releases will always work and pass all the tests.
34-
35-
If you want to access the latest functionalities, clone the GitHub repo and switch
36-
to the `develop` branch, although it is very likely that things won't work! :)
3730

3831
Features
3932
--------

docs/conf.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
# copyright = "2021, Francesco Ranaudo"
4545
# author = "Francesco Ranaudo"
4646
# # The full version, including alpha/beta/rc tags
47-
# release = "0.7.1"
47+
# release = "0.8.2"
4848
# # release = LooseVersion(sphinx_material.__version__).vstring
4949

5050
# # -- General configuration ---------------------------------------------
@@ -116,7 +116,6 @@
116116
# ]
117117

118118

119-
120119
# # napoleon options
121120
# napoleon_google_docstring = False
122121
# napoleon_numpy_docstring = True
@@ -459,6 +458,8 @@
459458
autoclass_content = "class"
460459

461460
# Enable eval_rst in markdown
461+
462+
462463
def setup(app):
463464
app.add_config_value(
464465
"recommonmark_config",
@@ -472,5 +473,3 @@ def setup(app):
472473
objname="configuration value",
473474
indextemplate="pair: %s; configuration value",
474475
)
475-
476-

docs/index.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ Welcome to codebots's documentation!
1313
:target: https://github.com/franaudo/codebots/actions/workflows/codeql-analysis.yml
1414
:alt: CodeQL
1515

16+
17+
.. note::
18+
19+
This pacakge is a WIP! Expect things to be very different among versions. However,
20+
the stable releases will always work and pass all the tests.
21+
22+
If you want to access the latest functionalities, clone the GitHub repo and switch
23+
to the `develop` branch, although it is very likely that things won't work! :)
24+
25+
1626
.. toctree::
1727
:maxdepth: 1
1828
:caption: Contents:

setup.cfg

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[bumpversion]
2-
current_version = 0.7.1
2+
current_version = 0.8.2
33
message = Bump version to {new_version}
44
commit = True
55
tag = True
66

77
[options]
8-
package_dir =
8+
package_dir =
99
=src
1010
packages = find:
1111

@@ -28,13 +28,13 @@ convention = numpy
2828

2929
[tool:pytest]
3030
testpaths = tests
31-
norecursedirs =
31+
norecursedirs =
3232
migrations
33-
python_files =
33+
python_files =
3434
test_*.py
3535
*_test.py
3636
tests.py
37-
addopts =
37+
addopts =
3838
-ra
3939
--strict
4040
--doctest-modules

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
with open("CHANGELOG.rst") as history_file:
1111
history = history_file.read()
1212

13-
requirements = ["Click>=7.0", "slack_sdk", "yagmail", "gitpython"]
13+
requirements = ["Click>=7.0", "slack_sdk", "yagmail", "gitpython", "paramiko"]
1414

1515
setup_requirements = ["pytest-runner", ]
1616

1717
test_requirements = ["pytest>=3", ]
1818

1919
setup(
2020
name="codebots",
21-
version="0.7.1",
21+
version="0.8.2",
2222
author="Francesco Ranaudo",
2323
author_email="[email protected]",
2424
python_requires=">=3.5",
@@ -46,7 +46,7 @@
4646
},
4747
install_requires=requirements,
4848
license="MIT license",
49-
long_description=readme + "\n\n" + history,
49+
long_description=readme,
5050
include_package_data=True,
5151
keywords="codebots",
5252
packages=["codebots"],

src/codebots/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
__author__ = """Francesco Ranaudo"""
22
__email__ = '[email protected]'
3-
__version__ = '0.7.1'
3+
__version__ = '0.8.2'
44

55
import os
66
import json

src/codebots/cli/cli.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,18 +246,18 @@ def set_token(hostname, username, password, pvtkey):
246246
@sshbot.command()
247247
@click.option('--ssh_folder', default=None, help='path where the key pair will be saved, by default None (the `USER/.ssh` folder will be used)')
248248
@click.option('--password', default=None, help='encrypt the private key with a password')
249-
def genkeys(ssh_folder):
249+
def genkeys(ssh_folder, password):
250250
"""Create a set of public and private keys and save them in the given folder.
251251
"""
252-
out = gen_keypair(ssh_folder)
252+
out = gen_keypair(ssh_folder, password)
253253
click.echo(out)
254254

255255

256256
@sshbot.command()
257257
@click.argument('hostname')
258258
@click.argument('username')
259259
@click.argument('password')
260-
@click.option('--ssh_folder', help='path where the key pair will be saved')
260+
@click.option('--ssh_folder', default=None, help='path where the key pair will be saved')
261261
def link_keys(hostname, username, password, ssh_folder):
262262
"""Adds the public key to the server's list.\n
263263
@@ -271,6 +271,8 @@ def link_keys(hostname, username, password, ssh_folder):
271271
password on the server, by default empty.\n
272272
"""
273273
bot = sshBot(config_file=None, hostname=hostname, username=username, password=password, pvtkey="")
274+
if not ssh_folder:
275+
ssh_folder = os.path.join(str(Path.home()), '.ssh')
274276
out = add_pubkey_to_server(bot, ssh_folder)
275277
click.echo(out)
276278
out = add_token("ssh", hostname=hostname, username=username, password="", pvtkey=os.path.join(ssh_folder, 'id_rsa'))

src/codebots/utilities/ssh.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ def add_pubkey_to_server(bot, ssh_folder, os_type='linux'):
4141
--------
4242
This works only on linux servers.
4343
"""
44-
if not ssh_folder:
45-
ssh_folder = os.path.join(str(Path.home()), '.ssh')
4644
with open(os.path.join(ssh_folder, 'id_rsa.pub'), "r") as pubkey_file:
4745
pubkey = pubkey_file.readline()
4846
bot.execute_cmds(commands=['(umask 077 && test -d ~/.ssh || mkdir ~/.ssh)',

0 commit comments

Comments
 (0)