Skip to content

Commit

Permalink
Try github actions for building
Browse files Browse the repository at this point in the history
  • Loading branch information
Félix Bouliane authored and fbouliane committed May 12, 2022
1 parent 7cbe53c commit 1c3d75f
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 20 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -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 }}

31 changes: 31 additions & 0 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 0 additions & 2 deletions constraints-py27.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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

Expand All @@ -34,5 +36,5 @@ no-path-adjustment = 1
logging-level=DEBUG
verbosity = 2

[wheel]
[bdist_wheel]
universal = 1
18 changes: 8 additions & 10 deletions test-constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -37,21 +35,21 @@ 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
# -r constraints.txt
# 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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/util/protocol_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 1c3d75f

Please sign in to comment.