Skip to content

Commit 7b202d1

Browse files
authored
Merge branch 'master' into fix-interval-deeocopy
2 parents 713294a + d40ab96 commit 7b202d1

Some content is hidden

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

61 files changed

+2429
-1560
lines changed

.github/workflows/codspeed.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,35 @@ on:
1111

1212
jobs:
1313
benchmarks:
14-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-22.04
1515
steps:
1616
- uses: actions/checkout@v3
17-
- uses: actions/setup-python@v3
17+
- uses: actions/setup-python@v4
1818
with:
1919
python-version: "3.9"
2020

2121
- name: Get full Python version
2222
id: full-python-version
2323
run: |
24-
echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
24+
echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT
2525
2626
- name: Install poetry
2727
run: |
28-
curl -fsS https://install.python-poetry.org | python - -y
29-
30-
- name: Update PATH
31-
if: ${{ matrix.os != 'Windows' }}
32-
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
28+
pipx install poetry>=2
3329
3430
- name: Configure poetry
35-
run: poetry config virtualenvs.create false
31+
run: poetry config virtualenvs.in-project true
3632

3733
- name: Install dependencies
3834
run: poetry install --only test --only benchmark --only build -vvv --no-root
3935

40-
- name: Install project
41-
run: poetry install --only test --only benchmark --only build -vvv --no-root
42-
4336
- name: Install pendulum and check extensions
4437
run: |
4538
poetry run pip install -e . -vvv
46-
python -c 'import pendulum._pendulum'
39+
poetry run python -c 'import pendulum._pendulum'
4740
4841
- name: Run benchmarks
49-
uses: CodSpeedHQ/action@v1
42+
uses: CodSpeedHQ/action@v3
5043
with:
5144
token: ${{ secrets.CODSPEED_TOKEN }}
52-
run: pytest tests/ --codspeed
45+
run: poetry run pytest tests/ --codspeed

.github/workflows/release.yml

Lines changed: 48 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
jobs:
1010
build:
1111
name: Build on ${{ matrix.platform || matrix.os }} (${{ matrix.target }} - ${{ matrix.manylinux || 'auto' }})
12+
environment: release
1213
strategy:
1314
fail-fast: false
1415
matrix:
@@ -20,19 +21,17 @@ jobs:
2021
platform: linux
2122
- os: windows
2223
ls: dir
23-
interpreter: 3.7 3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9 pypy3.10
24+
interpreter: 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10
2425
- os: windows
2526
ls: dir
2627
target: aarch64
27-
interpreter: 3.11 3.12
28+
interpreter: 3.11 3.12 3.13
2829
- os: macos
2930
target: aarch64
30-
interpreter: 3.7 3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9 pypy3.10
31+
interpreter: 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10
3132
- os: ubuntu
3233
platform: linux
3334
target: aarch64
34-
# mimalloc not supported on manylinux2014 cross-compile container
35-
extra-build-args: --no-default-features
3635
# musllinux
3736
- os: ubuntu
3837
platform: linux
@@ -45,15 +44,11 @@ jobs:
4544
- os: ubuntu
4645
platform: linux
4746
target: ppc64le
48-
interpreter: 3.7 3.8 3.9 3.10 3.11 3.12
49-
# mimalloc not supported on manylinux2014 cross-compile container
50-
extra-build-args: --no-default-features
47+
interpreter: 3.9 3.10 3.11 3.12 3.13
5148
- os: ubuntu
5249
platform: linux
5350
target: s390x
54-
interpreter: 3.7 3.8 3.9 3.10 3.11 3.12
55-
# mimalloc not supported on manylinux2014 cross-compile container
56-
extra-build-args: --no-default-features
51+
interpreter: 3.9 3.10 3.11 3.12 3.13
5752

5853
runs-on: ${{ matrix.os }}-latest
5954
steps:
@@ -71,19 +66,20 @@ jobs:
7166
target: ${{ matrix.target }}
7267
manylinux: ${{ matrix.manylinux || 'auto' }}
7368
container: ${{ matrix.container }}
74-
args: --release --out dist --interpreter ${{ matrix.interpreter || '3.7 3.8 3.9 3.10 3.11 3.12 pypy3.7 pypy3.8 pypy3.9 pypy3.10' }} ${{ matrix.extra-build-args }}
69+
args: --release --out dist --interpreter ${{ matrix.interpreter || '3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10' }} ${{ matrix.extra-build-args }}
7570
rust-toolchain: stable
7671
docker-options: -e CI
7772

7873
- run: ${{ matrix.ls || 'ls -lh' }} dist/
7974

80-
- uses: actions/upload-artifact@v3
75+
- uses: actions/upload-artifact@v4
8176
with:
82-
name: dist
77+
name: dist-${{ matrix.os }}-${{ matrix.target }}-${{ matrix.manylinux }}
8378
path: dist
8479

