Skip to content

Commit

Permalink
Merge branch 'trunk' into 10241-fix-ssh-key-negotiation
Browse files Browse the repository at this point in the history
  • Loading branch information
twm committed Dec 4, 2021
2 parents fc055e3 + a8aae68 commit defe8b2
Show file tree
Hide file tree
Showing 905 changed files with 5,042 additions and 4,968 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ on:
branches: [ trunk ]


# Only have a run a single parallel for each branch.
# Runs for trunk are queues.
# Older runs for non-trunk branches are cancelled and the jobs are executed
# only for the latest push to the branch.
concurrency:
group: ${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/trunk' }}


defaults:
run:
shell: bash
Expand All @@ -32,7 +41,7 @@ jobs:
# When updating the minimum Python version here, also update the
# `python_requires` from `setup.cfg`.
# Run on latest minor release of each major python version.
python-version: [3.6, 3.7, 3.8, 3.9, 3.10.0-beta.4]
python-version: [3.6, 3.7, 3.8, 3.9, 3.10.0-rc.1]
tox-env: ['alldeps-withcov-posix']
# By default, tests are executed without disabling IPv6.
noipv6: ['']
Expand Down Expand Up @@ -110,7 +119,7 @@ jobs:
tox ${{ matrix.trial-target }}
- name: Prepare coverage
if: always() && contains(matrix['tox-env'], 'withcov')
if: ${{ !cancelled() && contains(matrix['tox-env'], 'withcov') }}
run: |
# sub-process coverage are generated in separate files so we combine them
# to get an unified coverage for the local run.
Expand All @@ -120,15 +129,15 @@ jobs:
python -m coverage report --skip-covered
- uses: codecov/codecov-action@v1
if: always() && contains(matrix['tox-env'], 'withcov')
if: ${{ !cancelled() && contains(matrix['tox-env'], 'withcov') }}
with:
files: coverage.xml
name: lnx-${{ matrix.python-version }}-${{ matrix.tox-env }}${{ matrix.noipv6 }}
fail_ci_if_error: true
functionalities: gcov,search

- name: Publish to Coveralls
if: always() && contains(matrix['tox-env'], 'withcov')
if: ${{ !cancelled() && contains(matrix['tox-env'], 'withcov') }}
continue-on-error: true
run: |
python -m coveralls -v
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ repos:
- id: pyupgrade
args: ["--py36-plus"]

- repo: https://github.com/pycqa/isort
rev: 5.9.3
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 21.7b0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion admin/_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
A cross-platform copying tool that supports globbing.
"""

import sys
import glob
import shutil
import sys

for f in glob.glob(sys.argv[1]):
shutil.copy(f, sys.argv[2])
1 change: 1 addition & 0 deletions admin/dump_all_version_info.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import sys

import pkg_resources

print("::group::Python info")
Expand Down
1 change: 1 addition & 0 deletions admin/fix-for-src-mv.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""

import os

from twisted.python.filepath import FilePath

here = FilePath(__file__).parent().parent()
Expand Down
1 change: 1 addition & 0 deletions admin/fix-for-towncrier.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""

import os

from twisted.python.filepath import FilePath

here = FilePath(__file__).parent().parent()
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines/run_test_steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ parameters:
- '3.7'
- '3.8'
- '3.9'
- '3.10.0-rc.1'

- name: windowsReactor
type: string
Expand Down
1 change: 1 addition & 0 deletions bin/admin/build-apidocs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#

import sys

from twisted.python._release import BuildAPIDocsScript

BuildAPIDocsScript().main(sys.argv[1:])
1 change: 1 addition & 0 deletions bin/admin/build-docs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# It is only for use in making upstream Twisted releases.

import sys

from twisted.python._release import SphinxBuilder

SphinxBuilder().main(sys.argv[1:])
1 change: 1 addition & 0 deletions bin/admin/check-newsfragment
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Check that the current commits since branching have a topfile.


import sys

from twisted.python._release import CheckNewsfragmentScript

CheckNewsfragmentScript(print).main(sys.argv[1:])
1 change: 1 addition & 0 deletions docs/_extensions/traclinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"""

import urllib

from docutils import nodes, utils


Expand Down
14 changes: 6 additions & 8 deletions docs/conch/benchmarks/buffering_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@
Nagle-like write coalescing.
"""

from sys import stdout
from pprint import pprint
from sys import stdout
from time import time

from twisted.python.usage import Options
from twisted.python.log import startLogging

from twisted.internet.protocol import ServerFactory, Protocol, ClientCreator
from twisted.internet.defer import Deferred
from twisted.internet import reactor

from twisted.conch.mixin import BufferingMixin
from twisted.internet import reactor
from twisted.internet.defer import Deferred
from twisted.internet.protocol import ClientCreator, Protocol, ServerFactory
from twisted.python.log import startLogging
from twisted.python.usage import Options


class BufferingBenchmark(Options):
Expand Down
2 changes: 1 addition & 1 deletion docs/conch/examples/demo_draw.tac
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ keys move the cursor.

from twisted.application import internet, service
from twisted.conch.insults import insults
from twisted.conch.telnet import TelnetTransport, TelnetBootstrapProtocol
from twisted.conch.manhole_ssh import ConchFactory, TerminalRealm
from twisted.conch.ssh import keys
from twisted.conch.telnet import TelnetBootstrapProtocol, TelnetTransport
from twisted.cred import checkers, portal
from twisted.internet import protocol

Expand Down
5 changes: 3 additions & 2 deletions docs/conch/examples/demo_insults.tac
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ raindrops at random locations on the client's terminal. +, -, *, and
animation process.
"""

import random, string
import random
import string

from twisted.application import internet, service
from twisted.conch.insults import insults
from twisted.conch.telnet import TelnetTransport, TelnetBootstrapProtocol
from twisted.conch.manhole_ssh import ConchFactory, TerminalRealm
from twisted.conch.ssh import keys
from twisted.conch.telnet import TelnetBootstrapProtocol, TelnetTransport
from twisted.cred import checkers, portal
from twisted.internet import protocol, task
from twisted.python import log
Expand Down
2 changes: 1 addition & 1 deletion docs/conch/examples/demo_manhole.tac
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ from twisted.conch.insults import insults
from twisted.conch.manhole import ColoredManhole
from twisted.conch.manhole_ssh import ConchFactory, TerminalRealm
from twisted.conch.ssh import keys
from twisted.conch.telnet import TelnetTransport, TelnetBootstrapProtocol
from twisted.conch.telnet import TelnetBootstrapProtocol, TelnetTransport
from twisted.cred import checkers, portal
from twisted.internet import protocol

Expand Down
2 changes: 1 addition & 1 deletion docs/conch/examples/demo_recvline.tac
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ from twisted.conch import recvline
from twisted.conch.insults import insults
from twisted.conch.manhole_ssh import ConchFactory, TerminalRealm
from twisted.conch.ssh import keys
from twisted.conch.telnet import TelnetTransport, TelnetBootstrapProtocol
from twisted.conch.telnet import TelnetBootstrapProtocol, TelnetTransport
from twisted.cred import checkers, portal
from twisted.internet import protocol

Expand Down
2 changes: 1 addition & 1 deletion docs/conch/examples/demo_scroll.tac
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ from twisted.application import internet, service
from twisted.conch.insults import insults
from twisted.conch.manhole_ssh import ConchFactory, TerminalRealm
from twisted.conch.ssh import keys
from twisted.conch.telnet import TelnetTransport, TelnetBootstrapProtocol
from twisted.conch.telnet import TelnetBootstrapProtocol, TelnetTransport
from twisted.cred import checkers, portal
from twisted.internet import protocol
from twisted.python import log
Expand Down
8 changes: 6 additions & 2 deletions docs/conch/examples/sshsimpleclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.conch.ssh import transport, userauth, connection, common, keys, channel
import getpass
import os
import struct
import sys

from twisted.conch.ssh import channel, common, connection, keys, transport, userauth
from twisted.internet import defer, protocol, reactor
from twisted.python import log
import struct, sys, getpass, os

"""
Example of using a simple SSH client.
Expand Down
19 changes: 10 additions & 9 deletions docs/conch/examples/sshsimpleserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.

from twisted.cred import portal
from twisted.cred.checkers import InMemoryUsernamePasswordDatabaseDontUse
import sys

from zope.interface import implementer

from twisted.conch import avatar
from twisted.conch.checkers import SSHPublicKeyChecker, InMemorySSHKeyDB
from twisted.conch.ssh import factory, userauth, connection, keys, session
from twisted.conch.checkers import InMemorySSHKeyDB, SSHPublicKeyChecker
from twisted.conch.ssh import connection, factory, keys, session, userauth
from twisted.conch.ssh.transport import SSHServerTransport
from twisted.internet import reactor, protocol
from twisted.python import log
from twisted.python import components
from zope.interface import implementer
import sys
from twisted.cred import portal
from twisted.cred.checkers import InMemoryUsernamePasswordDatabaseDontUse
from twisted.internet import protocol, reactor
from twisted.python import components, log

log.startLogging(sys.stderr)

Expand Down
4 changes: 2 additions & 2 deletions docs/conch/examples/telnet_echo.tac
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ This demo sets up a listening port on 6023 which accepts telnet connections.
No login for the telnet server is required.
"""

from twisted.conch.telnet import TelnetTransport, TelnetProtocol
from twisted.internet.protocol import ServerFactory
from twisted.application.internet import TCPServer
from twisted.application.service import Application
from twisted.conch.telnet import TelnetProtocol, TelnetTransport
from twisted.internet.protocol import ServerFactory


class TelnetEcho(TelnetProtocol):
Expand Down
6 changes: 3 additions & 3 deletions docs/conch/examples/window.tac
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ telnet server is required; for the ssh server, "username" is the username and
"""


import string, random
import random
import string

from twisted.application import internet, service

from twisted.conch.insults import insults, window
from twisted.conch.manhole_ssh import ConchFactory, TerminalRealm
from twisted.conch.ssh import keys
from twisted.conch.telnet import TelnetTransport, TelnetBootstrapProtocol
from twisted.conch.telnet import TelnetBootstrapProtocol, TelnetTransport
from twisted.cred import checkers, portal
from twisted.internet import protocol, reactor, task
from twisted.python import log
Expand Down
11 changes: 6 additions & 5 deletions docs/conch/howto/listings/echoclient_shared_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@

if __name__ == "__main__":
import sys

import echoclient_shared_ssh

from twisted.internet.task import react

react(echoclient_shared_ssh.main, sys.argv[1:])

from twisted.internet.task import cooperate
from twisted.internet.defer import Deferred, gatherResults
from twisted.internet.protocol import Factory, Protocol
from echoclient_ssh import ConnectionParameters

from twisted.conch.endpoints import SSHCommandClientEndpoint

from echoclient_ssh import ConnectionParameters
from twisted.internet.defer import Deferred, gatherResults
from twisted.internet.protocol import Factory, Protocol
from twisted.internet.task import cooperate


class PrinterProtocol(Protocol):
Expand Down
17 changes: 10 additions & 7 deletions docs/conch/howto/listings/echoclient_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,24 @@

if __name__ == "__main__":
import sys

import echoclient_ssh

from twisted.internet.task import react

react(echoclient_ssh.main, sys.argv[1:])

import os, getpass
import getpass
import os

from twisted.python.filepath import FilePath
from twisted.python.usage import Options
from twisted.internet.defer import Deferred
from twisted.internet.protocol import Factory, Protocol
from twisted.internet.endpoints import UNIXClientEndpoint
from twisted.conch.ssh.keys import EncryptedKeyError, Key
from twisted.conch.client.knownhosts import KnownHostsFile
from twisted.conch.endpoints import SSHCommandClientEndpoint
from twisted.conch.ssh.keys import EncryptedKeyError, Key
from twisted.internet.defer import Deferred
from twisted.internet.endpoints import UNIXClientEndpoint
from twisted.internet.protocol import Factory, Protocol
from twisted.python.filepath import FilePath
from twisted.python.usage import Options


class EchoOptions(Options):
Expand Down
9 changes: 4 additions & 5 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import pathlib
import subprocess
from pprint import pprint
import sys
from datetime import date
from pprint import pprint

# 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
Expand Down Expand Up @@ -49,7 +49,6 @@

from twisted import version as twisted_version_object


# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down Expand Up @@ -234,8 +233,8 @@
"--intersphinx=https://cryptography.io/en/latest/objects.inv",
"--intersphinx=https://pyopenssl.readthedocs.io/en/stable/objects.inv",
"--intersphinx=https://hyperlink.readthedocs.io/en/stable/objects.inv",
"--intersphinx=https://twisted.github.io/constantly/docs/objects.inv",
"--intersphinx=https://twisted.github.io/incremental/docs/objects.inv",
"--intersphinx=https://twisted.org/constantly/docs/objects.inv",
"--intersphinx=https://twisted.org/incremental/docs/objects.inv",
"--intersphinx=https://python-hyper.org/projects/hyper-h2/en/stable/objects.inv",
"--intersphinx=https://priority.readthedocs.io/en/stable/objects.inv",
"--intersphinx=https://zopeinterface.readthedocs.io/en/latest/objects.inv",
Expand Down
1 change: 1 addition & 0 deletions docs/core/benchmarks/banana.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/python

from timer import timeit

from twisted.spread.banana import b1282int

ITERATIONS = 100000
Expand Down

0 comments on commit defe8b2

Please sign in to comment.