Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Migration #91

Merged
merged 6 commits into from
Jan 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/python-ci-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: cti-taxii-client test harness
on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]

name: Python ${{ matrix.python-version }} Build
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 and update essential dependencies
run: |
pip install -U pip setuptools
pip install tox-gh-actions
pip install codecov
- name: Test with Tox
run: |
tox
- name: Upload coverage information to Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
20 changes: 13 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
sha: v0.9.2
rev: v3.4.0
hooks:
- id: trailing-whitespace
- id: check-merge-conflict
- repo: https://github.com/PyCQA/flake8
rev: 3.8.4
hooks:
- id: flake8
name: Check project styling
args:
- --max-line-length=160
- id: check-merge-conflict
- repo: https://github.com/FalconSocial/pre-commit-python-sorter
sha: b57843b0b874df1d16eb0bef00b868792cb245c2
- repo: https://github.com/PyCQA/isort
rev: 5.7.0
hooks:
- id: python-import-sorter
args:
- --diff
- id: isort
name: Sort python imports (shows diff)
args: ["-c", "--diff"]
- id: isort
name: Sort python imports (fixes files)
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ above <#currentMaintainers>`__. Please send general questions about Open
Repository participation to OASIS Staff at repository-admin@oasis-open.org and
any specific CLA-related questions to repository-cla@oasis-open.org.

.. |Build_Status| image:: https://travis-ci.org/oasis-open/cti-taxii-client.svg?branch=master
:target: https://travis-ci.org/oasis-open/cti-taxii-client
.. |Build_Status| image:: https://github.com/oasis-open/cti-taxii-client/workflows/cti-taxii-client%20test%20harness/badge.svg
:target: https://github.com/oasis-open/cti-taxii-client/actions?query=workflow%3A%22cti-taxii-client+test+harness%22
.. |Coverage| image:: https://codecov.io/gh/oasis-open/cti-taxii-client/branch/master/graph/badge.svg
:target: https://codecov.io/gh/oasis-open/cti-taxii-client
.. |Version| image:: https://img.shields.io/pypi/v/taxii2-client.svg?maxAge=3600
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def get_long_description():
'Topic :: Security',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
keywords='taxii taxii2 client json cti cyber threat intelligence',
packages=find_packages(exclude=['*.test']),
Expand Down
54 changes: 19 additions & 35 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,51 +1,35 @@
[tox]
envlist = py35,py36,py37,py38,pycodestyle,isort-check,packaging
envlist = py36,py37,py38,py39,packaging,pre-commit-check

[testenv]
deps =
-U
tox
pytest
pytest-cov
coverage
responses
-U
tox
pytest
pytest-cov
coverage
responses
commands =
pytest --cov=taxii2client taxii2client/test/ --cov-report term-missing
pytest --cov=taxii2client taxii2client/test/ --cov-report term-missing

passenv = CI TRAVIS TRAVIS_*
passenv = GITHUB_*

[testenv:pycodestyle]
[testenv:packaging]
deps =
flake8
pycodestyle
commands =
pip check
pycodestyle ./taxii2client
flake8 ./taxii2client

[pycodestyle]
max-line-length=160
exclude=taxii2client/__init__.py

[flake8]
max-line-length=160
exclude=taxii2client/__init__.py

[testenv:isort-check]
deps = isort
twine
commands =
isort taxii2client --df
isort taxii2client -c
python setup.py sdist bdist_wheel --universal
twine check dist/*

[testenv:packaging]
[testenv:pre-commit-check]
deps =
readme_renderer
pre-commit
commands =
python setup.py check -r -s
pre-commit run --all-files

[travis]
[gh-actions]
python =
3.5: py35
3.6: py36
3.7: py37
3.8: py38, pycodestyle, isort-check, packaging
3.8: py38
3.9: py39, packaging, pre-commit-check