Skip to content

Commit 4d86638

Browse files
authored
Rewrite extensions in Rust (#721)
1 parent 2e9b37e commit 4d86638

37 files changed

+2403
-2844
lines changed

.cargo/config.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[build]
2+
rustflags = []
3+
4+
# see https://pyo3.rs/main/building_and_distribution.html#macos
5+
[target.x86_64-apple-darwin]
6+
rustflags = [
7+
"-C", "link-arg=-undefined",
8+
"-C", "link-arg=dynamic_lookup",
9+
]
10+
11+
[target.aarch64-apple-darwin]
12+
rustflags = [
13+
"-C", "link-arg=-undefined",
14+
"-C", "link-arg=dynamic_lookup",
15+
]

.github/workflows/codspeed.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,22 @@ jobs:
2525
2626
- name: Install poetry
2727
run: |
28-
curl -fsS https://install.python-poetry.org | python - --preview -y
28+
curl -fsS https://install.python-poetry.org | python - -y
2929
3030
- name: Update PATH
3131
if: ${{ matrix.os != 'Windows' }}
3232
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
3333

34-
- name: Update Path for Windows
35-
if: ${{ matrix.os == 'Windows' }}
36-
run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH
37-
3834
- name: Configure poetry
3935
run: poetry config virtualenvs.create false
4036

4137
- name: Install dependencies
42-
run: poetry install --only main --only test --only benchmark -vvv
38+
run: poetry install --only test --only benchmark -vvv --no-root
39+
40+
- name: Install pendulum and check extensions
41+
run: |
42+
MATURIN_BUILD_ARGS="--no-default-features -vv" pip install -e . -v
43+
python -c 'import _pendulum; assert _pendulum.__pendulum_default_allocator__'
4344
4445
- name: Run benchmarks
4546
uses: CodSpeedHQ/action@v1

.github/workflows/tests.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ on:
1313
- '**'
1414

1515
jobs:
16+
Linting:
17+
name: Linting
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: actions/setup-python@v4
22+
with:
23+
python-version: "3.11"
24+
- name: "Install pre-commit"
25+
run: pip install pre-commit
26+
- name: "Install Rust toolchain"
27+
run: rustup component add rustfmt clippy
28+
- run: pre-commit run --all-files
29+
1630
Tests:
1731
name: ${{ matrix.os }} / ${{ matrix.python-version }}
1832
runs-on: ${{ matrix.os }}-latest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ setup.py
3535
# editor
3636

3737
.vscode
38+
/target

.pre-commit-config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,12 @@ repos:
2020
rev: v0.0.283
2121
hooks:
2222
- id: ruff
23+
24+
- repo: local
25+
hooks:
26+
- id: lint-rust
27+
name: Lint Rust
28+
entry: make lint-rust
29+
types: [rust]
30+
language: rust
31+
pass_filenames: false

0 commit comments

Comments
 (0)