Skip to content

Commit

Permalink
Merge pull request #87 from kafonek/hatch
Browse files Browse the repository at this point in the history
Hatch to manage Python virtualenvs
  • Loading branch information
Waidhoferj authored Nov 8, 2022
2 parents 8d1d416 + e26484c commit 792dc96
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 23 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ jobs:
toolchain: stable
profile: minimal
default: true
- name: Install Hatch
run: |
pip install hatch
- name: Build Ypy
run: |
pip install maturin
maturin develop
unset CONDA_PREFIX
hatch run maturin develop
- name: Run Tests
run: |
pip install pytest
pytest
hatch run pytest
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
name = "y-py"
version = "0.5.4"
rust-version = "1.58"
authors = ["John Waidhofer <[email protected]>", "Kevin Jahns <[email protected]>", "Pierre-Olivier Simonard <[email protected]>"]
edition = "2018"
homepage = "https://github.com/y-crdt/ypy"
repository = "https://github.com/y-crdt/ypy"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,22 @@ assert value == "hello world!"

## Development Setup

0. Install Rust and Python
1. Install `maturin` in order to build Ypy

```
pip install maturin
```

2. Create a development build of the library
`maturin develop`
0. Install [Rust](https://www.rust-lang.org/tools/install) and [Python](https://www.python.org/downloads/)
1. Install `maturin` in order to build Ypy: `pip install maturin`
2. Create a development build of the library: `maturin develop`

## Tests

All tests are located in `/tests`. You can run them with `pytest`.
All tests are located in `/tests`. If you are using `hatch`, there is a `test` environment matrix defined in `pyproject.toml` that will run `pytest` against `py37` through `py311`. To run the tests, install `pytest` and run the command line tool from the project root:

```
pip install pytest
pytest
```

## Build Ypy :

Build the library as a wheel and store them in `target/wheels` :
Build the library as a wheel and store them in `target/wheels`:

```
maturin build
Expand Down
17 changes: 17 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
[build-system]
requires = ["maturin>=0.13,<0.14"]
build-backend = "maturin"

[project]
name = "y-py"
version = "0.5.4"
description = "Python bindings for the Y-CRDT built from yrs (Rust)"
authors = [
{ name = "John Waidhofer", email = "[email protected]" },
{ name = "Kevin Jahns", email = "[email protected]" },
{ name = "Pierre-Olivier Simonard", email = "[email protected]" }
]
readme = "README.md"
homepage = "https://github.com/y-crdt/ypy"
repository = "https://github.com/y-crdt/ypy"
dependencies = ["pytest", "maturin"]

[[tool.hatch.envs.test.matrix]]
python = ["37", "38", "39", "310", "311"]
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

3 changes: 0 additions & 3 deletions setup.py

This file was deleted.

0 comments on commit 792dc96

Please sign in to comment.