8580
build_sdist:
8681
runs-on: ubuntu-latest
82+
environment: release
8783
steps:
8884
- uses: actions/checkout@v3
8985
- name: Build sdist
@@ -92,33 +88,53 @@ jobs:
9288
command: sdist
9389
args: --out dist
9490
- name: Upload sdist
95-
uses: actions/upload-artifact@v3
91+
uses: actions/upload-artifact@v4
9692
with:
97-
name: dist
93+
name: dist-sdist
94+
path: dist
95+
96+
build_no_ext:
97+
runs-on: ubuntu-latest
98+
environment: release
99+
steps:
100+
- uses: actions/checkout@v3
101+
- name: Install and configure Poetry
102+
run: pipx install poetry
103+
- name: Hotswap build backend for Poetry
104+
# Maturin doesn't support building no-extension wheels, so we swap to Poetry for that
105+
run: |
106+
sed -i -e '/^\[build-system\]/,/^\[/{s/^requires = .*/requires = ["poetry-core>=2.0.0,<3.0.0"]/; s/^build-backend = .*/build-backend = "poetry.core.masonry.api"/}' pyproject.toml
107+
- name: Install dependencies
108+
run: poetry install --only main --only test --only typing --only build
109+
- name: Run poetry build
110+
run: poetry build -f wheel
111+
- name: Upload no-ext wheel
112+
uses: actions/upload-artifact@v4
113+
with:
114+
name: dist-any
98115
path: dist
99116

100117

101118
Release:
102-
needs: [ build, build_sdist ]
103-
if: success() && startsWith(github.ref, 'refs/tags/')
119+
needs: [ build, build_sdist, build_no_ext ]
120+
if: success()
104121
runs-on: ubuntu-latest
105-
122+
permissions:
123+
id-token: write
124+
contents: write
125+
environment:
126+
name: pypi
127+
url: https://pypi.org/project/pendulum/
106128
steps:
107129
- name: Checkout code
108130
uses: actions/checkout@v2
109131

110132
- name: Download artifacts
111-
uses: actions/download-artifact@v3
133+
uses: actions/download-artifact@v4
112134
with:
113-
name: dist
135+
pattern: dist*
114136
path: dist
115-
116-
- name: Install Poetry
117-
run: |
118-
curl -fsS https://install.python-poetry.org | python - -y
119-
120-
- name: Update PATH
121-
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
137+
merge-multiple: true
122138

123139
- name: Check distributions
124140
run: |
@@ -128,18 +144,15 @@ jobs:
128144
id: check-version
129145
run: |
130146
[[ "${GITHUB_REF#refs/tags/}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] \
131-
|| echo ::set-output name=prerelease::true
147+
|| echo prerelease=true >> $GITHUB_OUTPUT
132148
133149
- name: Create Release
134150
uses: ncipollo/release-action@v1
135151
with:
136152
artifacts: "dist/*"
137-
token: ${{ secrets.GITHUB_TOKEN }}
138153
draft: false
139154
prerelease: steps.check-version.outputs.prerelease == 'true'
155+
body: "See CHANGELOG.md for details"
140156

141-
- name: Publish to PyPI
142-
env:
143-
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
144-
run: |
145-
poetry publish
157+
- name: Publish package distributions to PyPI
158+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/tests.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
strategy:
3434
matrix:
3535
os: [Ubuntu, MacOS, Windows]
36-
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
36+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
3737
defaults:
3838
run:
3939
shell: bash
@@ -50,19 +50,11 @@ jobs:
5050
- name: Get full Python version
5151
id: full-python-version
5252
run: |
53-
echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
53+
echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT
5454
5555
- name: Install poetry
5656
run: |
57-
curl -fsS https://install.python-poetry.org | python - --preview -y
58-
59-
- name: Update PATH
60-
if: ${{ matrix.os != 'Windows' }}
61-
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
62-
63-
- name: Update Path for Windows
64-
if: ${{ matrix.os == 'Windows' }}
65-
run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH
57+
pipx install poetry>=2
6658
6759
- name: Configure poetry
6860
run: poetry config virtualenvs.in-project true
@@ -90,7 +82,7 @@ jobs:
9082

9183
- name: Uninstall typing dependencies
9284
# This ensures pendulum runs without typing_extensions installed
93-
run: poetry install --only main --only test --only build --sync --no-root -vvv
85+
run: poetry sync --only main --only test --only build --no-root -vvv
9486

9587
- name: Test Pure Python
9688
run: |

.pre-commit-config.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,11 @@ repos:
1111
exclude: ^tests/.*/fixtures/.*
1212
- id: debug-statements
1313

14-
- repo: https://github.com/psf/black
15-
rev: 23.7.0
16-
hooks:
17-
- id: black
18-
1914
- repo: https://github.com/astral-sh/ruff-pre-commit
20-
rev: v0.0.291
15+
rev: v0.11.2
2116
hooks:
22-
- id: ruff
17+
- id: ruff
18+
- id: ruff-format
2319

2420
- repo: local
2521
hooks:

0 commit comments

Comments
 (0)