Skip to content

Commit

Permalink
Move away from travis-ci and fix existing github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
4383 committed Apr 18, 2023
1 parent 08e4b7b commit 3a52b67
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 86 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,22 @@ jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
python-version: ${{matrix.python}}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install tox
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
- name: Check with linters
run: tox -e lint
- name: Test with tox
run: tox -e py
52 changes: 0 additions & 52 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Not yet released
----------------

* [feature] the toml format is now supported by niet (https://github.com/openuado/niet/pull/77)
* [CI/CD] move away from travis CI and fix existing github actions

3.0.0
-----
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# niet

[![Build Status](https://travis-ci.org/openuado/niet.svg?branch=master)](https://travis-ci.org/openuado/niet)
![Build](https://github.com/github/openuado/niet/workflows/python-app.yml/badge.svg)
![PyPI](https://img.shields.io/pypi/v/niet.svg)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/niet.svg)
![PyPI - Status](https://img.shields.io/pypi/status/niet.svg)
Expand Down
2 changes: 1 addition & 1 deletion niet/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


def fetch(url):
with urlopen(url) as f:
with urlopen(url) as f: # nosec - niet is a cli we don't care about B310
return f.read().decode("utf-8")


Expand Down
6 changes: 2 additions & 4 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
fixtures
tox
bandit
nose
pytest
pre-commit
20 changes: 4 additions & 16 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,11 @@ basepython = python3
usedevelop = True
install_command = pip install {opts} {packages}
deps = -r{toxinidir}/test-requirements.txt
commands = nosetests
commands = pytest

[testenv:pep8]
deps = flake8
flake8-import-order
flake8-blind-except
flake8-builtins
flake8-docstrings
flake8-rst-docstrings
flake8-logging-format
commands = flake8

[testenv:bandit]
commands = bandit -r niet
[testenv:lint]
deps = -r{toxinidir}/test-requirements.txt
commands = pre-commit run -a

[testenv:venv]
commands = {posargs}
Expand All @@ -30,6 +21,3 @@ commands = {posargs}
exclude = .tox,.eggs
show-source = true
ignore = D100,D101,D102,D103,D104

[travis]
python = 3.6: py36, pep8

0 comments on commit 3a52b67

Please sign in to comment.