diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..1b02bb8 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,35 @@ +name: tests + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + workflow_dispatch: + +jobs: + tests: + name: "Python ${{ matrix.python-version }}" + runs-on: "ubuntu-latest" + + strategy: + matrix: + python-version: ["2.7", "3.9"] + + steps: + - uses: "actions/checkout@v2" + - uses: "actions/setup-python@v2" + with: + python-version: "${{ matrix.python-version }}" + - name: "Install dependencies" + run: | + set -xe + python -VV + python -m pip install -e .[dev] + - name: "Run tests for ${{ matrix.python-version }}" + run: python -m pytest + + - name: Upload coverage to Codecov + uses: "codecov/codecov-action@v1" + with: + fail_ci_if_error: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1544374..0000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -language: python - -sudo: false - -python: - - "2.7" - - "3.4" - - "3.5" - - "3.6" - - "pypy" - - "pypy3.5" - - "nightly" - -matrix: - fast_finish: true - allow_failures: - - python: "nightly" - include: - - python: 3.7 - dist: xenial - sudo: true - -install: - - pip install --editable .[dev] - -script: - - pytest - -after_success: - - coverage combine - - coveralls - -notifications: - email: false diff --git a/README.rst b/README.rst index 552bb92..fa3183f 100644 --- a/README.rst +++ b/README.rst @@ -1,13 +1,13 @@ luddite ======= -|travis|_ |coveralls|_ |pypi|_ |pyversions|_ +|actions|_ |codecov|_ |pypi|_ |pyversions|_ -.. |travis| image:: https://img.shields.io/travis/jumptrading/luddite.svg?branch=master -.. _travis: https://travis-ci.org/jumptrading/luddite +.. |actions| image:: https://github.com/jumptrading/luddite/actions/workflows/tests.yml/badge.svg +.. _actions: https://github.com/jumptrading/luddite/actions/workflows/tests.yml/ -.. |coveralls| image:: https://img.shields.io/coveralls/jumptrading/luddite.svg -.. _coveralls: https://coveralls.io/github/jumptrading/luddite?branch=master +.. |codecov| image:: https://codecov.io/gh/jumptrading/luddite/branch/master/graph/badge.svg +.. _codecov: https://codecov.io/gh/jumptrading/luddite .. |pypi| image:: https://img.shields.io/pypi/v/luddite.svg .. _pypi: https://pypi.org/project/luddite/ diff --git a/luddite.py b/luddite.py index 6e92b11..66d9d02 100755 --- a/luddite.py +++ b/luddite.py @@ -196,7 +196,7 @@ def __init__(self, text, line_number=None): if self.stripped: try: self.req = Requirement.parse(self.stripped) - except RequirementParseError: + except (RequirementParseError, ValueError): pass else: if len(self.req.specs) == 1: