Skip to content

Commit

Permalink
Rewrite extensions in Rust (#721)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdispater authored Aug 9, 2023
1 parent 2e9b37e commit 4d86638
Show file tree
Hide file tree
Showing 37 changed files with 2,403 additions and 2,844 deletions.
15 changes: 15 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[build]
rustflags = []

# see https://pyo3.rs/main/building_and_distribution.html#macos
[target.x86_64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]

[target.aarch64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
13 changes: 7 additions & 6 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,22 @@ jobs:
- name: Install poetry
run: |
curl -fsS https://install.python-poetry.org | python - --preview -y
curl -fsS https://install.python-poetry.org | python - -y
- name: Update PATH
if: ${{ matrix.os != 'Windows' }}
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Update Path for Windows
if: ${{ matrix.os == 'Windows' }}
run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH

- name: Configure poetry
run: poetry config virtualenvs.create false

- name: Install dependencies
run: poetry install --only main --only test --only benchmark -vvv
run: poetry install --only test --only benchmark -vvv --no-root

- name: Install pendulum and check extensions
run: |
MATURIN_BUILD_ARGS="--no-default-features -vv" pip install -e . -v
python -c 'import _pendulum; assert _pendulum.__pendulum_default_allocator__'
- name: Run benchmarks
uses: CodSpeedHQ/action@v1
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ on:
- '**'

jobs:
Linting:
name: Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: "Install pre-commit"
run: pip install pre-commit
- name: "Install Rust toolchain"
run: rustup component add rustfmt clippy
- run: pre-commit run --all-files

Tests:
name: ${{ matrix.os }} / ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ setup.py
# editor

.vscode
/target
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,12 @@ repos:
rev: v0.0.283
hooks:
- id: ruff

- repo: local
hooks:
- id: lint-rust
name: Lint Rust
entry: make lint-rust
types: [rust]
language: rust
pass_filenames: false
Loading

0 comments on commit 4d86638

Please sign in to comment.