diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..5a219f01 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,44 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions +--- + +name: release + +on: + release: + types: [released, prereleased] + +jobs: + build-and-publish: + permissions: + contents: read + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python_version: ["3.5"] + tox_env: ['py35'] + steps: + - uses: actions/checkout@v3 + - name: "Set up Python ${{ matrix.python_version }}" + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python_version }} + - name: Install dependencies + run: python -m pip install --upgrade pip + - name: Install building dependencies + run: pip install wheel tox + - name: Build venv + run: | + tox -e ${{ matrix.tox_env }} --notest + - name: Run + run: | + rm -rf dist || true + .tox/${{ matrix.tox_env }}/bin/python setup.py sdist bdist_wheel + - name: Publish a Python distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + if: github.event_name == 'released' + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml new file mode 100644 index 00000000..90171630 --- /dev/null +++ b/.github/workflows/unittests.yml @@ -0,0 +1,31 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Unit tests +on: pull_request +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - python-version: '2.7' + tox_env: 'py27' + - python-version: '3.5' + tox_env: 'py35' + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + pip install tox + tox -e ${{ matrix.tox_env }} --notest + - name: Run + run: | + tox -e ${{ matrix.tox_env }} + diff --git a/constraints-py27.txt b/constraints-py27.txt index 7238cf1e..8bfc767d 100644 --- a/constraints-py27.txt +++ b/constraints-py27.txt @@ -4,8 +4,6 @@ # # pip-compile --no-emit-trusted-host --no-index --output-file=constraints-py27.txt requirements.txt # --e git+https://github.com/stephanerobert/tftpy.git@master#egg=tftpy - # via -r requirements.txt appdirs==1.4.4 # via twisted cffi==1.14.5 diff --git a/constraints.txt b/constraints.txt index 8fc64e93..a881846a 100644 --- a/constraints.txt +++ b/constraints.txt @@ -4,11 +4,9 @@ # # pip-compile --no-emit-trusted-host --no-index --output-file=constraints.txt requirements.txt # --e git+https://github.com/stephanerobert/tftpy.git@master#egg=tftpy - # via -r requirements.txt appdirs==1.4.4 # via twisted -cffi==1.14.5 +cffi==1.15.0 # via cryptography constantly==15.1.0 # via twisted @@ -20,13 +18,13 @@ importlib-resources==3.2.1 # via netaddr incremental==21.3.0 # via twisted -lxml==4.6.3 +lxml==4.7.1 # via -r requirements.txt netaddr==0.8.0 # via -r requirements.txt pyasn1==0.4.8 # via twisted -pycparser==2.20 +pycparser==2.21 # via cffi six==1.16.0 # via cryptography diff --git a/setup.cfg b/setup.cfg index 1afad8f0..72aeffe7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,6 +5,7 @@ author = Internap Hosting author-email = opensource@internap.com summary = A pluggable switch/router command-line simulator description-file = README.md +description-content-type = text/markdown license = Apache Software License home-page = https://github.com/internap/fake-switches classifier = @@ -16,6 +17,7 @@ classifier = License :: OSI Approved :: Apache Software License Operating System :: POSIX Programming Language :: Python :: 2.7 + Programming Language :: Python :: 3.5 Topic :: Software Development :: Testing Topic :: System :: Emulators @@ -34,5 +36,5 @@ no-path-adjustment = 1 logging-level=DEBUG verbosity = 2 -[wheel] +[bdist_wheel] universal = 1 diff --git a/test-constraints.txt b/test-constraints.txt index 5f7386e2..f9a75a45 100644 --- a/test-constraints.txt +++ b/test-constraints.txt @@ -4,15 +4,13 @@ # # pip-compile --no-emit-trusted-host --no-index --output-file=test-constraints.txt constraints.txt test-requirements.txt # --e git+https://github.com/stephanerobert/tftpy.git@master#egg=tftpy - # via -r constraints.txt appdirs==1.4.4 # via # -r constraints.txt # twisted bcrypt==3.1.7 # via paramiko -cffi==1.14.5 +cffi==1.15.0 # via # -r constraints.txt # bcrypt @@ -27,7 +25,7 @@ cryptography==2.9.2 ; python_version == "3.5" # -r constraints.txt # paramiko # twisted -flexmock==0.10.4 +flexmock==0.10.10 # via -r test-requirements.txt importlib-resources==3.2.1 # via @@ -37,13 +35,13 @@ incremental==21.3.0 # via # -r constraints.txt # twisted -lxml==4.6.3 +lxml==4.7.1 # via # -r constraints.txt # ncclient mock==3.0.5 # via -r test-requirements.txt -ncclient==0.6.10 +ncclient==0.6.12 # via -r test-requirements.txt netaddr==0.8.0 # via @@ -51,7 +49,7 @@ netaddr==0.8.0 # pyeapi nose==1.3.7 # via -r test-requirements.txt -paramiko==2.7.2 +paramiko==2.8.1 # via ncclient pexpect==4.8.0 # via -r test-requirements.txt @@ -61,13 +59,13 @@ pyasn1==0.4.8 # via # -r constraints.txt # twisted -pycparser==2.20 +pycparser==2.21 # via # -r constraints.txt # cffi pyeapi==0.8.4 # via -r test-requirements.txt -pyhamcrest==2.0.2 +pyhamcrest==1.10.1 # via -r test-requirements.txt pynacl==1.4.0 # via paramiko @@ -79,7 +77,7 @@ six==1.16.0 # mock # ncclient # pynacl -twisted[conch]==16.6.0 +twisted==16.6.0 # via -r constraints.txt zipp==1.2.0 # via diff --git a/test-requirements.txt b/test-requirements.txt index 7ed7fd7d..3c50a3a4 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ nose>=1.2.1 mock>=1.0.1 -pyhamcrest>=1.6 +pyhamcrest>=1.6, <2.0.0 pexpect>=4.2.1 flexmock>=0.9.7 ncclient>=0.5.2 diff --git a/tests/util/protocol_util.py b/tests/util/protocol_util.py index 0e8d7433..56169d74 100644 --- a/tests/util/protocol_util.py +++ b/tests/util/protocol_util.py @@ -104,7 +104,7 @@ class SshTester(ProtocolTester): CONF_KEY = "ssh" def get_ssh_connect_command(self): - return 'ssh %s@%s -p %s -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' \ + return 'ssh %s@%s -p %s -o StrictHostKeyChecking=no -o KexAlgorithms=+diffie-hellman-group1-sha1 -o KexAlgorithms=+diffie-hellman-group14-sha1 -o UserKnownHostsFile=/dev/null' \ % (self.username, self.host, self.port) def login(self):