Skip to content

Commit f1df7dc

Browse files
authored
Merge pull request #569 from sdispater/modernize-codebase
Modernize codebase
2 parents 4b79cb7 + 607bab4 commit f1df7dc

File tree

134 files changed

+1600
-3424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+1600
-3424
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: 62 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -18,147 +18,78 @@ jobs:
1818

1919
steps:
2020
- uses: actions/checkout@v2
21-
- name: Set up Python 3.8
21+
- name: Set up Python 3.9
2222
uses: actions/setup-python@v1
2323
with:
24-
python-version: 3.8
24+
python-version: 3.9
2525
- name: Linting
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.7, 3.8, 3.9, "3.10"]
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 install-poetry.py https://raw.githubusercontent.com/sdispater/poetry/master/install-poetry.py
55+
python install-poetry.py --preview -y
56+
57+
- name: Update PATH
58+
if: ${{ matrix.os != 'Windows' }}
59+
shell: bash
60+
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
61+
62+
- name: Update Path for Windows
63+
if: ${{ matrix.os == 'Windows' }}
64+
shell: bash
65+
run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH
66+
67+
- name: Configure poetry
68+
shell: bash
69+
run: poetry config virtualenvs.in-project true
70+
71+
- name: Set up cache
72+
uses: actions/cache@v2
73+
id: cache
74+
with:
75+
path: .venv
76+
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
77+
78+
- name: Ensure cache is healthy
79+
if: steps.cache.outputs.cache-hit == 'true'
80+
shell: bash
81+
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
82+
83+
- name: Install dependencies
84+
shell: bash
85+
run: poetry install --only default --only test -vvv
86+
87+
- name: Test Pure Python
88+
shell: bash
89+
run: |
90+
PENDULUM_EXTENSIONS=0 poetry run pytest -q tests
91+
92+
- name: Test
93+
shell: bash
94+
run: |
95+
poetry run pytest -q tests

.pre-commit-config.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: stable
3+
rev: 21.9b0
44
hooks:
55
- id: black
66

77
- repo: https://gitlab.com/pycqa/flake8
8-
rev: 3.7.8
8+
rev: 3.9.2
99
hooks:
1010
- id: flake8
1111

1212
- repo: https://github.com/timothycrosley/isort
13-
rev: 4.3.21
13+
rev: 5.9.3
1414
hooks:
1515
- id: isort
1616
additional_dependencies: [toml]
1717
exclude: ^.*/?setup\.py$
1818

19+
- repo: https://github.com/asottile/pyupgrade
20+
rev: v2.29.0
21+
hooks:
22+
- id: pyupgrade
23+
1924
- repo: https://github.com/pre-commit/pre-commit-hooks
20-
rev: v2.3.0
25+
rev: v4.0.1
2126
hooks:
2227
- id: trailing-whitespace
2328
exclude: ^tests/.*/fixtures/.*

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)