Skip to content

Commit 107ea7e

Browse files
authored
Merge pull request #136 from p1c2u/feature/switch-to-poetry
Switch to poetry and update dependencies
2 parents f8645de + 70b5482 commit 107ea7e

11 files changed

+992
-164
lines changed

.bumpversion.cfg

+4
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ message = Version {new_version}
1111
[bumpversion:file:openapi_spec_validator/__init__.py]
1212

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

.github/workflows/python-publish.yml

+21-22
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88
release:
99
types:
10-
- created
10+
- created
1111

1212
jobs:
1313
publish:
@@ -16,24 +16,23 @@ jobs:
1616
matrix:
1717
python-version: [2.7, 3.6]
1818
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 setuptools wheel twine
28-
- name: Build
29-
run: python setup.py sdist bdist_wheel
30-
- name: Publish wheel
31-
env:
32-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
33-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
34-
run: twine upload dist/*.whl
35-
- name: Publish source
36-
env:
37-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
38-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
39-
run: twine upload dist/*.tar.gz || true
19+
- uses: actions/checkout@v2
20+
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Bootstrap poetry
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install "poetry<1.2"
30+
31+
- name: Build
32+
run: poetry build
33+
34+
- name: Publish
35+
env:
36+
POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
37+
POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
38+
run: poetry publish

.github/workflows/python-test.yml

+41-17
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,51 @@ on:
1010

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

.travis.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ matrix:
1313
allow_failures:
1414
- python: nightly
1515
before_install:
16-
- pip install codecov
16+
- python -m pip install --upgrade pip
17+
- pip install "poetry<1.2"
1718
install:
18-
- pip install -r requirements.txt
19-
- pip install -r requirements_dev.txt
20-
- pip install -e .
19+
- poetry install
2120
script:
22-
- python setup.py test
21+
- poetry run pytest
2322
after_success:
2423
- codecov

0 commit comments

Comments
 (0)