Skip to content

Commit 0182620

Browse files
authored
Merge pull request #27 from p1c2u/feature/poetry
Switch to poetry
2 parents 03786f6 + 0b212fc commit 0182620

10 files changed

+1000
-165
lines changed

.bumpversion.cfg

+3
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-publish.yml

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

1212
jobs:
1313
publish:
1414
runs-on: ubuntu-latest
15-
strategy:
16-
matrix:
17-
python-version: [2.7, 3.6]
1815
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
16+
- uses: actions/checkout@v2
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: '3.x'
22+
23+
- name: Bootstrap poetry
24+
run: |
25+
curl -sL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - -y
26+
echo "$HOME/.local/bin" >> $GITHUB_PATH
27+
28+
- name: Build
29+
run: poetry build
30+
31+
- name: Publish
32+
env:
33+
POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
34+
POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
35+
run: poetry publish

.github/workflows/python-test.yml

+42-16
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:
16-
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9]
17+
python-version: [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 -E rfc3339-validator -E strict-rfc3339 -E isodate
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

+4-8
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ language: python
22
sudo: false
33
matrix:
44
include:
5-
- python: 2.7
6-
- python: 3.5
75
- python: 3.6
86
- python: 3.7
97
- python: 3.8
@@ -13,13 +11,11 @@ matrix:
1311
allow_failures:
1412
- python: nightly
1513
before_install:
16-
- pip install codecov
17-
- pip install 'py>=1.5.0'
14+
- curl -sL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - -y
15+
- export PATH=$PATH:$HOME/.local/bin
1816
install:
19-
- pip install -r requirements.txt
20-
- pip install -r requirements_dev.txt
21-
- pip install -e .
17+
- poetry install
2218
script:
23-
- python setup.py test
19+
- poetry run pytest
2420
after_success:
2521
- codecov

0 commit comments

Comments
 (0)