Skip to content

Commit

Permalink
Merge pull request #232 from mahmoud/ghactions
Browse files Browse the repository at this point in the history
Hop on over to gh actions
  • Loading branch information
mahmoud committed Jan 16, 2022
2 parents 67cd5a4 + f522fa4 commit 16a2397
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 51 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Tests
on:
push:
paths-ignore:
- 'docs/**'
- '*.md'
- '*.rst'
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
- '*.rst'
jobs:
tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- {name: Linux, python: '3.9', os: ubuntu-latest, tox: py39}
- {name: Windows, python: '3.9', os: windows-latest, tox: py39}
- {name: Mac, python: '3.9', os: macos-latest, tox: py39}
- {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38}
- {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37}
- {name: '3.6', python: '3.6', os: ubuntu-latest, tox: py36}
- {name: '2.7', python: '2.7', os: ubuntu-latest, tox: py27}
- {name: 'PyPy2', python: 'pypy2', os: ubuntu-latest, tox: pypy}
- {name: 'PyPy3', python: 'pypy3', os: ubuntu-latest, tox: pypy3}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: update pip
run: |
pip install -U wheel
pip install -U setuptools
python -m pip install -U pip
- name: get pip cache dir
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"
- name: cache pip
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('setup.py') }}|${{ hashFiles('requirements/*.txt') }}
- run: pip install tox
- run: tox -e ${{ matrix.tox }},coverage-report
- name: "Upload coverage to Codecov"
uses: "codecov/codecov-action@v2"
with:
fail_ci_if_error: true
files: ./.tox/coverage.xml

42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

9 changes: 4 additions & 5 deletions glom/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1228,11 +1228,10 @@ def star(self, args=None, kwargs=None):
"""Returns a new :class:`Invoke` spec, with *args* and/or *kwargs*
specs set to be "starred" or "star-starred" (respectively)
>>> import os.path
>>> spec = Invoke(os.path.join).star(args='path')
>>> target = {'path': ['path', 'to', 'dir']}
>>> glom(target, spec)
'path/to/dir'
>>> spec = Invoke(zip).star(args='lists')
>>> target = {'lists': [[1, 2], [3, 4], [5, 6]]}
>>> list(glom(target, spec))
[(1, 3, 5), (2, 4, 6)]
Args:
args (spec): A spec to be evaluated and "starred" into the
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ face>=20.1.1
pytest==4.1.1
tox==3.7.0
virtualenv==15.1.0
PyYAML==3.13
PyYAML==5.4.1
5 changes: 2 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
[tox]
envlist = py27,py34,py36,py37,pypy,coverage-report,packaging
envlist = py27,py36,py37,py38,py39,pypy,coverage-report,packaging

[testenv]
changedir = .tox
deps = -rrequirements.txt
commands = coverage run --parallel --rcfile {toxinidir}/.tox-coveragerc -m pytest -vv --doctest-modules {envsitepackagesdir}/glom {posargs}

# Uses default basepython otherwise reporting doesn't work on Travis where
# Python 3.6 is only available in 3.6 jobs.
[testenv:coverage-report]
changedir = .tox
deps = coverage
commands = coverage combine --rcfile {toxinidir}/.tox-coveragerc
coverage xml --rcfile {toxinidir}/.tox-coveragerc
coverage report --rcfile {toxinidir}/.tox-coveragerc
coverage html --rcfile {toxinidir}/.tox-coveragerc -d {toxinidir}/htmlcov

Expand Down

0 comments on commit 16a2397

Please sign in to comment.