Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hatch to manage Python virtualenvs #87

Merged
merged 15 commits into from
Nov 8, 2022
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
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,26 @@ assert value == "hello world!"

## Development Setup

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

0. [Install Rust](https://www.rust-lang.org/tools/install) and [Python](https://www.python.org/downloads/) (consider [pyenv](https://github.com/pyenv/pyenv))
kafonek marked this conversation as resolved.
Show resolved Hide resolved
1. Install [hatch](https://hatch.pypa.io/1.2/install/) (`python -m pip install hatch`)
kafonek marked this conversation as resolved.
Show resolved Hide resolved
2. Create a development build of the library

kafonek marked this conversation as resolved.
Show resolved Hide resolved
```
pip install maturin
python -m hatch run maturin develop
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is a bit too much to always prepend python -m:

Suggested change
python -m hatch run maturin develop
hatch run maturin develop

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you get a binary on your path when you installed hatch? I have Python 3.9.11 via pyenv as my default python (WSL OS). When I python -m pip install hatch, I can use python -m hatch afterwards but hatch is not found. I was going to actually drop a note on the hatch repo saying their docs seemed inconsistent with my experience.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, hatch is in my path. Maybe worth opening an issue there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep I'll bring it up, switched the examples to use hatch and put a caveat next to the CONDA env caveat

```

2. Create a development build of the library
`maturin develop`

## Tests

All tests are located in `/tests`. You can run them with `pytest`.

```
pytest
python -m hatch run pytest
```

## Build Ypy :

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

```
maturin build
python -m hatch run maturin build
```
14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
[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"]
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

3 changes: 0 additions & 3 deletions setup.py

This file was deleted.