Skip to content

Commit e846615

Browse files
committed
Switch to poetry
1 parent 03786f6 commit e846615

File tree

9 files changed

+980
-137
lines changed

9 files changed

+980
-137
lines changed

.bumpversion.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ serialize =
1010

1111
[bumpversion:file:openapi_schema_validator/__init__.py]
1212

13+
[bumpversion:file:pyproject.toml]
14+
search = version = "{current_version}"
15+
replace = version = "{new_version}"

.github/workflows/python-test.yml

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,50 @@ on:
1010

1111
jobs:
1212
test:
13+
name: "Tests"
1314
runs-on: ubuntu-latest
1415
strategy:
1516
matrix:
1617
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
1718
fail-fast: false
1819
steps:
19-
- uses: actions/checkout@v2
20-
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v2
22-
with:
23-
python-version: ${{ matrix.python-version }}
24-
- name: Install dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
pip install -r requirements.txt
28-
pip install -r requirements_dev.txt
29-
pip install -e .
30-
- name: Test
31-
run: python setup.py test
32-
- name: Upload coverage
33-
uses: codecov/codecov-action@v1
20+
- uses: actions/checkout@v2
21+
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
27+
- name: Get full Python version
28+
id: full-python-version
29+
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
30+
31+
- name: Bootstrap poetry
32+
run: |
33+
curl -sL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - -y
34+
echo "$HOME/.local/bin" >> $GITHUB_PATH
35+
36+
- name: Configure poetry
37+
run: poetry config virtualenvs.in-project true
38+
39+
- name: Set up cache
40+
uses: actions/cache@v2
41+
id: cache
42+
with:
43+
path: .venv
44+
key: venv-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
45+
46+
- name: Ensure cache is healthy
47+
if: steps.cache.outputs.cache-hit == 'true'
48+
run: timeout 10s poetry run pip --version || rm -rf .venv
49+
50+
- name: Install dependencies
51+
run: poetry install
52+
53+
- name: Test
54+
env:
55+
PYTEST_ADDOPTS: "--color=yes"
56+
run: poetry run pytest
57+
58+
- name: Upload coverage
59+
uses: codecov/codecov-action@v1

.travis.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@ matrix:
1313
allow_failures:
1414
- python: nightly
1515
before_install:
16-
- pip install codecov
17-
- pip install 'py>=1.5.0'
16+
- curl -sL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - -y
17+
- export PATH=$PATH:$HOME/.local/bin
1818
install:
19-
- pip install -r requirements.txt
20-
- pip install -r requirements_dev.txt
21-
- pip install -e .
19+
- poetry install
2220
script:
23-
- python setup.py test
21+
- poetry run pytest
2422
after_success:
2523
- codecov

0 commit comments

Comments
 (0)