Skip to content

Commit 745a036

Browse files
committed
Modernize codebase and drop support for Python 2.7 and 3.5
1 parent 4b79cb7 commit 745a036

File tree

21 files changed

+463
-1111
lines changed

21 files changed

+463
-1111
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
runs-on: macos-latest
3030
strategy:
3131
matrix:
32-
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
32+
python-version: [3.6, 3.7, 3.8]
3333

3434
steps:
3535
- uses: actions/checkout@v2
@@ -59,7 +59,7 @@ jobs:
5959
runs-on: windows-latest
6060
strategy:
6161
matrix:
62-
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
62+
python-version: [3.6, 3.7, 3.8]
6363

6464
steps:
6565
- uses: actions/checkout@v2

.github/workflows/tests.yml

Lines changed: 56 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -26,139 +26,66 @@ jobs:
2626
run: |
2727
pip install pre-commit
2828
pre-commit run --all-files
29-
Linux:
29+
30+
Tests:
3031
needs: Linting
31-
runs-on: ubuntu-latest
32+
name: ${{ matrix.os }} / ${{ matrix.python-version }}
33+
runs-on: ${{ matrix.os }}-latest
3234
strategy:
3335
matrix:
34-
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, pypy3]
35-
36+
os: [Ubuntu, MacOS, Windows]
37+
python-version: [3.6, 3.7, 3.8, pypy3]
3638
steps:
37-
- uses: actions/checkout@v2
38-
- name: Set up Python ${{ matrix.python-version }}
39-
uses: actions/setup-python@v1
40-
with:
41-
python-version: ${{ matrix.python-version }}
42-
- name: Get full python version
43-
id: full-python-version
44-
run: |
45-
echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
46-
- name: Install and set up Poetry
47-
run: |
48-
curl -fsS -o get-poetry.py https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py
49-
python get-poetry.py -y
50-
source $HOME/.poetry/env
51-
poetry config virtualenvs.in-project true
52-
- name: Set up cache
53-
uses: actions/cache@v1
54-
with:
55-
path: .venv
56-
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
57-
- name: Upgrade pip
58-
run: |
59-
source $HOME/.poetry/env
60-
poetry run python -m pip install pip -U
61-
- name: Install dependencies
62-
run: |
63-
source $HOME/.poetry/env
64-
poetry install -vvv
65-
- name: Test Pure Python
66-
run: |
67-
source $HOME/.poetry/env
68-
PENDULUM_EXTENSIONS=0 poetry run pytest -q tests
69-
- name: Test
70-
run: |
71-
source $HOME/.poetry/env
72-
poetry run pytest -q tests
73-
poetry install
39+
- uses: actions/checkout@v2
7440

75-
MacOS:
76-
needs: Linting
77-
runs-on: macos-latest
78-
strategy:
79-
matrix:
80-
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, pypy3]
41+
- name: Set up Python ${{ matrix.python-version }}
42+
uses: actions/setup-python@v1
43+
with:
44+
python-version: ${{ matrix.python-version }}
8145

82-
steps:
83-
- uses: actions/checkout@v2
84-
- name: Set up Python ${{ matrix.python-version }}
85-
uses: actions/setup-python@v1
86-
with:
87-
python-version: ${{ matrix.python-version }}
88-
- name: Get full python version
89-
id: full-python-version
90-
run: |
91-
echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
92-
- name: Install and set up Poetry
93-
run: |
94-
curl -fsS -o get-poetry.py https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py
95-
python get-poetry.py -y
96-
source $HOME/.poetry/env
97-
poetry config virtualenvs.in-project true
98-
- name: Set up cache
99-
uses: actions/cache@v1
100-
with:
101-
path: .venv
102-
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-fix-${{ hashFiles('**/poetry.lock') }}
103-
- name: Upgrade pip
104-
run: |
105-
source $HOME/.poetry/env
106-
poetry run python -m pip install pip -U
107-
- name: Install dependencies
108-
run: |
109-
source $HOME/.poetry/env
110-
poetry install -vvv
111-
- name: Test Pure Python
112-
run: |
113-
source $HOME/.poetry/env
114-
PENDULUM_EXTENSIONS=0 poetry run pytest -q tests
115-
- name: Test
116-
run: |
117-
source $HOME/.poetry/env
118-
poetry run pytest -q tests
119-
Windows:
120-
needs: Linting
121-
runs-on: windows-latest
122-
strategy:
123-
matrix:
124-
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
46+
- name: Get full Python version
47+
id: full-python-version
48+
shell: bash
49+
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
12550

126-
steps:
127-
- uses: actions/checkout@v2
128-
- name: Set up Python ${{ matrix.python-version }}
129-
uses: actions/setup-python@v1
130-
with:
131-
python-version: ${{ matrix.python-version }}
132-
- name: Get full python version
133-
id: full-python-version
134-
shell: bash
135-
run: |
136-
echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
137-
- name: Install and setup Poetry
138-
run: |
139-
Invoke-WebRequest https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -O get-poetry.py
140-
python get-poetry.py -y
141-
$env:Path += ";$env:Userprofile\.poetry\bin"
142-
poetry config virtualenvs.in-project true
143-
- name: Set up cache
144-
uses: actions/cache@v1
145-
with:
146-
path: .venv
147-
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
148-
- name: Upgrade pip
149-
run: |
150-
$env:Path += ";$env:Userprofile\.poetry\bin"
151-
poetry run python -m pip install pip -U
152-
- name: Install dependencies
153-
run: |
154-
$env:Path += ";$env:Userprofile\.poetry\bin"
155-
poetry install -vvv
156-
- name: Test Pure Python
157-
run: |
158-
$env:Path += ";$env:Userprofile\.poetry\bin"
159-
$env:PENDULUM_EXTENSIONS = "0"
160-
poetry run pytest -q tests
161-
- name: Test
162-
run: |
163-
$env:Path += ";$env:Userprofile\.poetry\bin"
164-
poetry run pytest -q tests
51+
- name: Install poetry
52+
shell: bash
53+
run: |
54+
curl -fsS -o get-poetry.py https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py
55+
python get-poetry.py --preview -y
56+
echo "::set-env name=PATH::$HOME/.poetry/bin:$PATH"
57+
58+
- name: Configure poetry
59+
shell: bash
60+
run: poetry config virtualenvs.in-project true
61+
62+
- name: Set up cache
63+
uses: actions/cache@v2
64+
id: cache
65+
with:
66+
path: .venv
67+
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
68+
69+
- name: Ensure cache is healthy
70+
if: steps.cache.outputs.cache-hit == 'true'
71+
shell: bash
72+
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
73+
74+
- name: Upgrade pip
75+
shell: bash
76+
run: |
77+
poetry run python -m pip install pip -U
78+
79+
- name: Install dependencies
80+
shell: bash
81+
run: poetry install -vvv
82+
83+
- name: Test Pure Python
84+
shell: bash
85+
run: |
86+
PENDULUM_EXTENSIONS=0 poetry run pytest -q tests
87+
88+
- name: Test
89+
shell: bash
90+
run: |
91+
poetry run pytest -q tests

build-wheels.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ for PYBIN in /opt/python/cp3*/bin; do
1313
if [ "$PYBIN" == "/opt/python/cp34-cp34m/bin" ]; then
1414
continue
1515
fi
16+
if [ "$PYBIN" == "/opt/python/cp35-cp35m/bin" ]; then
17+
continue
18+
fi
1619
rm -rf build
1720
"${PYBIN}/python" $HOME/.poetry/bin/poetry build -vvv
1821
done

0 commit comments

Comments
 (0)