Skip to content

Commit 8b55544

Browse files
authored
Fix CI (#635)
* Fix CI * Change default group to main * Add pre-commit ci config * Refresh release workflow * Formatting
1 parent ffebe0f commit 8b55544

File tree

4 files changed

+24
-43
lines changed

4 files changed

+24
-43
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3
1515
- name: Get tag
1616
id: tag
1717
run: |
@@ -29,7 +29,7 @@ jobs:
2929
runs-on: macos-latest
3030
strategy:
3131
matrix:
32-
python-version: [3.6, 3.7, 3.8]
32+
python-version: [3.7, 3.8, 3.9, "3.10"]
3333

3434
steps:
3535
- uses: actions/checkout@v2
@@ -43,8 +43,7 @@ jobs:
4343
python-version: ${{ matrix.python-version }}
4444
- name: Install and set up Poetry
4545
run: |
46-
curl -fsS -o get-poetry.py https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py
47-
python get-poetry.py -y
46+
curl -fsS https://install.python-poetry.org | python - --preview -y
4847
- name: Build distributions
4948
run: |
5049
source $HOME/.poetry/env
@@ -59,7 +58,7 @@ jobs:
5958
runs-on: windows-latest
6059
strategy:
6160
matrix:
62-
python-version: [3.6, 3.7, 3.8]
61+
python-version: [3.7, 3.8, 3.9, "3.10"]
6362

6463
steps:
6564
- uses: actions/checkout@v2
@@ -74,8 +73,7 @@ jobs:
7473
python-version: ${{ matrix.python-version }}
7574
- name: Install and setup Poetry
7675
run: |
77-
Invoke-WebRequest https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py -O get-poetry.py
78-
python get-poetry.py -y
76+
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python - --preview -y
7977
- name: Build distributions
8078
run: |
8179
$env:Path += ";$env:Userprofile\.poetry\bin"
@@ -104,8 +102,7 @@ jobs:
104102
path: dist
105103
- name: Install and set up Poetry
106104
run: |
107-
curl -fsS -o get-poetry.py https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py
108-
python get-poetry.py -y
105+
curl -fsS https://install.python-poetry.org | python - --preview -y
109106
- name: Set up cache
110107
uses: actions/cache@v1
111108
with:

.github/workflows/tests.yml

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,83 +13,64 @@ on:
1313
- '**'
1414

1515
jobs:
16-
Linting:
17-
runs-on: ubuntu-latest
18-
19-
steps:
20-
- uses: actions/checkout@v2
21-
- name: Set up Python 3.9
22-
uses: actions/setup-python@v1
23-
with:
24-
python-version: 3.9
25-
- name: Linting
26-
run: |
27-
pip install pre-commit
28-
pre-commit run --all-files
29-
3016
Tests:
31-
needs: Linting
3217
name: ${{ matrix.os }} / ${{ matrix.python-version }}
3318
runs-on: ${{ matrix.os }}-latest
3419
strategy:
3520
matrix:
3621
os: [Ubuntu, MacOS, Windows]
3722
python-version: [3.7, 3.8, 3.9, "3.10"]
23+
defaults:
24+
run:
25+
shell: bash
26+
3827
steps:
39-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v3
4029

4130
- name: Set up Python ${{ matrix.python-version }}
42-
uses: actions/setup-python@v1
31+
uses: actions/setup-python@v4
4332
with:
4433
python-version: ${{ matrix.python-version }}
4534

4635
- name: Get full Python version
4736
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))")
37+
run: |
38+
echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
5039
5140
- name: Install poetry
52-
shell: bash
5341
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
42+
curl -fsS https://install.python-poetry.org | python - --preview -y
5643
5744
- name: Update PATH
5845
if: ${{ matrix.os != 'Windows' }}
59-
shell: bash
6046
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
6147

6248
- name: Update Path for Windows
6349
if: ${{ matrix.os == 'Windows' }}
64-
shell: bash
6550
run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH
6651

6752
- name: Configure poetry
68-
shell: bash
6953
run: poetry config virtualenvs.in-project true
7054

7155
- name: Set up cache
72-
uses: actions/cache@v2
56+
uses: actions/cache@v3
7357
id: cache
7458
with:
7559
path: .venv
7660
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
7761

7862
- 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
63+
# MacOS does not come with `timeout` command out of the box
64+
if: steps.cache.outputs.cache-hit == 'true' && matrix.os != 'MacOS'
65+
run: timeout 10s poetry run pip --version || rm -rf .venv
8266

8367
- name: Install dependencies
84-
shell: bash
85-
run: poetry install --only default --only test -vvv
68+
run: poetry install --only main --only test -vvv
8669

8770
- name: Test Pure Python
88-
shell: bash
8971
run: |
9072
PENDULUM_EXTENSIONS=0 poetry run pytest -q tests
9173
9274
- name: Test
93-
shell: bash
9475
run: |
9576
poetry run pytest -q tests

.pre-commit-config.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
ci:
2+
autofix_prs: false
3+
14
repos:
25
- repo: https://github.com/psf/black
36
rev: 22.6.0

pendulum/formatting/formatter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Formatter:
6363
"Mo": None,
6464
"DDDo": None,
6565
"Do": lambda locale: tuple(
66-
fr"\d+{o}" for o in locale.get("custom.ordinal").values()
66+
rf"\d+{o}" for o in locale.get("custom.ordinal").values()
6767
),
6868
"dddd": "days.wide",
6969
"ddd": "days.abbreviated",

0 commit comments

Comments
 (0)