Skip to content

Commit

Permalink
Fix flake8 for top-level modules.
Browse files Browse the repository at this point in the history
  • Loading branch information
dorianpula authored and bitprophet committed Jun 1, 2017
1 parent ad4cddf commit c1a0974
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 32 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ universal = 1
omit = paramiko/_winapi.py

[flake8]
exclude = sites,.git,build,dist,alt_env,appveyor
exclude = sites,.git,build,dist,alt_env,appveyor,demos,tests,paramiko,test.py
ignore = E124,E125,E128,E261,E301,E302,E303
max-line-length = 79
41 changes: 20 additions & 21 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
# along with Paramiko; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA.

import sys
from setuptools import setup

if sys.platform == 'darwin':
import setup_helper

setup_helper.install_custom_make_tarball()

longdesc = '''
This is a library for making SSH2 connections (client or server).
Expand All @@ -30,37 +37,29 @@
git+https://github.com/paramiko/paramiko/#egg=paramiko``.
'''

import sys
from setuptools import setup


if sys.platform == 'darwin':
import setup_helper
setup_helper.install_custom_make_tarball()


# Version info -- read without importing
_locals = {}
with open('paramiko/_version.py') as fp:
exec(fp.read(), None, _locals)
version = _locals['__version__']


setup(
name = "paramiko",
version = version,
description = "SSH2 protocol library",
long_description = longdesc,
author = "Jeff Forcier",
author_email = "[email protected]",
url = "https://github.com/paramiko/paramiko/",
packages = [ 'paramiko' ],
license = 'LGPL',
platforms = 'Posix; MacOS X; Windows',
classifiers = [
name="paramiko",
version=version,
description="SSH2 protocol library",
long_description=longdesc,
author="Jeff Forcier",
author_email="[email protected]",
url="https://github.com/paramiko/paramiko/",
packages=['paramiko'],
license='LGPL',
platforms='Posix; MacOS X; Windows',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
'License :: OSI Approved :: '
'GNU Library or Lesser General Public License (LGPL)',
'Operating System :: OS Independent',
'Topic :: Internet',
'Topic :: Security :: Cryptography',
Expand Down
17 changes: 9 additions & 8 deletions setup_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def make_tarball(base_name, base_dir, compress='gzip', verbose=0, dry_run=0,
For 'gzip' and 'bzip2' the internal tarfile module will be used.
For 'compress' the .tar will be created using tarfile, and then
we will spawn 'compress' afterwards.
The output tar file will be named 'base_name' + ".tar",
The output tar file will be named 'base_name' + ".tar",
possibly plus the appropriate compression extension (".gz",
".bz2" or ".Z"). Return the output filename.
"""
Expand All @@ -87,12 +87,14 @@ def make_tarball(base_name, base_dir, compress='gzip', verbose=0, dry_run=0,
# "create a tree of hardlinks" step! (Would also be nice to
# detect GNU tar to use its 'z' option and save a step.)

compress_ext = { 'gzip': ".gz",
'bzip2': '.bz2',
'compress': ".Z" }
compress_ext = {
'gzip': ".gz",
'bzip2': '.bz2',
'compress': ".Z",
}

# flags for compression program, each element of list will be an argument
tarfile_compress_flag = {'gzip':'gz', 'bzip2':'bz2'}
tarfile_compress_flag = {'gzip': 'gz', 'bzip2': 'bz2'}
compress_flags = {'compress': ["-f"]}

if compress is not None and compress not in compress_ext.keys():
Expand Down Expand Up @@ -144,11 +146,10 @@ def _set_uid_gid(tarinfo):
_custom_formats = {
'gztar': (make_tarball, [('compress', 'gzip')], "gzip'ed tar-file"),
'bztar': (make_tarball, [('compress', 'bzip2')], "bzip2'ed tar-file"),
'ztar': (make_tarball, [('compress', 'compress')], "compressed tar file"),
'tar': (make_tarball, [('compress', None)], "uncompressed tar file"),
'ztar': (make_tarball, [('compress', 'compress')], "compressed tar file"),
'tar': (make_tarball, [('compress', None)], "uncompressed tar file"),
}

# Hack in and insert ourselves into the distutils code base
def install_custom_make_tarball():
distutils.archive_util.ARCHIVE_FORMATS.update(_custom_formats)

5 changes: 3 additions & 2 deletions tasks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from os import mkdir
from os.path import join
from shutil import rmtree, copytree

Expand Down Expand Up @@ -41,7 +40,9 @@ def release(ctx, sdist=True, wheel=True, sign=True, dry_run=False):
# Publish
publish(ctx, sdist=sdist, wheel=wheel, sign=sign, dry_run=dry_run)
# Remind
print("\n\nDon't forget to update RTD's versions page for new minor releases!")
print("\n\nDon't forget to update RTD's versions page for new minor "
"releases!")


# TODO: "replace one task with another" needs a better public API, this is
# using unpublished internals & skips all the stuff add_task() does re:
Expand Down

0 comments on commit c1a0974

Please sign in to comment.