Skip to content

Commit

Permalink
Fix pyo3_mock_data CI build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
sanders41 committed Oct 16, 2024
1 parent 0280849 commit 3236d51
Show file tree
Hide file tree
Showing 7 changed files with 210 additions and 35 deletions.
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/pyo3_mock_data/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ crate-type = ["cdylib"]
[dependencies]
csv = "1.3.0"
fake = { version = "2.9.2", features = ["derive"] }
pyo3 = { version = "0.21.0", features = ["abi3-py38"] }
pyo3 = { version = "0.22.5", features = ["extension-module"] }
rand = "0.8.5"
serde = { version = "1.0.193", features = ["derive"] }
unicode-normalization = "0.1.22"
6 changes: 3 additions & 3 deletions src/pyo3_mock_data/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ lint:
cargo clippy --all-targets --quiet

develop:
maturin develop
uv run maturin develop

release:
maturin develop -r
uv run maturin develop -r

test: develop
pytest
uv run pytest

all: format check lint test
21 changes: 10 additions & 11 deletions src/pyo3_mock_data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ makes sense to write a Rust extension that can be called from Python, which is t

The dataset should be in the following format:


```json
{
"id": "int",
Expand Down Expand Up @@ -82,12 +81,12 @@ Install the dependencies in a virtual environment via `requirements.txt`.

```bash
# First time setup
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uv venv
source .venv/bin/activate
uv sync --frozen

# For subsequent runs, simply activate the environment
source venv/bin/activate
source .venv/bin/activate
```

### Build the Rust module
Expand All @@ -100,7 +99,7 @@ or directly.
make develop

# Directly with Maturin
maturin develop
uv run maturin develop
```

### Run script
Expand All @@ -115,9 +114,9 @@ that someone :joy:.

```bash
# Generate 10 mock person profiles
python main.py -n 10
uv run python main.py -n 10
# Generate 1000 mock person profiles
python main.py -n 1000
uv run python main.py -n 1000
```

### Run tests
Expand All @@ -130,8 +129,8 @@ running the tests. If you run manually don't forget the build step before testin
make test

# manually
maturin develop
pytest
uv run maturin develop
uv run pytest

==================================================================================== test session starts =====================================================================================
platform linux -- Python 3.12.2, pytest-8.0.0, pluggy-1.4.0
Expand Down Expand Up @@ -165,7 +164,7 @@ can be done with either the provide Makefile or manually.
make release

# Manually
maturin develop -r
uv run maturin develop -r
```

## Performance
Expand Down
13 changes: 10 additions & 3 deletions src/pyo3_mock_data/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,27 @@ build-backend = "maturin"

[project]
name = "pyo3-mock-data"
requires-python = ">=3.8"
requires-python = ">=3.9"

[tool.maturin]
module-name = "pyo3_mock_data._pyo3_mock_data"
binding = "pyo3"
# features = ["pyo3/extension-module"]
features = ["pyo3/extension-module"]

[tool.uv]
dev-dependencies = [
"maturin==1.7.3",
"mypy==1.12.0",
"pytest==8.3.3",
]

[tool.mypy]
check_untyped_defs = true
disallow_untyped_defs = true

[tool.ruff]
line-length = 100
target-version = "py38"
target-version = "py39"
fix = true

[tool.ruff.lint]
Expand Down
5 changes: 0 additions & 5 deletions src/pyo3_mock_data/requirements.txt

This file was deleted.

Loading

0 comments on commit 3236d51

Please sign in to comment.